Repository navigation
fix(web): align sidebar icon motion and stroke weight - #2365
Conversation
Jessie-QingYu
left a comment
There was a problem hiding this comment.
Code Review: ✅ APPROVE
Summary
The PR merges the Apps keyframe animation and the Chat transition into one data-motion="tilt" value. Apps, Chat and Projects now use it. It also removes the stroke-[1.5] override on Projects. I checked that:
- The sidebar renders Chat with lucide
MessageSquare(AppGrid.tsx:149), not thePencil2Iconlisted inbuiltin-nav.ts. Projects uses lucideFolderKanban. With the override gone, both draw at lucide's default stroke of 2, so they now match as the PR intends. - No other code or test refers to the old
"apps"/"chat"motion values, the removed keyframes, orstroke-[1.5]. TheAppGrid.recent.test.tsxcheck that a pinned app's icon class matches the Memory icon is unaffected, because the span's className did not change. - The motion rules now apply only under
prefers-reduced-motion: no-preference. That is a cleaner opt-in than the old reduce-mode override, and it still meets the "glyphs stay still" invariant. The reduce block now only resetswill-change. - The hover/focus selector still matches the
rome-sidebar-linkrow, rail tile and search-pill classes, so the collapsed rail and the drawer behave the same. - The DESIGN.md wording matches the new behaviour.
Design & Alternatives
| Option | Pros | Cons |
|---|---|---|
One shared tilt transition (this PR) |
Same hover response on all three rows; tilt holds while hovered; one CSS rule; one reduced-motion gate | Apps loses its scale "pop" |
Keep the Apps keyframes with animation-fill-mode: forwards |
Keeps the pop | Snaps back on pointer exit with no transition; two motion systems remain |
Use a motion-safe: Tailwind variant on each span |
Rule sits next to the markup | Repeated in three places; harder to keep in step with .rome-sidebar-link hover/focus |
The chosen approach is the simplest of these.
Finding
- P3: the new
transition: transform …rule replaces thetransition-colorsutility on the same span. For Apps and Projects, the glyph's colour change on selection now snaps instead of fading. Chat already behaved this way.
Verdict: APPROVE — The change is small and does what it says: one tilt rule replaces two divergent motions, reduced-motion users are now covered by an opt-in media query, and the Projects stroke override is gone. The one finding is an optional P3.
1 finding(s) posted as inline comments below.
| Severity | Category | File | Title |
|---|---|---|---|
| P3 | code-quality | packages/web/src/globals.css |
Tilt transition replaces the span's colour transition |
Automated review by RomeOS Code Review · commit 762c401 · Full review history
| } | ||
| @media (prefers-reduced-motion: no-preference) { | ||
| .rome-sidebar-icon[data-motion="tilt"] { | ||
| transition: transform 150ms ease-out; |
There was a problem hiding this comment.
[P3] code-quality — Tilt transition replaces the span's colour transition
The span in renderBuiltinIcon also carries transition-colors. This unlayered transition shorthand wins over the Tailwind utility and leaves only transform in the transition list. Apps and Projects now snap to text-primary on selection instead of fading; before this PR only Chat did. To keep both, list the colour property too:
| transition: transform 150ms ease-out; | |
| transition: transform 150ms ease-out, color 150ms ease-out; |
zoolsher
left a comment
There was a problem hiding this comment.
Code Review: ✅ APPROVE
Summary
The PR replaces two motion variants with one tilt variant. Before, Apps ran a one-shot 420 ms keyframe that returned to rest while still hovered, and Chat used a held transition. The PR also gives Projects the same motion and drops its stroke-[1.5] override.
Verification beyond the diff
- Leftover references:
data-motionandsidebarIconMotionappear only inAppGrid.tsx(renderBuiltinIcon),builtin-nav.tsandglobals.css. Nothing else uses the old"apps"/"chat"values, the deletedrome-sidebar-apps-hoverkeyframe, orstroke-[1.5], and no test asserts on them. - Reduced motion: the transition and the hover/focus transform now sit inside
@media (prefers-reduced-motion: no-preference). The old override in thereduceblock (animation: none; transform: none) is no longer needed, so removing it is correct.will-change: autois still set underreduce. - Selector scope: the tilt only fires inside
.rome-sidebar-link. That class is on the rail tile, the labelled row and the search pill (sidebar-shared.ts,AppGrid.tsx:494), so it covers both the collapsed and expanded sidebar. - Stroke weight: with the override gone,
FolderKanbanuses the default stroke of 2 that the other lucide glyphs in the sidebar already use (Bot,Megaphone).
Design & Alternatives
| Approach | Pros | Cons |
|---|---|---|
One tilt value plus a gated CSS transition (this PR) |
Holds the tilt on hover/focus. Reverses smoothly on exit. Respects reduced motion by default. Less CSS. | sidebarIconMotion now has only one value, so it works like a boolean. |
Keep the keyframe with animation-fill-mode: forwards |
Keeps the scale "pop" | Returns to rest with a jump instead of a smooth reverse. More CSS. |
Replace the field with sidebarIconTilt?: boolean |
Clearer type | Small churn. Leaving it as a string union leaves room for future variants. |
The chosen approach is the simplest of the three.
Verdict: APPROVE — The change is small and correct: one tilt transition, motion gated behind prefers-reduced-motion: no-preference, no leftover references or broken tests. The only finding is an optional P3 about wording in DESIGN.md.
1 finding(s) posted as inline comments below.
| Severity | Category | File | Title |
|---|---|---|---|
| P3 | documentation | DESIGN.md |
"Share a stroke width" is imprecise for a fill-based Radix glyph |
Automated review by RomeOS Code Review · commit 762c401 · Full review history
|
|
||
| ### Navigation | ||
| - **Sidebar:** Canvas fill with 1px region boundaries in `border-strong`. Navigation groups and the footer use the shared Separator with `border-strong`; shell columns and the Tasks card use the same token for their edges. Footer and topic-menu action glyphs follow their control's size, 14px at the small step and 16px at the medium step. Navigation rows, chat rows outside the Tasks card, and the search pill use `--row-h` (36px), with 12px corners and regular-weight `text-ui`. Both columns use the medium row inset for 12px of content padding and a matching 12px icon gap. A 16px icon slot starts at x=20 and text at x=48 within each column. Bordered links subtract their border from that inset. Project children and the Tasks card derive their text insets from the same column offset. Project chats keep the tree guide and selected marker; selection does not increase their weight. The New chat row has no separator above it, and its shortcut uses a square muted Badge rendered as `kbd`. The chat-list header aligns with the rail header. Its mode switch uses the shared outer inset and the SegmentedControl padding, independent of the row icon column. New-chat and main-chat rows share the navigation rhythm. Topic rows show a `#` in the same icon slot as the main chat so their text starts on the same vertical line. An unread count is a 16px circle with compact 11px/16px type from the host-owned `--row-count-*` tokens, expanding to a pill for wider counts. It uses `primary/15` for the fill and a 60% `primary` mix with `foreground` in OKLab for the numeral, matching the upgrade row's contrast-safe accent ink. Its border is transparent in light mode and `primary/50` in dark mode. It occupies the icon slot until the count clears and stays visible when the row menu appears. Lists and the Tasks card share an 8px outer inset, and the Tasks heading uses the same row height. The navigation rail's search trigger is a borderless pill with a `surface-muted` fill. The medium row vertical inset separates it from the navigation group. Navigation, list glyphs, and app artwork are 16px, with a 1.5px stroke for Projects. Filled artwork reads slightly larger than outline glyphs within the same fixed slots, and names stay aligned. Hover takes `surface-hover`. The selected row takes `surface`, `shadow-4`, a single 1px outer edge in `border` at 70% alpha, regular-weight text, and a `primary` glyph; dark mode uses `surface-hover`. App artwork keeps its own colors. Rows inside the Tasks card use 8px corners, matching its heading and the concentric corner rule. A selected task uses the hover fill without another shadow. Archived chats read in Subtle Ink. Unread activity is an 8px `info` dot that hides on hover to reveal the row action. Below the pinned entries, a hairline and an aux "Recent" label introduce up to three unpinned apps the guardian built or opened in the last 14 days, most recent first, with a "Show more" row for the rest. The zone is absent when empty. An installed, never-opened app carries the same 8px `info` dot, which on hover gives way to a Pin action. On touch the Pin action is always visible and the dot sits beside it. | ||
| - **Sidebar:** Canvas fill with 1px region boundaries in `border-strong`. Navigation groups and the footer use the shared Separator with `border-strong`; shell columns and the Tasks card use the same token for their edges. Footer and topic-menu action glyphs follow their control's size, 14px at the small step and 16px at the medium step. Navigation rows, chat rows outside the Tasks card, and the search pill use `--row-h` (36px), with 12px corners and regular-weight `text-ui`. Both columns use the medium row inset for 12px of content padding and a matching 12px icon gap. A 16px icon slot starts at x=20 and text at x=48 within each column. Bordered links subtract their border from that inset. Project children and the Tasks card derive their text insets from the same column offset. Project chats keep the tree guide and selected marker; selection does not increase their weight. The New chat row has no separator above it, and its shortcut uses a square muted Badge rendered as `kbd`. The chat-list header aligns with the rail header. Its mode switch uses the shared outer inset and the SegmentedControl padding, independent of the row icon column. New-chat and main-chat rows share the navigation rhythm. Topic rows show a `#` in the same icon slot as the main chat so their text starts on the same vertical line. An unread count is a 16px circle with compact 11px/16px type from the host-owned `--row-count-*` tokens, expanding to a pill for wider counts. It uses `primary/15` for the fill and a 60% `primary` mix with `foreground` in OKLab for the numeral, matching the upgrade row's contrast-safe accent ink. Its border is transparent in light mode and `primary/50` in dark mode. It occupies the icon slot until the count clears and stays visible when the row menu appears. Lists and the Tasks card share an 8px outer inset, and the Tasks heading uses the same row height. The navigation rail's search trigger is a borderless pill with a `surface-muted` fill. The medium row vertical inset separates it from the navigation group. Navigation, list glyphs, and app artwork are 16px. The Projects and Chat glyphs share a stroke width. The Apps, Chat, and Projects glyphs tilt during hover or keyboard focus. Filled artwork reads slightly larger than outline glyphs within the same fixed slots, and names stay aligned. Hover takes `surface-hover`. The selected row takes `surface`, `shadow-4`, a single 1px outer edge in `border` at 70% alpha, regular-weight text, and a `primary` glyph; dark mode uses `surface-hover`. App artwork keeps its own colors. Rows inside the Tasks card use 8px corners, matching its heading and the concentric corner rule. A selected task uses the hover fill without another shadow. Archived chats read in Subtle Ink. Unread activity is an 8px `info` dot that hides on hover to reveal the row action. Below the pinned entries, a hairline and an aux "Recent" label introduce up to three unpinned apps the guardian built or opened in the last 14 days, most recent first, with a "Show more" row for the rest. The zone is absent when empty. An installed, never-opened app carries the same 8px `info` dot, which on hover gives way to a Pin action. On touch the Pin action is always visible and the dot sits beside it. |
There was a problem hiding this comment.
[P3] documentation — "Share a stroke width" is imprecise for a fill-based Radix glyph
Pencil2Icon comes from @radix-ui/react-icons. Those icons are filled 15×15 paths with no SVG stroke. FolderKanban comes from lucide and draws a 2-unit stroke on a 24-unit grid, about 1.33px at 16px. So the two glyphs don't literally share a stroke width; they just look about as heavy as each other. Consider wording such as "The Projects glyph uses the default lucide stroke, matching the visual weight of Chat" so nobody later tries to tune one value to make them identical.
zoolsher
left a comment
There was a problem hiding this comment.
Design & Alternatives review: ✅ APPROVE
Problem: When someone hovers the Apps row, its glyph springs back to rest while the pointer is still on the row, and the Projects glyph looks lighter than Chat. The Apps glyph resets because it used a one-shot 420 ms keyframe animation (rome-sidebar-apps-hover), while Chat used a held transition + transform. Projects looks lighter because AppGrid.renderBuiltinIcon forced stroke-[1.5] on it, but the sidebar draws Chat with lucide's MessageSquare at the default stroke of 2.
Goals: Apps, Chat and Projects tilt the same way and hold the tilt during hover or :focus-visible. Projects matches Chat's stroke weight. Reduced motion keeps the glyphs still.
Non-goals: Motion for the other sidebar entries (Memory, People, Settings, recent apps, Concierge) or a broader icon-system overhaul.
The PR's approach: It collapses sidebarIconMotion from "apps" | "chat" to "tilt" and tags all three entries in builtin-nav.ts. It replaces the keyframe plus the separate reduced-motion override with a single rule in globals.css wrapped in @media (prefers-reduced-motion: no-preference). It also drops the Projects-only stroke override in AppGrid.tsx. I checked the rest of the repo: no other code or tests reference data-motion="apps", data-motion="chat" or the removed keyframe. RecentAppsRail and ConciergeEntry use .rome-sidebar-icon without data-motion, so they are unaffected.
Alternatives considered:
- Do nothing. The inconsistency the PR describes stays.
- Keep the Apps keyframe "pop" but hold its end state. Retime the keyframe so it ends tilted (for example 0%→100% to
rotate(-7deg) scale(1.12)) and setanimation-fill-mode: forwards. This would hold the tilt, but removing:hoverdrops the animation, so the glyph would snap back on pointer exit instead of easing. That is worse than a transition, and Apps would still differ from the other two. - Tilt every
.rome-sidebar-link .rome-sidebar-iconby selector alone, withoutdata-motion. This is simpler in data terms, but it would also tilt Memory, People, Settings, recent-app artwork and Concierge rows. That breaks the "three primary entries" scope, and tilting colored app artwork is out of scope here. - Make tilt a boolean field (
sidebarIconTilt?: boolean). It is the same as the PR, just named differently. A one-member union keeps the door open for other motion kinds with no extra cost.
| Approach | Added complexity | Correctness/completeness | Blast radius | Reversibility | Maintenance | Effort |
|---|---|---|---|---|---|---|
PR: shared tilt transition, reduced-motion gate |
Net negative (removes keyframe and override) | Holds on hover and focus, eases out on exit, still under reduced motion | 3 nav entries | Fully reversible (CSS plus internal type) | One rule to tune | Done |
| Do nothing | None | Inconsistent glyph weight and motion stay | None | n/a | Two motion paths stay | None |
Keyframe with fill-mode: forwards |
Same as today | Holds, but snaps back on exit and Apps still differs | 1 entry | Reversible | Two motion paths | Low |
| Selector-only tilt for all rows | Lowest | Over-applies to rows and artwork outside scope | Whole sidebar | Reversible | Easy, but harder to opt rows out | Low |
There are no public API, schema or wire-format commitments here. sidebarIconMotion is an internal TypeScript field and data-motion is a private CSS hook, so every option can be undone.
Recommendation: The PR's approach fits best. It fixes the cause (a one-shot animation where a held state was needed), unifies two motion paths into one, and moves reduced-motion handling to a positive gate instead of an override. Updating DESIGN.md keeps the spec in sync.
One existing side effect to keep in mind: .rome-sidebar-icon[data-motion="tilt"] { transition: transform ... } is unlayered CSS, so it overrides the span's Tailwind transition-colors. The selected-row glyph color now changes instantly for Apps and Projects, as it already did for Chat. If you want the fade back, use transition: transform 150ms ease-out, color 150ms ease-out. This is optional and doesn't block the PR.
Verdict: APPROVE — Using one shared CSS transition under a prefers-reduced-motion: no-preference gate is the simplest correct fix, and every part of it is easy to revert.
No issues found. Code looks good!
Automated review by RomeOS Code Review · commit 762c401 · Full review history
yunfanye
left a comment
There was a problem hiding this comment.
Design & Alternatives review: ✅ APPROVE
Design analysis skipped: this is a small local change with no meaningful alternative design. Inspected the implementation and registry consumers; motion remains opt-in and disabled under reduced motion. No automated motion-specific tests were found, and browser checks were not rerun.
Verdict: APPROVE — The shared CSS tilt and removal of the Projects stroke override are the simplest fit for this localized change.
No issues found. Code looks good!
Automated review by RomeOS Code Review · commit 762c401 · Full review history
yunfanye
left a comment
There was a problem hiding this comment.
Code Review: ✅ APPROVE
Reviewed the full changed implementation and its consumers; no actionable issues found. Static checks passed. No targeted automated motion tests were found; browser and unit tests were not run because dependencies are absent.
Verdict: APPROVE — The focused change consistently applies the shared tilt while preserving reduced-motion behavior.
No issues found. Code looks good!
Automated review by RomeOS Code Review · commit 762c401 · Full review history
Why
The Projects glyph reads lighter than the Chat glyph. The Apps glyph returns to rest while the pointer still hovers over its row. Give the three primary sidebar entries the same hover response.
Invariants
Scope
Merge danger
A code revert restores the sidebar glyph weight and motion.
Evidence
main, Apps resets after 420 ms.Desktop (1280 × 900, Apps hovered)