Skip to content

🐛 dashboard: render the Inbox once the viewer's role is known - #18442

Merged
hivecommons-hive[bot] merged 5 commits into
v5from
fix/inbox-render-before-role
Nov 16, 2026
Merged

hivecommons-hive[bot] merged 5 commits into
v5from
fix/inbox-render-before-role

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Root cause

checkGHAuth fetches /api/role in parallel with /api/inbox. renderInbox gated on window._hiveRole without checking whether the role had resolved, so an unknown role behaved as read: Share → Hive actions, ▶ Play and the bulk Hive menu were hidden until the next 60 s Inbox refresh re-rendered. Knowledge already repaints from showGHAuthState, and Sessions awaits its own role fetch, so Inbox was the only section with the bug.

Fix

  • hiveAuthResolved now notifies window._hiveRoleListeners the first time the role resolves and whenever it changes; the Inbox subscribes and re-renders.
  • renderInbox shows the loading state until the role is known (or the lookup gave up), so read-only users never see write actions and owners never lose them.
  • /api/role is retried (3 attempts, 0.5 s then 1 s backoff) on network errors and 5xx; if it stays failed the viewer is read-only and the Inbox says so.

Tests

New dashboard/test/inbox-role-race.test.js: render before role then owner shows the actions, read keeps them hidden, failed fetch falls back to read-only, retry recovers.

🤖 Generated with Claude Code

The Inbox rendered before /api/role resolved, treating an unknown role as read, and nothing re-rendered until the next 60 s refresh. Hold a loading state until the role is known, notify role listeners when it resolves, and retry the role lookup with backoff before falling back to read-only.

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 16, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nicholasjackson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#18449 ✨ OpenRouter: current defaults, live-filtered suggestions, searchable grouped model picker same files src/pkg/dashboard/static/index.html
#18419 ⚠️ Retire the inception API, watcher and brainstorm inception mode same files src/pkg/dashboard/static/index.html
#18432 ✨ Inbox: auto-transcribe hive recordings same files src/pkg/dashboard/static/index.html
#18415 ✨ Inbox: pills record where an item was shared, by whom and when same files src/pkg/dashboard/static-src/js/inbox.js
src/pkg/dashboard/static/index.html

@hivecommons-hive

hivecommons-hive Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • test (dashboard 3/4)

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

Evidence bundle `#184426522932` sha256:09fdbea525ea15abd9980b1396c07cd969fa5c8d6db1e0656ff1ec944538aae9 — download from the dashboard or `hivectl review evidence #18442`.

Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
…never delay it

Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
@hivecommons-hive
hivecommons-hive Bot merged commit 203fa0d into v5 Nov 16, 2026
85 of 87 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/inbox-render-before-role branch November 16, 2026 18:16
@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 1acffb6.

kubestellar-prow Bot pushed a commit that referenced this pull request Nov 16, 2026
…ut, and read cleanly (#18527)

* 🐛 dashboard: Meetings and Calendar wait for the role, sit in the layout, and read cleanly

- Meetings and Calendar rendered their not-allowed notice before /api/role
  resolved and never re-rendered; they now show a loading state and
  subscribe to the role listeners gh-auth.js notifies (same contract as the
  Inbox fix, #18442). A network failure says the hive is unreachable instead
  of leaving "Loading meetings…".
- Both sections were missing from DASHBOARD_LAYOUT_TEMPLATE. The generated
  page parses every section outside #hive-dashboard-root and layout.js moves
  only template sections back, so these two stayed outside the root where
  --dash-card-padding is undefined: their cards had zero padding. Add them
  after the Inbox, matching the sidebar order.
- Meetings form: link and title fields, then the Voice toggle beside its
  checkbox and the primary button; Discord disclosure aligned with the form.
  Meeting rows: title, kc-pill state, platform and time, a plain-language
  error with the raw error under details. Empty states use empty-dashed.
  Calendar sub-sections get spacing. Existing tokens and classes only.

Signed-off-by: Andy Anderson <andy@clubanderson.com>

* 🐛 dashboard: collapse Calendar and Meetings by default like the Inbox; 24 layout sections

Now that both are layout sections, the collapse-defaults classification
requires every non-critical section in DASHBOARD_DEFAULT_COLLAPSED_SECTIONS
(only for new browsers; existing ones keep their state, and the sidebar
expands the section it opens). The stale-layout normalize test counts 24
sections.

Signed-off-by: Andy Anderson <andy@clubanderson.com>

---------

Signed-off-by: Andy Anderson <andy@clubanderson.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant