Repository navigation
OpenConceptLab/ocl_online#425 | The announcement banner shows the deployment's ANNOUNCEMENT setting - #61
Merged
Conversation
…ent's ANNOUNCEMENT setting The banner's text and links come from an optional ANNOUNCEMENT environment variable (JSON), which start-prod.sh writes into env-config.js as an escaped string when the container starts. The app parses and checks it: plain text, https links only, the user's language with en as the fallback, hidden after `until`, and dismissed by `id`. Unset or invalid, no banner shows. Removes the announcement written into the app: its copy, link constants and locale strings. README documents the setting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVYj2Kwzt3oKZf1AwU
…ge left open, and links is required The banner checks the setting again when `until` arrives, so it goes away without a reload. `links` is required, as in the setting's shape; `[]` means no links. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVYj2Kwzt3oKZf1AwU
…hecks From the simplification review: JSON.parse's catch covers an unset or empty setting, the links check maps and tests in one pass, the unused `now` defaults go, and the language test and the component comment are shorter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVYj2Kwzt3oKZf1AwU
…banner goes within a minute From the adversarial review: a long label (a pasted URL, say) no longer pushes the close button off a phone screen, because the text wraps anywhere and the button keeps its size. The banner checks `until` at least once a minute, so a timer that a sleeping laptop or a clock change delays can't keep it up. README: `until` needs Z or an offset, and the npm start example works with an apostrophe in the text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVYj2Kwzt3oKZf1AwU
Member
Author
Codex review, pass 1 (codex-cli 0.166.0, commit 65370ae)Verdict: findings (1).
Response
findings.json{
"reviewer": "codex-cli 0.166.0",
"perspective": "defects",
"mode": "full",
"commit": "65370ae64ea749e883b435f36df1637872cea84c",
"verdict": "findings",
"prior": [],
"findings": [
{
"id": "F1.1",
"severity": "P1",
"tag": null,
"file": "src/components/app/AnnouncementBanner.jsx",
"line": 27,
"claim": "The banner does not automatically disappear when its expiry deadline passes.",
"scenario": "A user opens the app before `until` and stays on the same screen past that time. Expiry is checked only during render, and no timer triggers another render, so the expired banner and its header offset remain until an unrelated update or reload. The expiry test calls the parser with different timestamps and misses this behavior.",
"action": "Schedule a state update at expiry, with timer cleanup, and test that advancing time while the component remains mounted removes both the banner and its height offset.",
"lines_delta": null,
"confidence": "high"
}
]
} |
Member
Author
Codex review, pass 2 (codex-cli 0.166.0, commit f624636)Verdict: clean. F1.1 resolved. findings.json{
"reviewer": "codex-cli 0.166.0",
"perspective": "defects",
"mode": "verify",
"commit": "f624636b6525b40049d34780a763b5b68d216bdc",
"verdict": "clean",
"prior": [
{
"id": "F1.1",
"status": "resolved"
}
],
"findings": []
} |
Member
Author
Simplification review (claude subagent, commit c55b3f9c in oclweb3; it covered all three repos)
Applied in 94d8d3b. Tests rerun: green. simplify.json |
Member
Author
Codex check of commits f624636..94d8d3b (codex-cli 0.166.0)Verdict: clean. The simplification commit broke nothing. findings.json{
"reviewer": "codex-cli 0.166.0",
"perspective": "defects",
"mode": "final",
"commit": "94d8d3bd53e5e80e04dc9d404271260d5d1bd000",
"verdict": "clean",
"prior": [],
"findings": []
} |
Member
Author
Codex check of commits 94d8d3b..edec8f6 (codex-cli 0.166.0)An adversarial review (claude subagent) tried to break the escaping and the checks. No input added script to Verdict: clean. That commit broke nothing. findings.json{
"reviewer": "codex-cli 0.166.0",
"perspective": "defects",
"mode": "final",
"commit": "edec8f65976e2038fec0757e6c1a1ece9898f9e9",
"verdict": "clean",
"prior": [],
"findings": []
} |
snyaggarwal
approved these changes
Oct 30, 2026
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.
The announcement banner above the app now shows only what the deployment sets in an optional
ANNOUNCEMENTenvironment variable. When it's unset, no banner shows, so each deployment runs its own banner or none. Same change in TBv3 (OpenConceptLab/oclweb3#88) and the Mapper (OpenConceptLab/oclmap#121).What changed
start-prod.shwritesANNOUNCEMENTintoenv-config.jswhen the container starts, as an escaped JavaScript string, so a value can't end the string or add script. It escapes one character at a time, which behaves the same in every bash (${s//…}replacement handling changed in bash 5.2).src/common/announcement.js(new, the same file in all three apps) parses and checks the setting. Text and labels are plain text; links must behttps:; the user's language falls back toen; the banner hides afteruntilwith no restart; a dismissal is remembered byid. Invalid JSON, a missing field or a link that isn'thttps:means no banner.AnnouncementBanneronly displays what that returns. It keeps the layout (--announcement-height, the Header offset), and long text now wraps instead of running off a narrow screen. The close button's label is nowcommon.close.announcement.*locale strings.docker-compose.ymlpassesANNOUNCEMENTthrough.{ "id": "maintenance-2026-11", "text": {"en": "Planned maintenance on Saturday, 02:00-04:00 UTC.", "es": "Mantenimiento programado el sábado, de 02:00 a 04:00 UTC."}, "links": [{"label": {"en": "Details", "es": "Detalles"}, "url": "https://status.example.org/"}], "until": "2026-11-09T00:00:00Z" }Tests
src/common/__tests__/announcement.test.js(19 tests): unset; valid; invalid JSON and JSON that isn't an object; missing or malformed fields; links that aren'thttps:(http:,javascript:,data:, relative); expired and malformeduntil, and the re-check that hides a banner atuntil; other languages and theenfallback; dismissal, including blocked storage; andstart-prod.sh's escaping (values read back unchanged, and attempts to end the string don't run)../node_modules/eslint/bin/eslint.js --ext .jsx,.js src/is clean. The new test file usesnode:test, which Node 14 doesn't have, so it runs locally, not in CI:node --test src/common/__tests__/announcement.test.json Node 22 (19 pass).announcement.jsandstart-prod.shcode.Review
Codex (codex-cli 0.166.0, reasoning xhigh), up to 3 passes:
until(P1). Fixed: the banner checks again whenuntilarrives.linksis now required too, from the oclweb3 review.js_stringin bash 3.2, 5.1 (the image's), 5.2 and 5.3. It found two things, both fixed: a long label pushed the close button off a phone screen (now the text wraps and the button keeps its size), and a timer delayed by a sleeping laptop could keep an ended banner up (nowuntilis checked at least once a minute). Codex check of that commit: clean.Deploying
After this release, the banner shows only where a deployment sets
ANNOUNCEMENT. Where it's unset, the app shows none.Refs OpenConceptLab/ocl_online#425
🤖 Generated with Claude Code
https://claude.ai/code/session_01AaZ4qVYj2Kwzt3oKZf1AwU