Repository navigation
feat(shift-manager): three shift themes, logo mark, sidebar polish - #2825
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: de6f82eb-e66a-4cc9-8b7a-5e448577a109) |
jhoffner
left a comment
There was a problem hiding this comment.
Second look + architecture pass
Overall: the approach is sound. shift.ts replacing color-scheme.ts in place (rather than layering a third mode on top) is the right shape: one module owns precedence (pick > served > clock), and the legacy light/dark dual-read (BP-030) is handled. Findings below, ranked.
1. Blocker: ~860 lines of shell tests were deleted, not moved
packages/shift-manager/test/shell.test.tsx loses 864 lines in commit 36bed129 (the "replace color-scheme" commit), which is unrelated to what that file should change for this feature (only the sidebar switch test). I grepped the PR head for the deleted test names and they exist nowhere else:
- "draws a post only once the mailbox holds it" (composer, V6)
- "is where Shift Manager lands…" (Chief of Staff, FIX-1722, whole describe)
- "shows delivered only once the seat's session holds the line" (Inbox reply, BR-4/5/21/22)
- "arrow keys move the highlight…" (Jump to keyboard)
- "finds the Lab's document by name…" (Jump to a declared document)
- empty states, the composer's @mentions, the unreachable-Lab Retry flow
(fails TEAMS and PROJECTS by name does survive in reads.test.ts; the rest don't.) This looks like a stale/overwritten copy of the file rather than an intentional removal; the PR description itself asks the reviewer to "confirm that's intended". It isn't something a theme change justifies (BP-003: coverage claims must be checked). Fix: restore shell.test.tsx from main and re-apply only the switch → mark test replacement (the ~35 added lines).
2. Stale comments/docs left behind
src/main.tsxheader: says "the mode picked… else Auto, which follows the clock". There is no Auto mode; the actual order is pick → served → clock. Reword to matchshift.ts's header.cli/bin.ts: constants/meta are still namedSCHEME_METAand the meta name isshift-manager-color-scheme(also inshift.tsasSHIFT_META). The two files duplicate the string literal, and it now holds a shift, not a scheme. Either rename the meta toshift-manager-shiftin both places, or export one constant. Renaming is cheap now; thefsdev-devtool-url-style meta is internal to this package (checkcommand.test.tsand thefixtures/assets/index.htmlstand-in for the literal).styles.csscomment says "a pick is quick, the clock is slow", but nothing in the PR sets a slow fade for the clock (FADE_MSis the only caller of--shift-xd). Drop the clause or the CSS variable indirection (see #4).
3. Behavior worth a decision/test
choose(next)writes to storage before thenext === shiftearly return. Clicking the already-active shift persists it as a pick even when the page was on the clock default. Via the mark this can't happen (cycle always moves), butchooseis public onShiftLook. Either move thesetItemafter the guard or document it.- With a clock-derived default, the shift is computed once at boot and never revisits; a tab left open past 16:00/19:00 stays on the old theme while the sundial keeps moving. The header documents this ("the clock only moves the mark's sundial"), so it's a deliberate call, but please confirm that's the intended product behavior, since it's the one place a reader would reasonably expect the opposite.
parseShifttolerates storedlight/dark. Good. A test for it exists inshift.test.ts; just make sure the served-meta path (not only storage) is covered.
4. Simplification (optional, in the spirit of "improve while you're here")
--shift-xdcustom property +shift-fadeclass is set per-change but only ever receives one constant (FADE_MS). Hardcode320msin CSS (matching the mark's.32s) and drop thestyle.setPropertyplus theFADE_MS + 100timer padding. Alternatively keep the variable but define the 320 in one place: it currently appears inshift.ts(FADE_MS) and twice inShiftManagerMark.tsx(.32s).html.shift-fade *with!importanttransitions applies to every element for the fade window. Fine at this app's size, but it's the heavy-handed option; a note in the CSS about why would help the next person.SHIFTSorder/STARTS/nextShift/shiftNameare split acrosslib/shift.tsandcomponents/ShiftManagerMark.tsx(shiftNamelives in the component, imported by Sidebar, with Roster re-implementing the same Day/Evening/Night mapping inline inuseLookName). MoveshiftNametolib/shift.tsand have Roster use it; that removes a third copy of the label table.
5. Architecture, relative to this PR
- The three
--shift-*tokens are documented as "the same in every theme" but declared on:rootinshift-manager.cssonly for the shift-manager sheet; confirm nothing else consumes them and thatlabs/design-system/test/shift-manager.test.tsasserts Evening's contrast on--foregroundover--background(the new#eee8d7page), since Evening reuses day's foreground. .gitignoreadds.designs/with no blank-line/comment convention like its neighbours and is unrelated to this change; either explain in the PR or split out.- No
apps/docsduplication concern: the Themes section is copied near-verbatim into bothpackages/shift-manager/README.mdandapps/docs/docs/shift-manager/overview.md. If the README convention is to link to the docs page, prefer a pointer in the README over a second copy to avoid drift.
What I checked and found fine
Changeset is correct (minor, public package, pre-1.0). Profiles JSON migration and shiftName() validation in the CLI refuse unknown shifts with a list. evening correctly never takes dark. Storage failure paths are try/caught both ways.
Only #1 blocks merge; #2 should ride the same push; #3–#5 are the implementer's call.
Generated by Claude Code
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Simplification / approach review
Verdict: The overall direction looks right for the product change (three shifts, mark as control, clock for default + sundial only). Splitting token values in labs/design-system/shift-manager.css from behavior in shift.ts, and moving theme tests out of the huge shell suite, is the cleaner shape I'd want. I would not pull in next-themes or OS prefers-color-scheme here without re‑implementing evening, precedence, and the sundial semantics.
What already reads as the simple path
- Evening as a partial
:root[data-shift=evening]override on top of day tokens — good CSS-only middle theme without a third Tailwind dark mode. bootShiftas the single place for pick → served meta → clock precedence, with legacylight/darkparsing — reasonable evolution fromcolor-scheme.ts, not gratuitous framework.- Test split (
shift.test.ts,mark.test.ts, slim shell coverage for the mark) — net deletion inshell.test.tsxis a win.
Where complexity crept in (non-blocking)
- Global fade via
html.shift-fade *+!important— the heaviest hammer in the PR. It will fight component-level transitions and makes every descendant pay for ~320ms on each theme click. Simpler alternative to consider: transition only custom properties on:root(or a small allowlist of shell surfaces) and let token inheritance do the work; keep motion on the mark SVG only (you already transition transform/fill there). - Duplicated human labels —
shiftNameinShiftManagerMark.tsx+{name} shiftin the sidebar vs a ternary chain inRoster.useLookName. One small helper (e.g.shiftLabel(shift, "shift")) would prevent drift. - Duplicated timing —
FADE_MS = 320inshift.tsvs hard-coded.32sin the mark SVG. - Vocabulary leftovers — meta still
shift-manager-color-scheme, CLIshiftName()vs exportedshiftName(shift), and a few stale comments (main.tsx"Auto",App.tsx"light or dark" / "shift switch"). Not wrong for compatibility, but it adds cognitive load; worth a quick doc/comment pass or a follow-up rename with dual-read on the meta. .gitignore.designs/— if this is just local design exports, fine; if it's unrelated to shipping themes, I'd drop it from this PR to keep the diff focused.
Skipped (larger than this PR)
- Sidebar derive cost (
openRows,streamCounts, per-teamshiftCounts) — pre-existing render work, not introduced by themes. - Merging
bootShiftwithworking.tsinto a generic external-store helper — two call sites; abstraction wouldn't pay yet.
None of the above block merge for me; the architecture matches the feature. Inline notes call out the spots I'd tweak first if you want a follow-up simplification pass.
Sent by Cursor Automation: Review For Best Approach
| * changed the shift: a pick is quick, the clock is slow. | ||
| */ | ||
| html.shift-fade, | ||
| html.shift-fade * { |
There was a problem hiding this comment.
Simplification: html.shift-fade * with !important on background/color/border/fill/stroke is the biggest complexity (and runtime) cost in the theme work — every node gets a forced transition on each click.
Have you tried limiting this to :root / html (transitioning the CSS variables the design-system already owns) or a short allowlist of shell surfaces? The mark already animates via inline transform/fill transitions; the page might fade acceptably without touching *.
Not blocking — but if you see jank or fighting transitions later, I'd start here.
| /* | ||
| * A change of shift fades rather than flips. The class is on the root only | ||
| * while the colours move, and its length (`--shift-xd`) is set by whoever | ||
| * changed the shift: a pick is quick, the clock is slow. |
There was a problem hiding this comment.
Nit: the comment says the clock sets --shift-xd / "the clock is slow", but bootShift only adds shift-fade on user choose, not on the 15s sundial tick. Worth aligning comment with behavior so the next reader doesn't hunt for clock-driven fades.
| const scheme = useSyncExternalStore(look?.subscribe ?? NEVER, () => look?.current()); | ||
| return scheme === undefined ? null : scheme === "dark" ? "Night shift" : "Day shift"; | ||
| const shift = useSyncExternalStore(look?.subscribe ?? NEVER, () => look?.current()); | ||
| return shift === undefined ? null : shift === "night" ? "Night shift" : shift === "evening" ? "Evening shift" : "Day shift"; |
There was a problem hiding this comment.
Reuse: Sidebar already uses exported shiftName(shift) + " shift". This ternary duplicates the same strings — easy drift if copy changes.
Consider shiftName(shift) + " shift" (or a tiny shared shiftLabel() next to Shift in shift.ts / re-export from the mark module).
| import type { ShiftLook } from "./lib/shift"; | ||
| import type { LabClients } from "./lib/connection"; | ||
| import type { LoadedSnapshot } from "./lib/derive"; | ||
| import { LabProvider, useLab } from "./lib/lab-data"; |
There was a problem hiding this comment.
Stale JSDoc after this PR: the look is three shifts (day/evening/night), controlled by the mark, not a bottom "shift switch" or light/dark binary.
| * Shift Manager's entry: set the look (the shift picked in this browser, else | ||
| * the one it was started on, else the OS's light or dark setting), connect as | ||
| * Shift Manager's entry: set the look (the mode picked in this browser, else | ||
| * the shift it was started on, else Auto, which follows the clock), connect as |
There was a problem hiding this comment.
File header still describes Auto following the clock as a boot mode. Current precedence is pick → served --shift meta → clock default; auto is only legacy storage parsing. Quick comment update would match shift.ts.
| const STARTS: Record<Shift, number> = { day: 6, evening: 16, night: 19 }; | ||
|
|
||
| /** The page meta the `shift-manager` command writes a forced shift into. */ | ||
| const SHIFT_META = "shift-manager-color-scheme"; |
There was a problem hiding this comment.
Optional follow-up (not required): keeping the meta name shift-manager-color-scheme while the domain is Shift is confusing alongside CLI shiftName() vs component shiftName(shift). Dual-read a renamed meta in a later PR might be cleaner than living with the mismatch — if you're willing to touch served HTML.
| <path key={SHIFTS[i]} d={d} /> | ||
| ))} | ||
| </g> | ||
| <g style={{ transform: `translateX(${SHIFTS.indexOf(shift) * PETAL_STEP}px)`, transition: "transform .32s cubic-bezier(.6,0,.2,1)" }}> |
There was a problem hiding this comment.
Small DRY nit: .32s here duplicates FADE_MS = 320 in shift.ts (and --shift-xd). A shared constant or reading var(--shift-xd) in CSS for the SVG group would keep fade timing one source of truth.
| * @throws Refusal for a name with no profile, listing the known ones. | ||
| */ | ||
| function shiftScheme(flag: string | undefined): "light" | "dark" | undefined { | ||
| function shiftName(flag: string | undefined): "day" | "evening" | "night" | undefined { |
There was a problem hiding this comment.
Naming smell: CLI shiftName(flag) resolves a profile name, while ShiftManagerMark.tsx exports shiftName(shift: Shift) for display. Grep/confusion cost — e.g. resolveShiftFromFlag / readShiftProfile on the CLI side. Minor.
|
|
||
| # graft's local graph cache — regenerable, not committed (run `graft build`). | ||
| /graft/ | ||
|
|
There was a problem hiding this comment.
Is .designs/ intentional in this PR? If it's local design hand-back exports unrelated to shipping the three themes, pulling it out keeps the diff focused (happy to be wrong if you rely on this path in CI/dev).
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 292a71a4-732b-4026-b2a6-7c20ce3cc5c6) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fc2826fd3f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "@flow-state-dev/shift-manager": minor | ||
| --- | ||
|
|
||
| Shift Manager has three themes, Day, Evening and Night, instead of light and dark. The mark at the top of the sidebar changes the theme with a click, fading to the new one, and its sundial dot shows the time of day. `--shift` and `SHIFT_MANAGER_SHIFT` also take `evening`. A page started with no pick and no shift opens on the theme the clock calls for (Day from 06:00, Evening from 16:00, Night from 19:00) rather than following the OS's light or dark setting. The sidebar's Day shift / Night shift switch is gone. |
There was a problem hiding this comment.
Add the required issue reference to the changeset
This fragment contains no Linear issue ID and uses multiple sentences, so the repository's validate-changeset-refs.mjs release gate will reject it. Condense it to one user-facing sentence that includes the relevant issue identifier.
AGENTS.md reference: AGENTS.md:L36-L39
Useful? React with 👍 / 👎.
| open: values["no-open"] !== true, | ||
| app: values.assets === undefined ? APP : resolve(invokedFrom, values.assets), | ||
| pageMeta: scheme === undefined ? undefined : { [SCHEME_META]: scheme }, | ||
| pageMeta: shift === undefined ? undefined : { [SCHEME_META]: shift }, |
There was a problem hiding this comment.
Preserve day and night values for older asset builds
When the supported --assets option serves a pre-change Shift Manager build, --shift day and --shift night are now silently ignored: the old readServedColorScheme accepts only light and dark, while this writer now emits day and night. Because the new reader already maps legacy light/dark values, emitting those legacy values for day/night while reserving evening for new builds would keep this version-skew path working.
Useful? React with 👍 / 👎.
|
|
||
| describe("the sidebar's shift switch", () => { | ||
| it("shows the shift the page is in, and a click flips the look both ways", async () => { | ||
| describe("the sidebar's mark", () => { |
There was a problem hiding this comment.
Restore the unrelated shell integration coverage
Replacing the theme-control test here also deletes roughly 800 lines of unrelated real-Lab coverage, including refusal/retry, posting and answering asks, Chief of Staff recovery, resource navigation, and keyboard navigation. The current package tests retain some lower-level coverage but not these complete UI flows, so regressions in them can now pass CI unnoticed; restore those describe blocks and limit this file's change to adapting the theme-control case.
Useful? React with 👍 / 👎.
| color var(--shift-xd) linear, | ||
| border-color var(--shift-xd) linear, | ||
| fill var(--shift-xd) linear, | ||
| stroke var(--shift-xd) linear !important; |
There was a problem hiding this comment.
Preserve the mark's transform transition
During every theme change, this !important transition shorthand applies to all descendants and overrides the moving petal group's inline transition: transform .32s .... Since choose() adds shift-fade before React updates that group's transform, the selected petal jumps to its new position instead of sliding; scope the color fade more narrowly or include the transform transition.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Code Snob — tried a rewrite, it lost. No POC.
I inlined profiles/{day,evening,night}.json into a constant in cli/bin.ts and pointed the roster and the mark at one name table. Discarded it.
The JSON bodies do repeat their filenames ("shift": "day" and so on). That read is still the lookup --shift does: list profiles/*.json, parse shift, refuse a file whose value is not one of the three. scripts/packed-install/fixtures/shift-manager.mjs asserts profiles/day.json and profiles/night.json are in the tarball because the installed command reads them. Deleting the files fails that check unless the check is weakened, and the CLI build is rooted at cli/ so it cannot import SHIFTS from src/lib/shift.ts. The constant would be a second list, not one list.
Moving the sundial's 15s tick from bootShift into ShiftManagerMark only relocates TICK_MS, shownMinute, and stop(). Same clock.
useLookName's ternary and the mark's NAMES are the same three words. One shared record saves the ternary and costs the record.
Read: cli/bin.ts, profiles/*.json, src/lib/shift.ts, src/components/ShiftManagerMark.tsx, src/surfaces/Sidebar.tsx, src/surfaces/Roster.tsx, test/shift.test.ts, test/mark.test.ts, scripts/packed-install/fixtures/shift-manager.mjs.
Sent by Cursor Automation: Code Snob
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 2504ad24-f587-4caf-96d6-d21f9d2b71a4) |
… composer The palette sent the line itself, so the feed didn't follow it and the working state could stall. The Coordinator composer now sends it, as if typed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: c948a9fa-2c6f-428c-858c-d80e170b3615) |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 1d1638dd-cd15-4f21-9065-9b71dc32f506) |
…eview notes The look is a theme; shifts stay the CLI's profile names and the roster's on/off-shift vocabulary. Also: one meta (shift-manager-theme) with the old one still written for older builds, one fade length, shared theme labels, and no !important on the fade so the mark's own transition runs. Refs FIX-1800 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Only the switch test is replaced, by the mark's. Refs FIX-1800 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Refs FIX-1800 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: de2a337c-93b0-41ac-af31-1ffc2a2938aa) |
The day/evening/night themes and their logo mark replaced v2's shift switch (36bed12, shipped in #2825), and the goal follows the shipped design. - v2's "shift switch" row (v2:113) gives way to rows for the sidebar header, the theme mark and its svg, the app's name and the theme name. Each asserts the computed values the run reads (padding and width, the mark's 42px, the name's 14/700 sans at -0.025em, the theme name's 10/500 mono at 0.14em) and cites 36bed12 / #2825 and the source line that sets it, which setup checks the way it checks a v2 line. - No other row's values change. `drift` now fails only at surface and type, `missing` and `unclassified` only at totality where named. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…to goals/lib (FIX-1824) The closure's reach walk looked for the sidebar's Day / Night switch, which the theme mark replaced (36bed12 / #2825), so a3, b:reach and c:reach were red on every run. It now clicks the mark as a person does until it reaches night, day and the theme it started on, checking the page takes each. pickShift, which it-draws-v2s-look already used for this, moves to goals/lib/shift-manager.mts so both goals share it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…k (FIX-1824) The goal drove the Day / Night switch the theme mark replaced (36bed12 / #2825), and its passes relied on Shift Manager following the OS setting, which it no longer does. Each pass now runs over a Lab started on its shift (SHIFT_MANAGER_SHIFT), the switch leg picks with the theme mark (goals/lib's pickShift) against the shift each Lab started on, and switch-ignored patches out the mark's click handler. Still red at themed: the mark's root svg leaves fill at the default black. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV


Summary
>in Jump to (⌘K) sends the line to the Shift Coordinator, through the Coordinator screen's own composer.The look is called a theme in code. Shift stays where it is the product's word: the
--shiftflag,SHIFT_MANAGER_SHIFT, the profile names, and on/off-shift counts.Review feedback addressed
shell.test.tsxthe first pass deleted; only the switch test is replaced, by the mark's.shift-manager-theme;shift-manager-color-schemeis still written (light/dark) so--assetscan serve an older build.FADE_MS), no!importanton the fade so the mark's transform transition runs, sharedthemeLabelfor the header and roster, stale comments fixed..designs/ignore removed from this PR.Not changed
lib/theme.ts).Test plan
pnpm --filter @flow-state-dev/shift-manager test: all pass except 7 that need the built pages (build-inputs, app contract)pnpm --filter @flow-state-dev/design-system testnode scripts/validate-changeset-refs.mjs>message inpnpm shift-manager:dev🤖 Generated with Claude Code
Note
Low Risk
Mostly UI/theming and palette messaging; legacy meta preserves older page builds, with broad test coverage for theme precedence and the new Jump-to flow.
Overview
Shift Manager moves from a light/dark model tied to the OS to three shift themes—Day, Evening, and Night—with design tokens, CLI profiles, and app wiring aligned on
day | evening | night.Theming:
color-scheme.tsis replaced bylib/theme.ts, which setsdata-themeon the root, applies.darkonly for Night, fades changes (~320ms), and picks the initial theme from saved preference, then--shift/SHIFT_MANAGER_SHIFT(shift-manager-thememeta), then time of day (Day 06:00, Evening 16:00, Night 19:00). The clock only drives the mark’s sundial afterward. The footer Day/Night toggle is gone;ShiftManagerMarkin the sidebar header cycles themes and shows the sundial. The design-system adds an Evening override (data-theme="evening"),--theme-*petal colors, and tests for the third variant.CLI & compat: Profiles use
themeinstead ofcolorScheme;evening.jsonis new. The CLI still writes legacyshift-manager-color-scheme(light/dark) for older--assetsbuilds.Jump to (⌘K): Queries starting with
>hand text to the Shift Coordinator via a small outbox; Chief of Staff’sTurnComposerauto-sends on the same path as typing. Docs, rootshift-manager:dev, and a minor changeset are included.Reviewed by Cursor Bugbot for commit 1620350. Configure here.