Skip to content

fix(hub): refresh the Inbox dot without live GitHub checks - #361

Merged
arniebradfo merged 9 commits into
build/hub/newfrom
fix/hub-inbox-badge-pr
Nov 25, 2026
Merged

arniebradfo merged 9 commits into
build/hub/newfrom
fix/hub-inbox-badge-pr

Conversation

@arniebradfo

@arniebradfo arniebradfo commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

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

Administrator navigation with an unread Inbox dot

Hub/Features/Workspace Navigation / Without Repository — light, 1440 × 900

Navigation without a selected repository or unread dot

Hub/Features/Workspace Navigation / Read Only — light, 1440 × 900

Read-only navigation with an unread Inbox dot

Hub/Pages/Inbox

Hub/Pages/Inbox / Single — light, 1440 × 900

One unread notification, with its count in the Inbox and a dot in the sidebar

Hub/Pages/Inbox / Empty — light, 1440 × 900

Empty Inbox with no sidebar dot

Hub/Pages/Inbox / No Repositories — light, 1440 × 900

Empty Inbox when no repositories are readable

Hub/Pages/Inbox / Multiple — light, 1440 × 900

Several Inbox rows with the total on the page and a dot in the sidebar

Hub/Pages/Inbox / Failure — light, 1440 × 900

Inbox retry state with the last known dot still visible

Hub/Pages/Inbox / Loading — light, 1440 × 900

Inbox loading before an unread snapshot

Hub/Pages/Inbox / Cached Refresh — light, 1440 × 900

Inbox with saved rows and the sample refresh action

Hub/Pages/Inbox prototype

Hub/Pages/Inbox prototype / Workspace — light, 1440 × 900

Prototype gallery with an unread dot

Hub/Pages/Inbox prototype / Full Page — light, 1440 × 900

Prototype Inbox page with a sidebar dot and the exact unread total in the page

Hub/Pages/Inbox prototype / Empty — light, 1440 × 900

Prototype gallery without an unread dot

Hub/Pages/Inbox prototype / Collapsed Sidebar — light, 1440 × 900

Collapsed sidebar with a dot on the Inbox icon

Hub/Pages/Inbox prototype / Inbox Preview — light, 1440 × 900

Empty hover preview with no unread dot

arniebradfo and others added 2 commits November 24, 2026 11:50
Refs: #354

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Follow up on the Inbox count handoff review in #346.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@arniebradfo
arniebradfo requested review from a team and nshki as code owners November 24, 2026 20:04
Copilot AI adaptive review requested due to automatic review settings November 24, 2026 20:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 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)

arniebradfo and others added 5 commits November 24, 2026 15:37
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>
@arniebradfo arniebradfo changed the title fix(hub): refresh the Inbox badge across navigation fix(hub): refresh the Inbox dot without live GitHub checks Nov 25, 2026
arniebradfo and others added 2 commits November 24, 2026 17:03
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>
@arniebradfo
arniebradfo merged commit 67030ea into build/hub/new Nov 25, 2026
58 checks passed
@arniebradfo
arniebradfo deleted the fix/hub-inbox-badge-pr branch November 25, 2026 03:47
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