Skip to content

hotfix(tickets): restore dashboard-activity events (remote shell/control + resolve)#8

Merged
pavlo-flamingo merged 2 commits into
mainfrom
hotfix/dashboard-activity-tracking
Jul 14, 2026
Merged

hotfix(tickets): restore dashboard-activity events (remote shell/control + resolve)#8
pavlo-flamingo merged 2 commits into
mainfrom
hotfix/dashboard-activity-tracking

Conversation

@pavlo-flamingo

Copy link
Copy Markdown
Contributor

Problem

Per the analytics review, three DASHBOARD_ACTIVITY subtypes from the ticket-detail page were broken:

  • open_remote_shell_ticket_detail / open_remote_control_ticket_detail — stopped firing (~0 in the last 7 days, present a month ago).
  • resolve_ticket_ticket_detail — never fired at all.
  • start_direct_chat_ticket_detail was fine (tracked in a mutation hook, not affected).

Root causes

  • Remote shell/control: tracking was attached as an onClick on menu items that navigate via href. Whether the core ActionsMenu invokes onClick on an href <Link> row is an internal implementation detail — a fragile dependency that silently dropped the events.
  • Resolve: the RESOLVE_TICKET subtype was defined and documented but wired to a handleResolve that never existed. Resolve actually happens through the inline status changer (and the Edit Ticket form), neither of which tracked anything.

Fixes

  • withActivityTracking now drops the item href and drives navigation itself (trackDashboardActivity + router.push) inside onClick, forcing the reliable button-row path whose onClick always fires. The Windows Remote Shell submenu leaves are covered by the existing recursion.
  • Resolve is tracked optimistically on click (not on mutation success) at every in-detail resolve entry point:
    • the inline status changer (ticket-details-view.tsx → handleTransition), and
    • the Edit Ticket form (useCreateTicketForm.handleSave).
    • A new isResolvedStatusId() predicate — keyed on status kind, so custom-named resolved statuses ("Done"/"Closed") count — is the single source of truth shared by both.

Optimistic-on-click was a deliberate call: losing one event on a rare failed transition is acceptable; missing real resolves because a success callback didn't land is not.

Intentionally out of scope

  • Board drag-to-Resolved (useMoveTicket) is a different surface; tracking it would need its own subtype (e.g. resolve_ticket_board), not _ticket_detail.

Notes

  • docs/dashboard-activity-events.md updated to match (wire points + fire-timing policy).
  • Verified working on a saas-tenant stand (resolve via status changer, resolve via Edit, remote shell/control).
  • type-check and Biome clean on touched files.

…resolve

Three ticket-detail activity events were broken:
- open_remote_shell_ticket_detail / open_remote_control_ticket_detail stopped
  firing (the tracking relied on the core ActionsMenu invoking onClick on an
  href <Link> row — a fragile implementation detail).
- resolve_ticket_ticket_detail never fired: the RESOLVE_TICKET subtype was
  defined but wired to a handleResolve that never existed. Resolve actually
  happens through the inline status changer (and the Edit form), neither of
  which tracked anything.

Fixes:
- withActivityTracking now drops the item href and drives navigation itself
  (trackDashboardActivity + router.push) inside onClick, forcing the reliable
  button-row path whose onClick always fires. Windows Remote Shell submenu
  leaves are handled by the existing recursion.
- Resolve is tracked optimistically on click (not on mutation success) at every
  in-detail resolve entry point: the status changer and the Edit Ticket form.
  A new isResolvedStatusId() predicate (keyed on status kind, so custom-named
  resolved statuses count) is the single source of truth shared by both.

Board drag-to-Resolved is intentionally NOT tracked (different surface — would
need its own subtype). Docs (dashboard-activity-events.md) updated to match.
@pavlo-flamingo pavlo-flamingo requested a review from a team as a code owner July 14, 2026 15:00
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@pavlo-flamingo, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9fa7ad23-5cf1-436c-abab-1dda4b947c44

📥 Commits

Reviewing files that changed from the base of the PR and between d305d14 and fc74b0d.

📒 Files selected for processing (4)
  • docs/dashboard-activity-events.md
  • src/app/(app)/tickets/components/ticket-details-view.tsx
  • src/app/(app)/tickets/hooks/use-create-ticket-form.ts
  • src/app/(app)/tickets/utils/is-resolved-status.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix/dashboard-activity-tracking

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pavlo-flamingo pavlo-flamingo enabled auto-merge (squash) July 14, 2026 15:04
@pavlo-flamingo pavlo-flamingo merged commit c4c528a into main Jul 14, 2026
3 checks passed
@pavlo-flamingo pavlo-flamingo deleted the hotfix/dashboard-activity-tracking branch July 14, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants