mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-07 02:03:55 -05:00
[PR #1506] [MERGED] feat(staffml): announcement bar matching Quarto's identical structure + behavior #7373
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1506
Author: @profvjreddi
Created: 4/24/2026
Status: ✅ Merged
Merged: 4/24/2026
Merged by: @profvjreddi
Base:
dev← Head:feat/staffml-announcement-bar📝 Commits (1)
ad033c2feat(staffml): announcement bar matching Quarto's identical structure + behavior📊 Changes
4 files changed (+254 additions, -0 deletions)
View changed files
📝
interviews/staffml/src/app/globals.css(+83 -0)📝
interviews/staffml/src/app/layout.tsx(+2 -0)➕
interviews/staffml/src/components/AnnouncementBar.tsx(+123 -0)➕
interviews/staffml/src/lib/announcement.ts(+46 -0)📄 Description
Summary
Ports the unified announcement-bar pattern from PR #1505 (the nine Quarto sites) to StaffML's Next.js app. Because StaffML isn't Quarto, the banner is a React component + TypeScript config instead of a YAML metadata file — but the rendered DOM, CSS classes, icon glyphs, and dismissable behavior are identical to what Quarto emits.
What ships
src/lib/announcement.tssrc/components/AnnouncementBar.tsxsrc/app/globals.css.alert.alert-primarypalette + Quarto's flex layout under the same selectorssrc/app/layout.tsx<AnnouncementBar />below the navbar (same stacking order as Quarto'sposition: below-navbar)Emitted DOM (identical to Quarto's)
Dismiss behavior
.hidden→ `display: none`Verification (Playwright against a local dev server)
Computed styles match the expected values exactly:
flexrgb(207, 226, 255)rgb(8, 66, 152)1px solid rgb(182, 212, 254)12px15.2px(0.95rem × 16px root)0(edge-to-edge, matching Quarto's sticky-navbar presentation)Dismiss test: click × → `.hidden` class applied → sessionStorage written → stays hidden across reload. ✅
Theme handling
The bar uses the light alert palette regardless of StaffML's dark theme — matching Quarto, which does not re-tint the announcement bar for dark mode. The bar advertises the ecosystem's brand, not the current site's theme.
Dependencies
Bootstrap Icons (
bi-megaphone,bi-x-lg) are already loaded byEcosystemBar.tsxvia the jsdelivr CDN, so no new network dependency.Test plan
Closes the follow-up tracked in PR #1505.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.