Repository navigation
fix(hub): refresh the Inbox dot without live GitHub checks - #361
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Coordinating overlapping recounts, Inbox loads, read updates, and access-denial resets across mounted hooks requires cross-behavior concurrency reasoning beyond the conservative automated approval scope.
No open issues 🎉
What changed in this PR
Keeps Hub’s Inbox badge current across signed-in navigation without remounting the sidebar, addressing #354 after the layout changes in #346.
Changes:
- Refreshes the unread count on page navigation, while Inbox supplies its own count.
- Preserves the last known count during loading and temporary failures, and clears it when access is denied.
- Adds regression coverage for navigation, request failures, and overlapping responses, and documents the behavior.
| File | Description |
|---|---|
hub/docs/frontend.md |
Documents badge refresh and count-retention behavior. |
hub/client/hooks/use-notification-inbox/index.ts |
Adds navigation-triggered refreshes and preserves counts through temporary failures. |
hub/client/hooks/use-notification-inbox/index.test.tsx |
Covers count retention, access denial, and response ordering. |
hub/client/application/hub/workspace-inbox-count-context/index.ts |
Allows an explicit count-clearing signal. |
hub/client/application/hub/routes/workspace/index.tsx |
Uses the pathname to trigger badge refreshes. |
hub/client/application/hub/routes/real-workspace-navigation.test.tsx |
Verifies badge updates and failure recovery across navigation. |
Review effort: Balanced (adaptive)
weastler
approved these changes
Nov 24, 2026
Use unread presence from the lightweight workspace response instead of recounting on page changes. Keep the last snapshot for the same viewer and leave Inbox list and mutation authorization unchanged. Refs: #354 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Log unread lookup failures and omit only the unread indicator. The workspace response still returns the repository navigation after verifying the current session. Refs: #354 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the unread dot on the real workspace route and adapt the regressions to the new HTTP test harness. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use unread presence for the sidebar in the app and Storybook. Keep exact counts inside the Inbox list and preview. Refs: #354 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Do not wait indefinitely for the optional unread indicator. Notify the same viewer's Inbox when a preview read saves after navigation without updating the old preview state. Refs: #354 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Limit optional unread lookups and keep their slots reserved until the underlying queries settle. This leaves capacity for session rechecks even when unread lookups hit the response deadline. Refs: #354 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
After #346 kept the sidebar mounted, a failed Inbox request could hide unread activity, and new activity could go unnoticed. Fixes #354 without bringing back the GitHub permission checks that #345 removed from navigation.
What changes
The sidebar shows an unread dot instead of a number. The existing workspace response refreshes it as you change pages, using stored repository grants for GitHub accounts. The dot needs no extra request, live GitHub check, or polling.
If the unread lookup fails or stalls, Hub keeps navigation available and shows the last known dot for the same viewer. Hub limits concurrent lookups so database connections stay available for required reads. Opening Inbox or its preview still checks current access and shows the unread count. If a preview read change finishes after you open Inbox, the list and count refresh for the same viewer. The workspace and Inbox stories now show the dot in place of the old sidebar count.
Storybook screenshots
Hub/Features/Workspace Navigation
Hub/Features/Workspace Navigation / Administrator — light, 1440 × 900
Hub/Features/Workspace Navigation / Without Repository — light, 1440 × 900
Hub/Features/Workspace Navigation / Read Only — light, 1440 × 900
Hub/Pages/Inbox
Hub/Pages/Inbox / Single — light, 1440 × 900
Hub/Pages/Inbox / Empty — light, 1440 × 900
Hub/Pages/Inbox / No Repositories — light, 1440 × 900
Hub/Pages/Inbox / Multiple — light, 1440 × 900
Hub/Pages/Inbox / Failure — light, 1440 × 900
Hub/Pages/Inbox / Loading — light, 1440 × 900
Hub/Pages/Inbox / Cached Refresh — light, 1440 × 900
Hub/Pages/Inbox prototype
Hub/Pages/Inbox prototype / Workspace — light, 1440 × 900
Hub/Pages/Inbox prototype / Full Page — light, 1440 × 900
Hub/Pages/Inbox prototype / Empty — light, 1440 × 900
Hub/Pages/Inbox prototype / Collapsed Sidebar — light, 1440 × 900
Hub/Pages/Inbox prototype / Inbox Preview — light, 1440 × 900