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

  1. Enable the workplan feature flag and open a work item with a saved plan.
  2. In browser developer tools, filter network requests for usage_data/track_event and inspect view_work_item_workplan.
  3. Confirm that loading the work item with the panel closed emits no UI view event.
  4. Open the plan and confirm one event. Edit and cancel or save: no additional event. Close and reopen: one additional event.
  5. Load ?show=workplan directly: 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 --runInBand

MR acceptance checklist

Reviewed against the MR acceptance checklist.

  • Event definition documents the metric semantics; component and integration coverage added.
  • Existing default-off workplan flag 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

Merge request reports

Loading
Loading