Skip to content

fix(announcements): show the body in a critical modal, not the popover summary - #28

Merged
KruGoL merged 1 commit into
mainfrom
fix/announcement-modal-critical-body
Aug 10, 2026
Merged

fix(announcements): show the body in a critical modal, not the popover summary#28
KruGoL merged 1 commit into
mainfrom
fix/announcement-modal-critical-body

Conversation

@KruGoL

@KruGoL KruGoL commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

The bug

A critical announcement's modal rendered announcement.summary — the two-line teaser written for the bell popover — so everything the author wrote below the first paragraph never reached the reader. On a notice whose entire purpose is to deliver instructions ("update to 0.14.3, drop tokensDir, remove these scopes"), the reader got the headline and nothing else.

The admin composer's preview showed the full body, so the text was proof-read and then silently dropped on the way out. AnnouncementModal.tsx's own doc comment already said the alert flavour carries "a short body" — the implementation just never did.

The fix

  • Both flavours render the markdown body. summary goes back to being the popover's job; it is derived server-side from the body's first paragraph anyway, so showing both would only stutter.
  • The card is extracted into AnnouncementModalCard (exported), leaving AnnouncementModal with only what makes it a dialog: backdrop, role="dialog", focus trap. sphere-backoffice's composer preview now renders that card instead of its own look-alike — which is what stops the two drifting apart again.
  • Long bodies scroll inside the card while the actions stay put. A blocking modal that pushes its own dismiss button past the bottom of the viewport is a trap, and a full critical body is long enough to do exactly that.

Nothing changes for consumers: AnnouncementModal's props and behaviour are unchanged.

Tests

Two new tests in AnnouncementModal.test.tsx, both verified to fail against the previous component:

  • the critical modal renders the body (markdown and all) and not the popover summary;
  • the actions stay outside the scrolling region, so "Got it" is always reachable.

vitest run — 171 passed (23 files). npm run lint is not runnable in this repo: it has neither eslint nor an eslint config installed.

…r summary

The alert flavour rendered `summary` — the two-line teaser the bell popover
shows — so everything an author wrote below the first paragraph never reached
the reader. A critical announcement is the one kind whose instructions are the
whole point, and the admin composer's preview showed the full body, so the text
was proof-read and then silently dropped on the way out.

Both flavours now render the markdown body, and the card is extracted into
`AnnouncementModalCard` so the composer can render the real component instead
of a look-alike that can drift from it again.

Long bodies now scroll inside the card while the actions stay put: a blocking
modal that pushes its own dismiss button past the bottom of the viewport is a
trap, and a full critical body is long enough to do exactly that.
@KruGoL
KruGoL merged commit 7ff0483 into main Aug 10, 2026
2 checks passed
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