Skip to content

feat(notices): let a reader hide a banner without retiring it - #2681

Open
camielvs wants to merge 1 commit into
banners-05-inboxfrom
banners-06-hide
Open

feat(notices): let a reader hide a banner without retiring it#2681
camielvs wants to merge 1 commit into
banners-05-inboxfrom
banners-06-hide

Conversation

@camielvs

@camielvs camielvs commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Why

With #2668 merged, dismissing a notice is the only way to clear it off the dashboard home — and dismissal is permanent and only offered on notices the host marked dismissible. That leaves two gaps:

  • A mandatory notice (no dismissible) sits on the home page with no way to clear it, even for someone who has read it and wants their dashboard back.
  • Clearing a dismissible one is a one-way door: there was no way to see it again short of clearing localStorage.

Now that the notices are also in the header popover, taking a banner off the home page doesn't lose it — so hide becomes safe to offer, on every notice.

What you get

The banner's X becomes an eye-off, "Hide notice", present on every card:

  • Dismissible notice → hidden for good, persisted under hidden-notices.
  • Mandatory notice → hidden for this session only, back on the next load.

The reader always still has it in the header popover either way. The popover header gains one toggle that flips on state: Hide notices when any are showing, Show notices when any are hidden — so hiding is reversible without touching storage by hand.

Dismissal is unchanged and still lives in the popover: the X there still retires a dismissible notice permanently.

Reviewer notes

useHiddenNotices is a separate store from useNotices, keyed on hidden-notices, and the banners compose the two. Hidden state deliberately doesn't live in useNotices — a hidden notice is still an active notice, and the popover has to keep listing it.

The persist-if-dismissible / session-only-if-mandatory rule is the same two-tier shape #2667 established for dismissal, and it's the reason showAll can restore everything: session hides clear on their own, and hidden-notices is emptied.

One shared primitive changes: InfoBox gains dismissIcon and dismissLabel, both defaulting to today's values (X / "Dismiss"), so every existing InfoBox renders identically. This is the only change to a design-system primitive in the notices stack, and it exists because a notice card needs the same affordance in the same slot with a different meaning — an eye-off in the banner, an X in the popover — and a second dismiss slot on InfoBox would be worse.

How to test

Install a source with one dismissible and one mandatory notice (see src/config/NOTICES.md):

  • Both banners on the dashboard home now show an eye-off, not an X.
  • Hide the dismissible one → gone, and still gone after a reload. It's still listed in the header popover.
  • Hide the mandatory one → gone, but back after a reload.
  • Popover header shows Show notices once anything is hidden; clicking it brings both banners back.
  • Hide notices clears the whole home region in one click.
  • The X in the popover still permanently retires a dismissible notice.

Where this sits

PR
1 #2664 shared Markdown renderer
2 #2666 validated host contract
3 #2667 notice banners on the dashboard home — announcement parity
4 #2668 notices button in the header
5 #2681 hide a banner without retiring it (you are here)

Top of the stack, and the most droppable PR in it: #2667 alone is a complete announcements replacement, and #2668 adds the header surface. This is purely a reader affordance and depends on #2668 existing — hiding is only reasonable because the popover keeps the notice reachable.

A notice the host marks mandatory cannot be dismissed, so without this there is
no way to clear one off the dashboard home. Hiding is per-reader and reversible:
the notice stays in the header inbox, which offers to bring the banners back.

A hide persists only for notices the host already allows to be dismissed;
hiding a mandatory notice lasts for the session.
@github-actions

Copy link
Copy Markdown

🎩 Preview

A preview build has been created at: banners-06-hide/46b5eea

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@camielvs
camielvs marked this pull request as ready for review August 29, 2026 00:14
@camielvs
camielvs requested a review from a team as a code owner August 29, 2026 00:14
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.

1 participant