Repository navigation
feat(frontend): add opt-in seasonal decorations - #397
Merged
Merged
Conversation
…odles ONCALL_ACCENT lists the decoration packs a deployment allows; empty, the default, draws nothing. The API answers in /api/v1/config with what to draw on today's Warsaw date, so the setting is written once and left and the interface keeps no calendar of its own. - winter, 6 December to 6 January unless ONCALL_ACCENT_FROM and ONCALL_ACCENT_UNTIL (MM-DD, both or neither) name another season: a hat on the logo mark, snow inside the "Teraz" strip and a garland of lights under it, a winter night on the sign-in screen, and a sleigh ahead of the generator's progress bar. - doodles: one small drawing on the logo mark on seven days of the year (New Year's Eve and Day, Fat Thursday, 14 February, Easter Sunday and Monday, 1 April). Every drawing lives in one lazily loaded chunk that only a deployment with the setting downloads. It is styled on a screen only, so printouts, exports and e-mails stay plain; nothing moves under prefers-reduced-motion; a share-link session is never decorated; and each person can turn the decorations off for their own browser in the account menu. The garland and the strip snow belong to the desktop strip: a phone shows the hat or the doodle only.
Seven open issues on the pull request, fixed in the code with no change
in behaviour:
- config.py: the MM-DD shape is `\d{2}-\d{2}` under re.ASCII, which is
exactly what `[0-9]{2}-[0-9]{2}` matched (S6353, twice).
- art.tsx: the seeded sequence keeps its state unsigned (`>>> 0`) instead
of signed (`| 0`). The state is only ever read through 32-bit operators,
so the bits and the numbers drawn are the same (S7767).
- art.tsx: the garland wire is joined from its parts instead of nesting
one template literal in another (S4624).
- art.tsx: the tree's lights are worked out once, each named by the moment
it comes on, so a light and a row have a key of their own instead of an
array index, and rendering no longer counts as it goes (S6479).
- art.tsx: the props of LoginNight and ProgressRider are read-only (S6759).
The markup the decorations render is byte for byte what it was, and the
sequence is identical over two million draws from ten seeds.
…ard shows The tree on the winter sign-in screen lit its role marks once, one after another. On the design board they twinkle, so they do here now: every light runs the same slow cycle with a short glow in the colour of its own role, and each starts at a moment of its own so no two twinkle together. The moments are the board's. The tree stays where it was. Like everything else on the sign-in screen, which nobody can switch off before signing in, the twinkle ends by itself after about twenty seconds and leaves the tree lit; under prefers-reduced-motion the tree is lit and still from the start.
|
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.



Intent
Design a feature for the oncall project: a festive / fun accent for the tool, with animation welcome (for example a Christmas / winter holiday touch, but also ideas that are just playful). It must be switched on through oncall's configuration (opt-in, off by default). Come up with several to a dozen-plus distinct variants and present them to the captain for a decision through a Lavish page.
Fifteen variants (V01 to V15) were presented on a review board with a written report, and the decision was made there. During the review this was asked: "w jaki sposob bedzie to ustawiane w konfiguracji? chodzi mi konkretnie o V01 - bo niby ustawiamy to na zimowe swieta ale loga odnosza sie do innych wydarzen w ciagu roku rowniez - to byloby wdrozone na stale wtedy czy jak?" The answer shown on the board, and accepted: the setting is written once and stays; each name is a pack with its own calendar built into the product, so nobody edits the configuration when a season starts or ends, and a pack listed permanently is not shown permanently. V01 became the winter hat only (pack
winter), and the all-year logo doodles became V15 with their own packdoodles.The decision: implement V01 (winter hat on the logo mark), V05 (light garland under the "Teraz" strip), V06 (snow inside the "Teraz" strip, combined with V05 as shown on the final board), V09 (winter night on the sign-in screen), V12 (sleigh on the generator progress bar), V15 (all-year logo doodles on their seven days). Skipped: V02, V03, V04, V07, V08, V10, V11, V13, V14. Setting shape: a name plus an optional date window, off by default, e.g.
ONCALL_ACCENT=winter,doodleswith optionalONCALL_ACCENT_FROM/ONCALL_ACCENT_UNTIL;wintercarries V01, V05, V06, V09, V12 (6 Dec to 6 Jan),doodlescarries V15. Build exactly as designed in the report; honor prefers-reduced-motion, no external assets, no effect on printed or exported reports. The review ended with "ok" after the combined set was shown.What the report and the board say about the chosen set:
The switch.
ONCALL_ACCENT=(empty, the default) means off. A name turns a pack on; several names are comma-separated. OptionalONCALL_ACCENT_FROM/ONCALL_ACCENT_UNTIL(MM-DD, inclusive, may wrap the year) move thewinterseason only; without themwinterruns 6 December to 6 January, anddoodlesignores them. An unknown name, a malformed date or half a window is refused at startup. The days are evaluated on the Warsaw business date. Each person can turn the decorations off for themselves with a switch in the account menu, remembered in the browser like the theme and shown only while an accent is active; this switch is a hard requirement of the set, because the garland and the strip snow move continuously. A share-link session (people outside the team) gets no accent. A deployment without the setting downloads nothing extra. Guardrails for every variant: off by default;prefers-reduced-motionhonoured with a still fallback; nothing drawn above matrix cells, role marks, state colours or text; no external assets, no sound; screen only, so CSV, e-mail, calendar feeds, printouts and documentation are untouched; new colours are a few accent tokens; the operator documentation describes the variables in both languages.V01 A hat on the logo mark. The logo mark (rail, phone bar, sign-in) wears a small hat from 6 December to 6 January and is the plain mark for the rest of the year; one nod on load. The favicon and the e-mail header keep the plain mark.
V05 Light garland under the "Teraz" strip. A string of about 20 small lights hangs from the lower edge of the blue strip, in the free 24 px of page padding, twinkling slowly and out of step, in the product's palette (teal, salmon, signal blue, violet). The board describes it as mounted as a child of the strip (and of the phone's top bar). Steady glow with reduced motion; it covers nothing, pointer events off; identical in both themes.
V06 Snow inside the "Teraz" strip. Snow falls only inside the strip, behind its text. Combined with V05 on one strip: the snow stays inside the strip, the garland hangs below it, and the snow drift on the strip's lower edge is left out so the garland wire is the only thing there.
V09 Winter night on the sign-in screen. Stars, slow snow, a snow cap on the card and a Christmas tree built from the matrix's own role marks (P, S, 11-19), lighting up one by one. All decoration sits beside or behind the form; the tree hides below 900 px; there is no personal switch before sign-in, so the snow ends by itself after about 20 seconds.
V12 Sleigh on the generator's progress bar. A small sleigh rides the leading edge of the progress bar while the solver runs. It adds 26 px above the bar while a generation runs.
V15 Mark doodles through the year. On seven days a year the logo mark carries a small doodle: a sparkle on 31 December and 1 January, a pączek on Fat Thursday, a heart on 14 February, a pisanka on Easter Sunday and Monday, an upside-down mark on 1 April; the plain mark on the other 358 days. The pack knows its days, the movable ones included (Fat Thursday is 52 days before Easter); the list of days lives in the code. On 31 December and 1 January, which belong to both packs, both are drawn: the hat stays and the mark's dot becomes the sparkle.
Decided later, at the review and test gates of the first validation of this branch. Where these differ from the wording above, these stand:
winteranddoodles(no other spelling or case), and the bounds are exactly two digits each, MM-DD; everything else is refused at startup.A later requirement: SonarCloud must report exactly 0 issues for the pull request (new and open). It reported 7 open issues (no hotspots): python:S6353 in config.py twice (use \d instead of [0-9]); in art.tsx S7767 (Math.trunc instead of | 0), S4624 (nested template literals), S6759 twice (mark component props read-only) and S6479 (a stable key instead of an index). Fix every one without changing behaviour: the seeded sequence must stay deterministic, the one-nod hover and all previews unchanged. Keep the 100 percent coverage gates. Do not mark issues as accepted or won't-fix to get to zero; fix the code.
A further ask, about the Christmas tree on the sign-in screen (V09): in the video in the pull request description the tiles the tree is built from light up one after another; on the review board's mockup the tiles twinkle. Make the implementation consistent with the mockup: the tiles twinkle, as designed. Keep the tree's placement exactly as it is in the code now (do not move it to where the mockup puts it). Honor prefers-reduced-motion (still fallback), keep determinism and the tests at 100 percent coverage, keep SonarCloud at exactly 0 issues, and refresh the pull request description's video and screens so they show the twinkling tree. This replaces "lighting up one by one" in the V09 description above.
What the mockup's tree does: every tile runs the same 3.4 s cycle in which it briefly brightens and glows in the colour of its own role, and each tile is at a different moment of that cycle, so they twinkle out of step; the tree is lit from the start and has no lighting-up sequence.
What Changed
Setting, off by default:
ONCALL_ACCENTtakes a comma-separated list of packs,winteranddoodles. Each pack knows its own days, based on the Warsaw date, so the setting is written once.ONCALL_ACCENT_FROM/ONCALL_ACCENT_UNTIL(MM-DD) move the winter season only. Unknown names, malformed dates, or only one of the two dates stop the API at startup./api/v1/confignow lists the decorations to draw today.What people see:
winter(6 December to 6 January) adds:doodlesputs a small drawing on the logo on seven days a year. The drawings load as a separate chunk, only when there is something to draw. They show on screen only, take no clicks, and stand still underprefers-reduced-motion. Motion on the sign-in screen stops by itself.Personal control and docs: The account menu and the "More" screen get a Decorations on/off switch, shown only on decorated days and remembered in the browser. Share-link sessions never show decorations. If the browser refuses to store a preference (theme, density or decorations), the choice now holds until the page is reloaded. The setting is documented in
.env.example, Compose,DESIGN.md, and the Polish and English docs.Risk Assessment
✅ Low: The decorations are off by default, screen-only and optional, a failed download leaves the plain interface, earlier findings are fixed or settled, and the new twinkle changes only one animation and its test and matches the stated cycle.
Testing
I ran the real product (API, worker, solver, database, nginx, Chromium) with throwaway data. No baseline commands had been run before this step. The tree is lit from the start, and every tile twinkles on the same 3.4 s cycle at its own moment, in its role's colour. It sits exactly where the previous commit had it, and it stops by itself in about 20 s. I also rechecked the strip, hat, switch, share link, print, sleigh, calendar, doodles and startup refusals, and ran the related unit tests; everything passed. I had to rerun two checks because my own scripts were at fault: a missing security token on the share link, and a probe that made the sleigh jump. Both were clean on the rerun. Still open: the SonarCloud count and the pull request's refreshed video, which come after the push. I did not rerun the CSV, e-mail and calendar feed outputs. All test services and files were removed.
signin-tree-twinkle.webm
Evidence: Tree measurements
Evidence: App checks
Evidence: Startup settings
Evidence: Calendar 2026-2028
Evidence: Doodle checks
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
frontend/src/decor/decor.css:112- The tree's tiles stop twinkling after about 20 seconds: 6 runs of the 3.4 s cycle, minus each tile's head start, so 17.4 to 20.3 s. After that the tree stays lit and still. The intent describes the cycle but does not say whether it ever ends. Ending it fits the V09 reason for the snow (nobody can switch decorations off before signing in) and the DESIGN.md rule that the sign-in screen stops moving by itself. No change needed; noted so the author knows the twinkle is not endless.✅ **Test** - passed
✅ No issues found.
Built this commit and the one before it (a5f8231), and compared the tree's position in both at four window sizesReal API, worker, solver, PostgreSQL 18.7 and nginx with the repo's own config, driven in Chromium with throwaway demo dataSign-in tree: 24 s of measurements in dark and light themes, a still check after 27 s, reduced motion, 900/901/390 px widths, reload, and clicking through the decoration (signin-tree-measurements.txt)Strip garland and snow, hat nod, personal switch, blocked storage, phone, print, share link, lost decoration file, setting off, sleigh with the real solver (app-checks.txt)Real API start with 13 settings (startup-settings.txt) and/api/v1/configfor every day of 2026-2028 with a moved clock (calendar.txt)Each doodle day on sign-in, rail and phone, with the API clock moved to that day (doodle-checks.txt)npx vitest run src/decor src/accent.test.tsx src/hooks/useAccentHost.test.tsx scripts/decor-load.test.mjs✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.