fix(workspace-dropdown): move row paths from a second line to hover - #1185
Merged
Conversation
Externally-used and open-path rows rendered their filesystem path as a second line inside a row whose height is fixed at 32px by DROPDOWN_ITEM, so the text overflowed the row and pushed the list past its max height. The path now surfaces in a framed side tooltip on hover. Tooltip measures side placements from the enclosing role="menu" panel and offsets by DROPDOWN_PANEL.submenuGap, so the popup clears the panel border the way a submenu does instead of landing underneath it at a lower z-index. Rows carry role="menuitem" to keep the menu's children valid, and the local VIEWPORT_MARGIN constant is replaced by DROPDOWN_PANEL.viewportPadding.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Rows in the anchored workspace dropdown (the repo/workspace switcher on the
composer's
SessionInfoLine) rendered their filesystem path on a second line.useExternalRecentPathssetsdescriptionto the raw path, so every"Used elsewhere" row printed one, and
buildOpenPathItemdid the same for theopen-path row.
DROPDOWN_CLASSES.itemfixes the row at 32px (h-8 min-h-8), so a second lineoverflowed the row and pushed the list past its
LIST_MAX_HEIGHT. The row alsohad no way to show a long path in full — the panel is 320px wide.
Solution
The path moves out of the row and into a framed side tooltip on hover. A new
RowDetailTooltipwraps any row that has secondary text; rows without it renderbare.
RepoRowandOpenPathRowcollapse to a single truncating label, matchingWorkspaceRow, which puts all three row types back inside the token-fixed 32pxheight.
Placement is the load-bearing detail.
Tooltipmeasures side placements fromthe enclosing
[role="menu"]panel and offsets byDROPDOWN_PANEL.submenuGap,so the popup clears the panel border the same distance a submenu would. Without
that anchor the tooltip would be positioned against the row's inset rect and land
~2px inside the panel — and since
.native-tooltipis z-1060 against thepanel's z-10000, that overlap would be occluded. The panel therefore gains
role="menu"and the rowsrole="menuitem", matchingPortsStatusMenu(the same search-panel shape) and
AddActionsDropdown.Two related token adoptions in the same file: the local
VIEWPORT_MARGIN = 12is replaced by
DROPDOWN_PANEL.viewportPadding, and the removed second linetakes the arbitrary
text-[11px]with it.The tooltip carries the same content under the same condition as the old second
line — this relocates the information, it does not add or remove any.
Potential risks
hover. That is the intended trade (it was overflowing its row), but a
pointer-only affordance is worse for keyboard navigation: arrowing onto a row
does not open the tooltip. Keyboard users can still tell rows apart by name,
and the spotlight variant keeps its explicit "Show path" footer toggle.
Tooltipclamps ratherthan flips and the popup can land over the panel, where the z-index gap hides
it.
smartPlacementis on, so this needs a viewport narrower thanpanel + tooltip on both sides.
role="menu"+role="menuitem"is a net improvement over buttonsin a bare
div, butgetItemPropsstill setsaria-selected, whichmenuitemdoes not support. That attribute was already there (equallyunsupported on a bare
button), so this is pre-existing, not a regression;fixing it means touching the shared
useDropdownListNavigationused by tencomponents.
LIST_MAX_HEIGHT(360) andMIN_DROPDOWN_WIDTH(320) keeptheir local constants. The nearest tokens are 200 and 280, so adopting them
would resize the panel.
Verification
Run against this branch in an isolated worktree checked out at its own commit
(not the shared dirty checkout), with
node_modulessymlinked:npx tsc --noEmit --pretty false -p tsconfig.json— exit 0.npx vitest run --config config/vitest.config.ts src/scaffold/GlobalSpotlight— 28 files, 133 tests, all passing.
npx eslint src/scaffold/GlobalSpotlight/palettes/WorkspacePalette/— clean.npx prettier --checkon the changed file — clean.npm run check:test-placement— clean (the directory colocates tests, and thenew file is colocated).
New
WorkspaceDropdown.test.tscovers the three behaviours: the row renders itsname only and not the path, hovering reveals the path in a tooltip and leaving
dismisses it, and the row resolves to a
[role="menu"]ancestor so the tooltipcan clear the panel edge. Mutation-checked — restoring the second line, dropping
the tooltip, or removing
role="menu"fails all three.Not run / not applicable:
point, so the dropdown cannot be captured without a full app launch. The
hover behaviour is verified through jsdom rendering instead.
(temp index +
commit-tree) so the unrelated uncommitted work in the sharedcheckout could not enter it. Hooks were skipped, so typecheck, lint and tests
were run by hand as listed above. Note the hook's TypeScript gate cannot fail
a commit anyway (
TSC_OUTPUT=$(...) || truethen$?is always 0), so a greenhook would not have been evidence.
origin/develop(aa17dccd7). That commit's unused-exportsweep (
export interface WorkspaceDropdownPropstointerface ...) ispreserved rather than reverted — the local checkout predates it.