fix(guard): add insights.share scope, overviewStats, miniHeatmap, and reauth CTA to share#703
fix(guard): add insights.share scope, overviewStats, miniHeatmap, and reauth CTA to share#703kantorcodes wants to merge 1 commit into
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Code Review
This pull request introduces a mini 5-day activity heatmap component (EvidenceActivityHeatmapMini) and integrates it into the home preview and share modal. It also adds overview stats to the share payload, handles re-authorization for scope/unauthorized errors, and updates the backend and tests accordingly. The review feedback suggests centralizing the heatmap level calculation logic into a shared helper function (getHeatmapLevel) to prevent potential TypeScript null-pointer compilation errors and ensure visual consistency with the backend's thresholds across all previews.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Greptile SummaryThis PR adds
Confidence Score: 5/5Safe to merge — the re-auth CTA path is now correctly wired to the raw error, and the heatmap level logic matches the backend exactly. All three previously broken paths (re-auth CTA swallowed, level formula divergence, scope-pattern mismatch) are addressed. The new overviewStats and miniHeatmap fields have test coverage, the scope list change is straightforward, and the TypeScript compiles cleanly. Only a minor redundant expression remains. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Modal as Share Modal (TS)
participant API as guard-api
participant Daemon as Python Daemon
participant Store as GuardStore
participant Cloud as Guard Cloud
Modal->>Modal: render preview (runtime stats + analytics heatmap)
Modal->>API: publishInsightsShare(opts)
API->>Daemon: POST /insights/shares
Daemon->>Store: receipt_analytics()
Daemon->>Store: count_approval_requests()
Daemon->>Store: list_managed_installs()
Daemon->>Store: count_receipts()
Daemon->>Daemon: build_insights_share_payload() overviewStats + miniHeatmap
Daemon->>Cloud: POST payload (guard:insights.share scope)
alt success
Cloud-->>Daemon: slug, publicUrl
Daemon-->>API: share result
API-->>Modal: GuardInsightsShareResult
Modal->>Modal: show EvidenceInsightsShareSheet
else scope / auth error
Cloud-->>Daemon: 403 / 401
Daemon-->>API: error
API-->>Modal: Error(rawMessage)
Modal->>Modal: setRawError → isInsightsShareScopeError → show Reconnect CTA
end
Reviews (6): Last reviewed commit: "fix(insights): add overviewStats and min..." | Re-trigger Greptile |
b0e364b to
bb76d54
Compare
f581aa7 to
4e7a29e
Compare
…ors reauth CTA Signed-off-by: Michael Kantor <6068672+kantorcodes@users.noreply.github.com>
4e7a29e to
d05380b
Compare
Summary
guard:insights.sharetoDEFAULT_GUARD_DEVICE_SCOPESso daemon can publish insights shares without incremental reauth.build_insights_share_payloadwithoverviewStats(pending/apps/recorded) andminiHeatmap(last 5 days) matching home card.Testing
python -m pytest tests/test_guard_connect_flow.py tests/test_insights_share.py -qcd dashboard && pnpm run typecheck