Repository navigation
TIG-330 / TIG-336: Lucy's color-gradient UI on the new planner #545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: parallel-planning/view
Are you sure you want to change the base?
Changes from all commits
e34e24a
e4ddb4b
832792a
8c5ce21
1efbeb9
3650e03
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| # TIG-330: color-gradient UI on the new planner (decision log) | ||
|
|
||
| Issues: TIG-330 (parent), TIG-335 (audit), TIG-336 (implementation). | ||
| Design source: Figma file `parallel`. Purple is Anna › `purple (default)` (node `2027:3157`) and pink is | ||
| Angelina › node `447:2`, both confirmed by Helen. | ||
|
|
||
| Each decision below records the options, what this branch does, and which branch holds the other | ||
| option, so you can switch with `git switch <branch>`. | ||
|
|
||
| | Branch | What it changes | | ||
| |---|---| | ||
| | `tig-330-tigerpath-implement-lucys-color-gradient-ui-on-the` | **Main branch.** Every decision uses its default (D1–D11). | | ||
| | `tig-330-alt-figma-exact-text` | D4 alternative: Lucy's exact text colors, which fail WCAG AA. | | ||
| | `tig-330-alt-shared-tokens` | D1 alternative: the classic UI adopts the new palette too. | | ||
|
|
||
| ## D1. Classic UI isolation: new tokens, not edited ones | ||
|
|
||
| **Blocker:** TIG-336 says the classic UI must stay visually unchanged. Every existing CSS variable | ||
| (`--tp-course-*`, `--tp-search-*`, `--tp-requirement-*`, `--tp-active-plan-*`, `--tp-accent`) is also | ||
| read by the classic UI (`styles/Courses.css`, `styles/Requirements.css`, `components/PlanHeader.jsx`). | ||
| Changing their values would recolor the classic UI. | ||
|
|
||
| **Decision:** leave every existing key and value alone, and add new keys to each theme in | ||
| `TIGERPATH_THEME_OPTIONS`, named `<surface>FillStart/End` as TIG-336 asks. `getTigerPathThemeVariables()` | ||
| emits them as `--tp-<surface>-fill-start/end`. | ||
| `theme.test.js` pins the classic purple values so they can't drift by accident. | ||
|
|
||
| New tokens: `courseCardFill*`, `courseCardHoverFill*`, `searchCardFill*`, `searchCodeFill*`, | ||
| `reqChipFill*`, `courseCardText`, `reqChipText`, `planTabActiveFill`, `planTabsFill`, `reqPanelFill`. | ||
|
|
||
| **Other option:** `tig-330-alt-shared-tokens` points the existing keys at the new values too. That | ||
| gives one palette for both UIs, but the classic UI changes. | ||
|
|
||
| ## D2. Orange and blue have no Figma | ||
|
|
||
| **Blocker:** the Figma only has purple and pink. | ||
|
|
||
| **Decision (Helen: "extrapolate from existing"):** each themed color uses that theme's existing hue in | ||
| `theme.js`, with saturation and lightness averaged from Figma's purple and pink. Green and neutral surfaces | ||
| (requirement chip, active plan tab, tab bar, requirement panel) follow warm and cool: orange copies | ||
| pink and blue copies purple. Blue's requirement panel gets a blue tint (`#f8feff`). | ||
|
|
||
| ## D3. The darker course card in the Figma is the hover state | ||
|
|
||
| **Blocker:** the Figma doesn't say what the darker ECO100 card (with the ×) represents. | ||
|
|
||
| **Decision (Helen):** it's hover. `.tp-course:hover` and `:focus-visible` switch to the | ||
| `courseCardHoverFill*` gradient. The existing × still shows on hover. | ||
|
|
||
| ## D4. WCAG AA beats exact Figma text colors | ||
|
|
||
| **Blocker:** TIG-330 requires text on gradients to meet WCAG AA (4.5:1). Lucy's text colors fail on | ||
| the hover card (purple 3.78, pink 3.68), the search course-code pill (purple 4.45, pink 3.68) and the | ||
| requirement chip (purple 2.65, pink 3.28). | ||
|
|
||
| **Decision:** keep every gradient as designed and darken only the two text colors. Each keeps its hue | ||
| and saturation, with lightness lowered to the lightest value that clears 4.5:1 on every stop it sits on. | ||
|
|
||
| | Token | Purple | Orange | Blue | Pink | | ||
| |---|---|---|---|---| | ||
| | `courseCardText` | `#42116f` (Figma `#54168e`) | `#922310` | `#0b6875` | `#970c48` (Figma `#b30e55`) | | ||
| | `reqChipText` | `#0b7a2c` (Figma `#0fa93d`) | `#597112` | `#0b7a2c` | `#597112` (Figma `#6e8b16`) | | ||
|
|
||
| `theme.test.js` checks every text/stop pair for every theme. | ||
|
|
||
| **Other option:** `tig-330-alt-figma-exact-text` uses Lucy's exact colors (its AA test is skipped | ||
| there). Use it if Lucy would rather fix contrast in the design. | ||
|
|
||
| ## D5. Requirement chip direction: `to bottom` | ||
|
|
||
| The Figma gradients are all vertical. The existing chip was drawn `to right`. It's now `to bottom`. | ||
|
|
||
| ## D6. Active plan tab keeps its theme-colored border | ||
|
|
||
| The Figma active tab is lime (`#dcfdad` purple, `#ecf9a5` pink) with no border. TIG-336 also says the | ||
| active tab must stay easy to tell apart. **Decision:** lime fill from the Figma, and keep the existing | ||
| `--tp-active-plan-border` outline, so the active tab still reads clearly against the grey bar and | ||
| still shows the theme. | ||
|
|
||
| Caveat for design review: the lime fill and the grey bar differ mostly in hue. Their luminance | ||
| contrast is only 1.03 to 1.12, so what marks the active tab is its color, the outline and the bold name. | ||
| The tab text (`#181818`) is 15.8:1 on lime. | ||
|
|
||
| ## D7. Duplicate color tokens removed from `new/styles.css` | ||
|
|
||
| `new/styles.css :root` had its own copies of `--tp-text`, `--tp-border`, `--tp-muted`, | ||
| `--tp-drop-ok`, `--tp-drop-warn` and `--tp-incomplete`. They now come from `BASE_THEME` through | ||
| `getTigerPathThemeVariables()`, and `:root` keeps only the layout tokens (`--tp-header-h`, `--tp-radius`). | ||
| `app-style.css :root` (the classic fallback) is **left alone** to keep the classic first paint unchanged. | ||
|
|
||
| ## D8. No unthemed first paint | ||
|
|
||
| Every new-planner color is now a runtime variable, so `new/main.jsx` calls | ||
| `applyTigerPathTheme(getStoredTigerPathTheme())` before the first render. The last theme is kept in | ||
| `localStorage` (`tigerpath-theme`) and falls back to purple. `App` re-applies the profile's theme once | ||
| it loads. | ||
|
|
||
| ## D9. Print uses flat fills | ||
|
|
||
| `@media print` swaps every gradient for its end stop (course card, search card, code pill, requirement | ||
| chip) and keeps the requirement panel white. Print text stays black via the existing `* { color: #000 }`. | ||
|
|
||
| ## D10. Course-card remove icon (×) contrast | ||
|
|
||
| **Blocker (found while checking TIG-336):** the × used `--tp-accent`, which drops below the 3:1 that | ||
| icons need on the hover gradient (orange 2.75). Its red hover color (`#c0392b`) also fell as low as | ||
| 1.84 on that gradient. | ||
|
|
||
| **Decision:** the × now uses the card's text color, which is held to 4.5:1 or better on every hover stop | ||
| by `theme.test.js`. When hovered, it turns red over an 80% white backing, which measures 4.47:1 or | ||
| better in every theme. The classic accent token itself is unchanged. | ||
|
|
||
| ## D11. One branch and PR for TIG-330 and TIG-336 | ||
|
|
||
| TIG-336 is the implementation half of TIG-330, so both ship from | ||
| `tig-330-tigerpath-implement-lucys-color-gradient-ui-on-the`. The PR names both issues so Linear | ||
| links it to each. No separate `tig-336-…` branch, which would have duplicated the same commits. | ||
|
|
||
| ## Not changed (out of scope, recorded for follow-up) | ||
|
|
||
| - Semester and year headers: no fill in the Figma, so no tokens. | ||
| - `.tp-chip` (blue, `#e2f1ff`/`#10508a`), `.tp-btn-save`, `.tp-btn-danger`, notice yellows: off-palette | ||
| but not part of the gradient design. | ||
| - The settings-modal theme swatches still use the classic `courseFill`, `fallSemHeaderColor` and `accent`. | ||
| - The landing-page gradient: a single design, outside the theme system. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,10 @@ | ||
| import React from 'react'; | ||
| import { createRoot } from 'react-dom/client'; | ||
| import { applyTigerPathTheme, getStoredTigerPathTheme } from 'styles/theme'; | ||
| import App from './App'; | ||
|
|
||
| // Every color comes from theme CSS variables, so set them before the first paint. | ||
| // App re-applies the profile's theme once it loads. | ||
| applyTigerPathTheme(getStoredTigerPathTheme()); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a user changes their theme in the classic planner and then clicks “Try new UI,” the classic flow only updates CSS variables and the server profile; it never updates Useful? React with 👍 / 👎. |
||
|
|
||
| createRoot(document.getElementById('app')).render(<App />); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
/api/v1/get_profile/fails in the classic UI,fetchProfilecreates a fallback profile whose theme ispurple, so this truthy check treats the fallback as successfully loaded and overwrites the user's remembered theme. A transient profile failure therefore erases a non-purple cached preference and makes the new planner's next first paint purple; preserve a null theme on failure or separately track whether the profile request succeeded before callingrememberTigerPathTheme.Useful? React with 👍 / 👎.