Loading
Track workplan views in the UI
What does this MR do and why?
Add view_work_item_workplan to measure when a saved, nonempty workplan is displayed in the UI. The existing work_item_agent_plan_read event remains unchanged.
The event fires once per panel opening and work item in view mode. Direct links, browser navigation, and display after generation are covered. Loading, empty, and editor-only states do not count. Content updates and edit/save cycles do not add another view; closing and reopening does.
The event definition documents these counting rules. This measures UI display, not proof that someone read the content.
References
Resolves #630735 (closed)
Related: !257324 (merged)
Screenshots or screen recordings
How to set up and validate locally
- Enable the
workplanfeature flag and open a work item with a saved plan. - In browser developer tools, filter network requests for
usage_data/track_eventand inspectview_work_item_workplan. - Confirm that loading the work item with the panel closed emits no UI view event.
- Open the plan and confirm one event. Edit and cancel or save: no additional event. Close and reopen: one additional event.
- Load
?show=workplandirectly: one event. Load?show=workplan&workplan_state=edit, or open an empty plan: no event.
Validation completed:
- Component suite: 123 tests passed on latest master.
- Frontend integration suite: 13 tests passed on latest master.
- ESLint, Prettier, YAML lint, dependency checks, and commit/push hooks passed.
- Live GDK: closed panel, open, edit/cancel, reopen, direct view/edit links, and empty state verified. Internal-event endpoint and Snowplow collector returned HTTP 200.
Commands:
yarn jest ee/spec/frontend/work_items/components/implementation_widget/work_item_workplan_spec.js --runInBand
yarn jest:integration ee/spec/frontend/integration/work_items/details/workplan_spec.js --runInBandMR acceptance checklist
Reviewed against the MR acceptance checklist.
- Event definition documents the metric semantics; component and integration coverage added.
- Existing default-off
workplanflag gates the UI. - No changelog entry: internal analytics for a default-off feature.
- Analytics Instrumentation review requested through labels.
Related to #630735 (closed)
Edited by Vanessa Otto