Repository navigation
feat(alerts): allow site_wide_message to carry dismissable and bgColor - #2385
Merged
thostetler merged 2 commits intoOct 8, 2026
Merged
Conversation
thostetler
force-pushed
the
feature/configurable-site-wide-banner
branch
from
October 6, 2026 20:42
1d1b3af to
79f6c12
Compare
A bare string still works, since the Vault schema change to support an object isn't confirmed yet and is what actually runs in production. dismissable: false skips both already-seen checks, so the banner shows on every load, but still yields for one load if an error alert already holds the shared alerts model. bgColor takes a hex value; anything else falls back to the default palette, which also replaces .alert-info (3.35:1) with #e8edf7 on #15336f (10.31:1) to pass WCAG AA.
thostetler
force-pushed
the
feature/configurable-site-wide-banner
branch
from
October 6, 2026 20:55
79f6c12 to
a4c4b27
Compare
thostetler
marked this pull request as ready for review
October 6, 2026 20:56
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Existing alert styling regresses, and custom backgrounds can make text, links, and controls difficult to read.
Review effort: Balanced
Findings: 3
Open (3)
What changed in this PR
Extends site-wide messages with configurable dismissal and background colors while retaining legacy string input.
Changes:
- Accepts object-form configuration and updates seen-message handling.
- Passes new settings through the shared alert widget.
- Adds conditional closing, color selection, and accessibility attributes.
| File | Description |
|---|---|
src/js/wraps/alerts_mediator.js |
Parses configuration and handles dismissal persistence. |
src/js/widgets/alerts/widget.js |
Propagates settings and corrects dependency argument order. |
src/js/widgets/alerts/templates/page_top_alert.html |
Conditionally displays closing controls and adds live-region attributes. |
src/js/widgets/alerts/page_top_alert.js |
Implements palette selection, dismissal guards, and accessibility metadata. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| this.$('.alert').css({ | ||
| 'background-color': palette.bg, | ||
| color: palette.fg, | ||
| }); |
The YIQ brightness cutoff chose white on backgrounds where it is unreadable — #00ff00 lands at 1.37:1, #808080 at 3.95:1. Pick the foreground by WCAG contrast ratio instead, falling back to black. - resolvePalette returns null with no bgColor, so ordinary alerts and dark mode keep their stylesheet colors; the danger banner from session.js was rendering pale blue. - Links and the close control get the resolved foreground, which dark-mode.scss and Bootstrap's $close-color otherwise override.
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.

site_wide_message can now be a JSON object with msg, dismissable, and
bgColor instead of only a bare string; a bare string still works.
anything — until then the legacy string path is what runs.
mode.
Vault response should still work like normally, but this code now expects a JSON response in the following form:
{ "msg": "This is a message", "dismissable": false, "bgColor": "#8GFFF" }