Skip to content

refactor(ui): converge remaining sidebar row indicator sizes (#743) - #754

Merged
Astro-Han merged 5 commits into
mainfrom
refactor/ui-sidebar-indicator-sizes
Jul 12, 2026
Merged

Astro-Han merged 5 commits into
mainfrom
refactor/ui-sidebar-indicator-sizes

Conversation

@Astro-Han

Copy link
Copy Markdown
Contributor

Summary

Converge the remaining session-row indicator literals onto the spacing and control-height vocabularies: streaming-dot/unread 8px → var(--space-2), list-row-text min-height: 24px → var(--h-control-sm). The 14px status icon stays a documented dense exception.

Why

Follow-up to #738: the surrounding session-row indicator path still carried bare 8/14/24px that bypassed the spacing and control-height tokens, so the row could drift off-ruler. Refs #743.

Scope

  • .maka-list-row-streaming-dot width/height 8px → var(--space-2).
  • .maka-list-row-unread width/height 8px → var(--space-2).
  • .maka-list-row-text min-height: 24px → var(--h-control-sm).
  • .maka-list-row-status-icon width/height 14px kept, with a comment + the new contract pinning that one selector as the documented dense exception (--icon-size is 16px; 16px here would degrade row density).
  • Not extracted: a shared streaming/unread primitive. Evaluated — streaming-dot owns a pulse animation that overrides box-shadow per keyframe, and merging the selectors would change the CSS structure the density contract scans. Converging the literals already removes the off-ruler drift.

Verification

  • RED contract (sidebar-indicator-size-contract) pinning the three converged selectors + the 14px exception → GREEN.
  • npm run -w @maka/desktop test — 2324/2324 pass.
  • typecheck + test:checks — pass.
  • No visual change: 8px and 24px map to var(--space-2)/var(--h-control-sm) which resolve to the same px; streaming/unread/stale/active/reduced-motion states are untouched.

Impact

None — visual no-op refactor; no behavior, API, or migration change.

Reviewer notes

The 14px status-icon exception is the one judgment call: --icon-size (16px) is for chrome glyphs and would loosen the session row. Documented in the CSS comment + pinned by the contract so a new bare 14px elsewhere in the indicator path still needs its own exception.

Ready for review

  • Verification complete and current
  • Impact/compatibility/migration/docs/release-note needs addressed
  • Visual evidence: not applicable (visual no-op) — explained in Verification

The session-row indicator path used bare 8/14/24px literals that bypassed
the spacing and control-height vocabularies. Converge them onto tokens:

  .maka-list-row-streaming-dot  width/height 8px → var(--space-2)
  .maka-list-row-unread         width/height 8px → var(--space-2)
  .maka-list-row-text           min-height 24px → var(--h-control-sm)
  .maka-list-row-status-icon    width/height 14px → documented dense exception (kept)

The 14px status icon stays a documented exception: --icon-size is 16px
(chrome glyphs on nav/button icons), and 16px here would degrade the session
row's density. A comment on the rule + the new sidebar-indicator-size-
contract pin that one selector so a NEW bare 14px elsewhere in the
indicator path still needs its own exception.

Evaluated extracting a shared streaming/unread primitive (both repeat
width/height + border-radius + background + the 3px halo): not extracted —
streaming-dot owns a pulse animation that overrides box-shadow per keyframe,
and merging the selectors would change the CSS structure the density
contract scans. Converging the literals onto tokens already removes the
off-ruler drift the issue tracked; the duplication is geometry, not a
scale mismatch.

No visual change: 8px and 24px map to var(--space-2)/var(--h-control-sm)
which resolve to the same px. streaming/unread/stale/active/reduced-motion
states are untouched.

Refs #743
… indicators

Three follow-ups from the #743 codex review:

- P2 (status icon SVG): the 14px wrapper on .maka-list-row-status-icon never
  clipped the SVG — buttonVariants' [&_svg]:size-[var(--icon-size,1rem)] on
  the row's UiButton overrides the <Icon size=12> presentation attribute, so
  the SVG was always 16px. Removed the misleading 14px width/height; the icon
  now converges to var(--icon-size) (16px) like every other in-button glyph.
  No visual change (SVG was already 16px).
- P2 (contract scope): the contract only read four fixed selectors, so a new
  .maka-list-row-* bare-px indicator would not be caught. Now scans ALL
  .maka-list-row-* selectors for bare-px width/height/min-height with a
  negative case proving a new off-ruler indicator is flagged.
- P3 (text min-height): .maka-list-row-text used var(--h-control-sm), but it
  is a content min-height, not a control height — control-height-converge-
  contract reserves --h-control-* for interactive controls. Switched to
  var(--space-6) (same 24px, spacing ruler). No visual change.

streaming-dot/unread var(--space-2) is unchanged from the first commit.
…tor contract

Fresh-eye codex review follow-ups; the earlier "converge to 16px" (A) was
wrong on two counts, so this switches to B and tightens the contract.

- P2 (status icon): A violated docs/design-system.md §1.9 — dense-meta icons
  are call-site 12–14px, NOT --icon-size (16px, reserved for chrome/nav/button
  glyphs). The 16px came from a buttonVariants [&_svg] cascade leak (borrowing
  UiButton for its interaction contract), not a design intent. And A was not
  a visual no-op: removing the 14px wrapper grew the flex footprint 14→16px,
  shifting the title 2px. B restores the <Icon size={12}> intent via a local
  .maka-list-row-status-icon svg { width/height: var(--space-3) } override
  (unlayered, beats the utilities-layer buttonVariants). CDP-verified: svg
  computed 12×12, wrapper auto. Visual: status icon 16→12 (title shifts back).
- P2 (contract): the dot tests only filtered on width then read height from
  that block, so a height-only override (.maka-list-row-unread { height:
  var(--space-3) }) passed. assertExactlyOnce now counts width and height
  each independently, with a negative case proving a height-only override is
  caught.
- P3 (contract scope): the "all .maka-list-row-*" prefix scanner governed
  non-indicators (-main/-text/-menu-trigger) and false-positived on
  calc(...). Dropped; the four known indicators are pinned precisely instead.
…hten contract

Fresh-eye codex review follow-ups:

- P2 (status icon slot): the earlier B dropped the wrapper width/height, which
  shrank the status layout slot 14→12px and shifted the title 2px. Restore the
  14px wrapper (a documented dense-meta exception per docs/design-system.md
  §1.9) and keep the local 12px SVG override — the slot stays 14px (title does
  not move), the glyph is 12px (buttonVariants' 16px cascade leak is overridden).
  CDP-verified: wrapper 14×14, svg 12×12.
- P2 (contract false-green): decl() took only the first declaration, so a
  same-block `height: var(--space-2); height: var(--space-3)` passed while the
  browser used space-3. declarationsIn() now collects ALL declarations of a
  property across rest blocks, and assertExactlyOnce asserts exactly one — a
  same-block duplicate is caught, not just a second block.
- P3 (text min-height): dropped .maka-list-row-text min-height — the row's 32px
  control min-height + grid center own the height, so 24px was redundant.
…contract

Fresh-eye codex review follow-ups (round 3):

- P2 (selector list): restBlocks() matched the whole prelude, so a selector
  list like `.other, .maka-list-row-unread { height: ... }` bypassed the
  exactly-once check (the companion won the cascade). Split on top-level
  commas and match any selector equal to the subject; added a selector-list
  negative case proving it is caught.
- P2 (dense-meta tokenization): var(--space-3) bound the 12px dense-meta
  glyph to a spacing token, but docs/design-system.md §1.9 says only the
  chrome tier is tokenized — dense-meta stays call-site 12–14px and is NOT
  bound to a spacing token (a spacing-scale change could drift the icon).
  Switch the SVG override to bare 12px; the contract pins it as 12px. The
  14px wrapper slot stays bare too (same §1.9 dense-meta exception).
@Astro-Han
Astro-Han merged commit ebe0813 into main Jul 12, 2026
3 checks passed
@Astro-Han
Astro-Han deleted the refactor/ui-sidebar-indicator-sizes branch July 14, 2026 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant