send block creation events for sub-blocks as well (#3247)
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Docsite CI/CD / Build Docsite (push) Has been cancelled
TestDriver.ai Build / Build for TestDriver.ai (push) Has been cancelled
Docsite CI/CD / Deploy to GitHub Pages (push) Has been cancelled

need to understand vdom usage
This commit is contained in:
Mike Sawka 2026-04-24 16:24:43 -07:00 committed by GitHub
parent c2a17e7eb2
commit efd450fd3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 2 deletions

1
.gitignore vendored
View file

@ -21,6 +21,7 @@ aiplans/
manifests/
.env
out
.kilocode/package-lock.json
# Yarn Modern
.pnp.*

View file

@ -122,6 +122,7 @@ type TEventProps struct {
BlockView string `json:"block:view,omitempty"`
BlockController string `json:"block:controller,omitempty"`
BlockSubBlock bool `json:"block:subblock,omitempty"`
AiBackendType string `json:"ai:backendtype,omitempty"`
AiLocal bool `json:"ai:local,omitempty"`

View file

@ -32,6 +32,9 @@ func CreateSubBlock(ctx context.Context, blockId string, blockDef *waveobj.Block
if err != nil {
return nil, fmt.Errorf("error creating sub block: %w", err)
}
blockView := blockDef.Meta.GetString(waveobj.MetaKey_View, "")
blockController := blockDef.Meta.GetString(waveobj.MetaKey_Controller, "")
go recordBlockCreationTelemetry(blockView, blockController, true)
return blockData, nil
}
@ -100,12 +103,12 @@ func CreateBlockWithTelemetry(ctx context.Context, tabId string, blockDef *waveo
if recordTelemetry {
blockView := blockDef.Meta.GetString(waveobj.MetaKey_View, "")
blockController := blockDef.Meta.GetString(waveobj.MetaKey_Controller, "")
go recordBlockCreationTelemetry(blockView, blockController)
go recordBlockCreationTelemetry(blockView, blockController, false)
}
return blockData, nil
}
func recordBlockCreationTelemetry(blockView string, blockController string) {
func recordBlockCreationTelemetry(blockView string, blockController string, subBlock bool) {
defer func() {
panichandler.PanicHandler("CreateBlock:telemetry", recover())
}()
@ -122,6 +125,7 @@ func recordBlockCreationTelemetry(blockView string, blockController string) {
Props: telemetrydata.TEventProps{
BlockView: blockView,
BlockController: blockController,
BlockSubBlock: subBlock,
},
})
}