mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-06 17:49:07 -05:00
[PR #1509] [MERGED] fix(staffml/announcement): top-align megaphone icon + gate dismiss on live #7375
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/1509
Author: @profvjreddi
Created: 4/24/2026
Status: ✅ Merged
Merged: 4/24/2026
Merged by: @profvjreddi
Base:
dev← Head:fix/staffml-banner-polish📝 Commits (1)
8141a01fix(staffml/announcement): top-align megaphone icon + gate dismiss on live📊 Changes
3 files changed (+25 additions, -2 deletions)
View changed files
📝
interviews/staffml/src/app/globals.css(+5 -1)📝
interviews/staffml/src/components/AnnouncementBar.tsx(+8 -1)📝
interviews/staffml/src/lib/env.ts(+12 -0)📄 Description
Summary
Two follow-ups to the
AnnouncementBarmerged in PR #1506:CSS: switch
#quarto-announcementfromalign-items: centertoalign-items: flex-start. With the 3–4 content lines the bar typically carries, centering floated the megaphone icon to the middle of the bar and read as a layout bug. Now matches the Quarto sibling sites' presentation where the megaphone sits on line 1's baseline.Dismiss gated on live deploy: the × is now shown only when
IS_LIVE_DEPLOY(new boolean insrc/lib/env.ts) is true. On the dev-preview deploy (harvard-edge.github.io/cs249r_book_dev) the bar is intentionally persistent — every pageview during development should see the ecosystem pitch. On live (mlsysbook.ai) the bar becomes dismissable so returning visitors aren't nagged. Piggybacks on the existingNEXT_PUBLIC_ECOSYSTEM_BASE— no new env var.Files
interviews/staffml/src/app/globals.css— one-line CSS changeinterviews/staffml/src/lib/env.ts— addIS_LIVE_DEPLOYbooleaninterviews/staffml/src/components/AnnouncementBar.tsx— consumeIS_LIVE_DEPLOYto gate dismissVerification (Playwright)
Dev mode (
NEXT_PUBLIC_ECOSYSTEM_BASE=https://harvard-edge.github.io/cs249r_book_dev):has × action in DOM? false✓Live mode (default):
has × action in DOM? true✓.hiddenclass →sessionStorage["quarto-announcement-dismissed-{hash}"] = "1"→ persists across reload ✓Test plan
tsc --noEmitclean🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.