Add announcement banner demo to fixtures config - #1
Merged
Merged
Conversation
Sets html_theme_options.announcement so the dismissible announcement banner (QuantEcon/quantecon-book-theme#404) renders across the fixtures site — visible in the Netlify preview and covered by the visual regression snapshots. No announcement_expires is set on purpose, so the banner always renders and visual snapshots stay stable (an expiry date would eventually pass and silently change the build output). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a persistent demo announcement configuration to the fixtures site so the new dismissible announcement banner (from QuantEcon/quantecon-book-theme#404) renders in Netlify previews and is captured by visual regression snapshots.
Changes:
- Configure
sphinx.config.html_theme_options.announcementwith a demo HTML message/link. - Intentionally omit
announcement_expiresto keep snapshot output stable over time.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mmcky
added a commit
to QuantEcon/quantecon-book-theme
that referenced
this pull request
Jun 19, 2026
Bump FIXTURES_SHA in both ci.yml and update-snapshots.yml to the fixtures commit that adds an announcement to the fixtures _config.yml, so this PR's Netlify preview and visual build show the new banner. Both workflows are kept in sync so regenerated snapshots are produced against the same input. The banner shifts every page's layout, so the visual job is expected to fail until the baselines are regenerated via /update-snapshots. See QuantEcon/quantecon-book-theme-fixtures#1 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mmcky
added a commit
to QuantEcon/quantecon-book-theme
that referenced
this pull request
Aug 25, 2026
* feat: add dismissible announcement banner Add a site-wide announcement banner configured via the new `announcement` theme option (HTML allowed, so it can include emphasis and a link to changelog notes). Readers dismiss it with a ×; the dismissal persists in localStorage and is keyed to a content hash, so editing the message re-shows the banner for everyone who dismissed the previous one. An optional `announcement_expires` ISO date auto-hides the banner after that day — enforced client-side (disappears for visitors even without a rebuild) and at build time (an already-expired notice is omitted from the HTML). An invalid expiry date logs a warning and fails open. The banner defaults to empty/off, so existing sites are unchanged. The renderer iterates a list of notices internally so per-page announcements can be added additively later (tracked in #403). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix: address Copilot review on announcement expiry Two correctness fixes from the #404 review: - announcement.js: parse the expiry `YYYY-MM-DD` with an explicit regex into local-time date components and expire at 23:59:59.999, instead of `new Date("...T23:59:59")`. Removes the ~1s-early cutoff and any cross-engine ambiguity in how the date string is parsed. - __init__.py: the build-time expiry skip compared a UTC "today" against the expiry date, while the client-side check is the reader's local end-of-day — so a rebuild just after UTC midnight could omit a banner that's still the expiry day in Americas timezones. The skip now keeps a one-day UTC grace so a notice is never dropped from the HTML while it's still "today" anywhere; the client side hides it precisely per-reader. Tests and the expiry docs updated to match. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * ci: point fixtures pin at announcement-banner demo Bump FIXTURES_SHA in both ci.yml and update-snapshots.yml to the fixtures commit that adds an announcement to the fixtures _config.yml, so this PR's Netlify preview and visual build show the new banner. Both workflows are kept in sync so regenerated snapshots are produced against the same input. The banner shifts every page's layout, so the visual job is expected to fail until the baselines are regenerated via /update-snapshots. See QuantEcon/quantecon-book-theme-fixtures#1 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * feat: add announcement_style with bar (default) and callout looks Make the announcement banner's look selectable via a new announcement_style theme option, so the team can choose between two styles (and switch the default in one place): - bar (default): a thin, full-width strip with centred text that sits just below the toolbar and scrolls away — discreet, for standing notices. - callout: the original boxed in-column notice with an accent border — preserved as a style so nothing is lost. Both share the same markup, JS, and global dismissal; only the styling differs, and both adapt to dark mode and RTL. The value is validated at build start (unknown values warn and fall back to bar), mirroring color_scheme. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * style: make bar announcement flush with toolbar and thinner Pull the bar-style strip up to sit flush beneath the fixed toolbar (closing the ~13px gap left by .qe-page's 4rem top padding vs the 50px+1px toolbar) so it reads as a second tier of the header, and slim it down (thinner vertical padding, slightly smaller text). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * ci: re-pin fixtures to merged commit (fixtures #1) fixtures #1 merged the announcement-banner demo into the fixtures config on main. Re-pin FIXTURES_SHA in both ci.yml and update-snapshots.yml from the (now-merged) branch commit to the squash-merge commit on fixtures main, so the pin tracks a durable commit rather than a deletable branch tip. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * UPDATE: Regenerate all visual snapshots (92 files) * ci: trigger CI on regenerated visual baselines The snapshot bot's commit (81c97ff) is made with GITHUB_TOKEN, which does not trigger workflows, so the visual job never re-ran against the new baselines. Empty commit to force it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sets
html_theme_options.announcementso the new dismissible announcement banner in QuantEcon/quantecon-book-theme#404 renders across the fixtures site — making it visible in that PR's Netlify preview and covered by the visual regression snapshots.No
announcement_expiresis set on purpose, so the banner always renders and the visual snapshots stay stable (an expiry date would eventually pass and silently change the build output).Consumed by QuantEcon/quantecon-book-theme#404 via a
FIXTURES_SHAbump in that repo'sci.yml.🤖 Generated with Claude Code