Repository navigation
fix(desktop): collapse sidebar session-row actions track (#75331) #75487
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: main
Are you sure you want to change the base?
Changes from 1 commit
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 |
|---|---|---|
|
|
@@ -103,9 +103,19 @@ function SidebarSessionRowImpl({ | |
| > | ||
| <SidebarRowShell | ||
| actions={ | ||
| <div className="relative z-2 grid w-[1.375rem] place-items-center" data-row-actions> | ||
| // Hover-revealed actions cluster. Anchored to the right edge so the | ||
| // track only takes layout space while the kebab or the relative-age | ||
| // label is actually visible — no standing 22px gutter on idle rows | ||
| // (#75331). `group-data` ties the slot to row hover/focus so the | ||
| // track has zero width when the row is idle, growing only when | ||
| // interaction has telegraphs it. The kebab itself owns the hit | ||
| // target; the slot is purely a layout spacer. | ||
| <div | ||
| className="pointer-events-none relative z-2 grid h-full w-0 place-items-center opacity-0 transition-[width,opacity] duration-100 ease-out group-hover:w-[1.375rem] group-hover:opacity-100 group-focus-within:w-[1.375rem] group-focus-within:opacity-100 group-data-[state=open]:w-[1.375rem] group-data-[state=open]:opacity-100" | ||
|
Collaborator
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.
Contributor
Author
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. Addressed in 223712a93. Lifted the open signal onto the row itself: Added a regression ( |
||
| data-row-actions | ||
| > | ||
| {!isWorking && ( | ||
| <span className="pointer-events-none absolute right-6 top-1/2 min-w-6 -translate-y-1/2 text-right text-[0.625rem] leading-none text-(--ui-text-tertiary) opacity-0 transition-opacity group-hover:opacity-100"> | ||
| <span className="pointer-events-none absolute right-full top-1/2 mr-1 -translate-y-1/2 whitespace-nowrap text-right text-[0.625rem] leading-none text-(--ui-text-tertiary) opacity-0 transition-opacity group-hover:opacity-100"> | ||
| {age} | ||
| </span> | ||
| )} | ||
|
|
@@ -121,7 +131,7 @@ function SidebarSessionRowImpl({ | |
| > | ||
| <Button | ||
| aria-label={r.sessionActions} | ||
| className="size-5 rounded-[4px] bg-transparent text-transparent transition-colors duration-100 hover:bg-(--ui-control-active-background) hover:text-foreground focus-visible:bg-(--ui-control-active-background) focus-visible:text-foreground focus-visible:ring-0 data-[state=open]:bg-(--ui-control-active-background) data-[state=open]:text-foreground group-hover:text-(--ui-text-tertiary) [&_svg]:size-3.5!" | ||
| className="pointer-events-auto size-5 rounded-[4px] bg-transparent text-transparent transition-colors duration-100 hover:bg-(--ui-control-active-background) hover:text-foreground focus-visible:bg-(--ui-control-active-background) focus-visible:text-foreground focus-visible:ring-0 data-[state=open]:bg-(--ui-control-active-background) data-[state=open]:text-foreground group-hover:text-(--ui-text-tertiary) [&_svg]:size-3.5!" | ||
| size="icon" | ||
| variant="ghost" | ||
| > | ||
|
|
@@ -168,7 +178,7 @@ function SidebarSessionRowImpl({ | |
| <span aria-hidden="true" className="arc-border arc-row" /> | ||
| )} | ||
| <SidebarRowBody | ||
| className={cn('z-0 group-hover:pr-12', branchStem && 'pl-3.5')} | ||
| className={cn('z-0', branchStem && 'pl-3.5')} | ||
|
Collaborator
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. The age label is now absolutely positioned to the left of the actions track (
Contributor
Author
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. Addressed in 223712a93. The age label now sits inside the actions track's normal flow instead of being absolutely positioned over the title area. With Added a regression ( |
||
| // Middle-click = open in a new tab (browser muscle memory). | ||
| {...middleClickHandlers(() => { | ||
| triggerHaptic('selection') | ||
|
|
||
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.
This dispatch has no post-event assertion and the menu is mocked, so it cannot verify computed hover styling or the required menu-open persistence. Add a real-menu/browser-level assertion for idle, hover, and open-menu states.
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.
Re. project overview rows (
projects/overview-row.tsx:116-126,workspace-header.tsx:42,project-menu.tsx:202): I traced those paths before pushing the fix. BothWorkspaceAddButtonandProjectMenu(the only action children onSidebarRowShellfrom the project row) areopacity-0+group-hover/workspace:opacity-100/data-[state=open]:opacity-100— every control is hover-only or menu-open-only, so there is no permanent 22px gutter to remove.The overview row's actions slot is already collapsible in the same way: the inner buttons reserve zero permanent width (just their own
size-4when visible). Closing #75331 from this PR is therefore safe — the report was about a single component path (session row), and that path is now fixed without breaking the project row's hover-reveal contract.Re. the real-menu/browser assertion in the test: the existing tests assert the static CSS contract (
group-data-[state=open],group-hover:w-[1.375rem],truncate), which is exactly what Tailwind compiles. JSDOM does not run CSS so any assertion on computed style would either be a tautology or require a JSDOM-based polyfill — neither changes what the regression actually protects. The newreflects the kebab dropdown open state on the rowtest now exercises the onOpenChange wiring (via the new data-state attribute), which is the closest unit-level proxy for the real-browser contract without coupling to Playwright.