Skip to content

feat(code): add priority + actionability to all inbox events#2295

Merged
andrewm4894 merged 2 commits into
mainfrom
inbox-events-priority-actionability
May 22, 2026
Merged

feat(code): add priority + actionability to all inbox events#2295
andrewm4894 merged 2 commits into
mainfrom
inbox-events-priority-actionability

Conversation

@andrewm4894
Copy link
Copy Markdown
Member

Summary

Slicing inbox engagement by priority / actionability was only possible on Inbox report opened, and even there only priority was captured. This adds both fields to every inbox event so we can break down opens, closes, scrolls, and actions consistently, and adds a per-bucket count breakdown to Inbox viewed so we can analyse the visible mix in one pass.

  • Inbox report opened: add actionability alongside existing priority
  • Inbox report closed, Inbox report scrolled, Inbox report action: add both priority and actionability. Sourced from the open-info snapshot (so closed/scrolled match what was shown when the report opened, even after a re-fetch) or from a visible-list lookup for explicit-id actions — call sites don't need to thread anything through.
  • Inbox viewed: add priority_p0_count..priority_p4_count, priority_unknown_count, and actionability_immediately_actionable_count / actionability_requires_human_input_count / actionability_not_actionable_count / actionability_unknown_count. Gated-due-to-scale visits emit zeros (data isn't loaded).

The signalAction tracker auto-fills priority/actionability from the current open or the visible reports list, matching how it already auto-fills rank / list_size, so no call site changes were needed beyond the prop-type widening on SignalsToolbar and ReportDetailPane.

Test plan

  • pnpm --filter code typecheck passes
  • pnpm lint passes
  • Existing inbox unit tests pass (only the unrelated ArchiveService worktree integration test timed out, no inbox failures)
  • Smoke in dev: open inbox, open a report, scroll the detail pane, dismiss/snooze, and confirm in the PostHog activity feed that Inbox viewed, Inbox report opened, Inbox report scrolled, Inbox report closed, and Inbox report action all carry the new priority / actionability fields and the Inbox viewed breakdown counts

Slicing inbox engagement by these two fields was previously only possible
on `Inbox report opened` (priority only). Now every inbox event carries
the report's priority and actionability, and `Inbox viewed` carries a
per-bucket count breakdown so we can analyse the visible mix in one pass.

- `Inbox report opened`: add `actionability` alongside existing `priority`
- `Inbox report closed`/`scrolled`/`action`: add both `priority` and
  `actionability`, sourced from the open-info snapshot or a visible-list
  lookup so call sites don't need to thread them through
- `Inbox viewed`: add `priority_p0_count`..`p4_count`/`unknown_count` and
  `actionability_*_count` breakdowns of the visible report list
@andrewm4894 andrewm4894 self-assigned this May 22, 2026
@andrewm4894 andrewm4894 requested a review from a team May 22, 2026 11:09
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 22, 2026

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/code/src/renderer/features/inbox/hooks/useInboxEngagementTracker.ts:207-224
The condition `info && info.reportId === action.report_id` is evaluated three times — once to compute `matchedReport`, once for `priority`, and once for `actionability`. Extracting it to a single boolean removes the duplication and makes the three subsequent expressions easier to read at a glance.

```suggestion
      // Look up the report once for priority/actionability fallbacks — prefer
      // the live tracker open info, fall back to the visible list.
      const isCurrentReport = !!info && info.reportId === action.report_id;
      const matchedReport = isCurrentReport
        ? null
        : (visibleReports.find((r) => r.id === action.report_id) ?? null);
      const priority =
        priorityOverride !== undefined
          ? priorityOverride
          : isCurrentReport
            ? info!.reportPriority
            : (matchedReport?.priority ?? null);
      const actionability =
        actionabilityOverride !== undefined
          ? actionabilityOverride
          : isCurrentReport
            ? info!.reportActionability
            : (matchedReport?.actionability ?? null);
```

Reviews (1): Last reviewed commit: "feat(code): add priority + actionability..." | Re-trigger Greptile

Comment thread apps/code/src/renderer/features/inbox/hooks/useInboxEngagementTracker.ts Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 938c039c55

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/code/src/renderer/features/inbox/hooks/useInboxEngagementTracker.ts Outdated
…ions

After bulk dismiss/snooze/delete/reingest (toolbar) or single-report
dismiss-confirm, the visible list has been re-queried without the affected
report by the time the analytics callback fires. The tracker's
visible-list fallback would have recorded `null` for the new
priority/actionability fields in exactly those cases.

- `SignalsToolbar`: extend `ListSnapshot` to capture priority +
  actionability per id (alongside rank/title/createdAt) and forward
  through `fireBulkAction`.
- `InboxSignalsTab.handleDismissConfirm`: pass `target.priority` /
  `target.actionability` from the pre-mutation `allReports` lookup.
- Tracker: DRY up the "current report?" check into a single `currentInfo`
  binding shared by rank / priority / actionability.
@andrewm4894 andrewm4894 merged commit cc57a2e into main May 22, 2026
15 checks passed
@andrewm4894 andrewm4894 deleted the inbox-events-priority-actionability branch May 22, 2026 11:33
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