Skip to content

fix(web): stop session row from shifting on hover#1319

Merged
wbxl2000 merged 1 commit into
mainfrom
fix/web-session-row-hover
Jul 2, 2026
Merged

fix(web): stop session row from shifting on hover#1319
wbxl2000 merged 1 commit into
mainfrom
fix/web-session-row-hover

Conversation

@wbxl2000

@wbxl2000 wbxl2000 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

No linked issue — small sidebar polish fix.

Problem

Hovering a session row in the sidebar made the row reflow: the status badges (Answer / Approve / Stopped) shifted sideways and the session title's truncation changed by a few characters, producing visible jitter. It was most noticeable on rows carrying a pending badge.

Root cause: on hover the row used display:none to remove the relative time and appended the kebab () at the end. The time is variable-width (2h / 5m / just now …) while the kebab is a fixed 26px, so the right-hand region changed width between rest and hover.

What changed

  • Put the relative time and the kebab in a single inline-grid cell (grid-area: 1/1) and swap them with visibility instead of display:none. The slot width is now max(time width, 26px) in both states, so the right region's total width is constant across hover — badges and the title no longer reflow.
  • A session awaiting an answer still hides the time on hover (the slot shows only the kebab).
  • Documented the rule in the design system (§07 Session row → "Trailing action slot"), including the visibility-over-display:none rationale.

Verified with a side-by-side interactive demo (rest vs. hover, with layout boxes showing the badge/title stay put); check:style and typecheck pass.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works. — N/A: this is a layout-only change and the web package has no component tests; verified interactively with a side-by-side demo.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update. — No user-facing CLI doc change; the in-repo design system is updated in this PR.

The session row swapped the relative time for the kebab on hover using display:none, which dropped the time from layout and appended the kebab at the end. Because the time is variable-width (2h / 5m / just now) and the kebab is a fixed 26px, the right region reflowed: status badges shifted and the title's truncation changed, causing visible jitter.

Place the time and kebab in one inline-grid cell (grid-area:1/1) and swap them via visibility instead, so the slot width stays max(time width, 26px) across hover. The badges and title no longer reflow. Documented in the design system (section 07 Session row) as a trailing action slot rule.
@changeset-bot

changeset-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a1a9aba

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 2, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@a1a9aba
npx https://pkg.pr.new/@moonshot-ai/kimi-code@a1a9aba

commit: a1a9aba

@wbxl2000 wbxl2000 merged commit e8ab7ca into main Jul 2, 2026
10 checks passed
@wbxl2000 wbxl2000 deleted the fix/web-session-row-hover branch July 2, 2026 12:40
@github-actions github-actions Bot mentioned this pull request Jul 2, 2026
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