Skip to content

refactor: dropdown menus - #503

Open
Bohreromir wants to merge 7 commits into
mainfrom
refactor-488-dropdown-menus
Open

Bohreromir wants to merge 7 commits into
mainfrom
refactor-488-dropdown-menus

Conversation

@Bohreromir

@Bohreromir Bohreromir commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Description

This Pr makes dropdowns be dropdowns instead of floating context menus.
For this it extracts a shared component and fixes various smaller bugs.

Moved to the dropdown:

  • Storage: the connection menus in the sidebar and on the settings page, the Create menu and the operations panel. A connection menu opened from the keyboard no longer appears in the top-left corner.
  • Header: the language switcher and the user menu. The user menu now opens above the Trino editor's buttons instead of behind them.
  • Trino: the run mode menu.

Unpinning a location in the storage sidebar is a direct button instead of a menu with a single action.

Docs

Release note

Checklist

Author

  • AI review done, findings addressed
  • Tests added or updated
  • Changelog updated (if the repo keeps one)

Reviewer

  • Useful comments and logging
  • Docs added or updated per the style guide

Acceptance

  • Check for release notes and docs

The menu list of ContextMenu becomes MenuItems with arrow key
navigation, so the dropdowns for #488 can share it. The action type is
renamed to MenuAction. The title row moves out of the menu list, so the
arrow keys skip its close button.
Dropdown is a popover anchored to the button that opens it, positioned
with CSS anchor positioning and the existing script fallback for
browsers without it. It closes on Escape, an outside click and when the
focus moves out, and gives the focus back to the button when it closes
from inside. DropdownMenu shows a list of actions in it.

Part of #488.
The connection menus in the storage sidebar and on the settings page,
the Create menu and the operations panel now open as dropdowns anchored
to their button instead of as context menus or with their own click
catchers. A connection menu opened from the keyboard no longer appears
in the top-left corner. Unpinning a location is a direct button instead
of a menu with a single action.

Closes #488.
The language switcher, the user menu and the run mode menu open as
dropdowns like the storage menus. The user menu now opens above the
Trino editor's buttons instead of behind them. The run mode toggle
keeps its size while its menu is open, and its menu is as wide as the
button group again.

Part of #488.
The name and e-mail in the user menu were a title row in a DaisyUI menu,
so pressing them gave the name a near-black background behind dark
text. They are now a plain header above the menu list.
The menu takes its minimum width from the button group through a resize
observer, so it can lag a frame behind when the group changes size, e.g.
when a font loads. The test measured once and failed in CI.
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 68.63% 9473 / 13802
🔵 Statements 67.53% 12709 / 18818
🔵 Functions 69.46% 3075 / 4427
🔵 Branches 58.77% 5366 / 9129
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/lib/components/DateTimePicker.svelte 92.13% 68.51% 97.95% 90% 76, 93, 95-96, 98, 100, 102-103, 137, 150-151, 153-154, 225
src/lib/components/layout/header/LanguageSwitcher.svelte 79.62% 52.94% 77.27% 84.37% 23, 29-30, 59, 58, 80
src/lib/components/layout/header/UserMenu.svelte 88.57% 42.85% 100% 95.23% 38
src/lib/components/storage/BucketSelect.svelte 80.59% 55.88% 84.21% 72.6% 26, 39-43, 52-74, 156-158, 170, 131
src/lib/components/storage/explorer/FileExplorer.svelte 86.26% 64.54% 84.74% 86.33% 69, 77-81, 85, 105, 138-147, 152, 155, 330-331, 346-347, 420
src/lib/components/storage/explorer/OperationsButton.svelte 5.04% 3.12% 5.55% 6.6% 37-42, 45, 46, 48-49, 53, 54, 56-215, 177
src/lib/components/storage/explorer/StorageBreadcrumb.svelte 88.64% 72.02% 94.73% 84.14% 132, 183, 185, 187, 213-231, 312, 314, 335, 337, 403, 405, 355-356, 359, 362-364, 367, 436, 438, 454, 456, 496, 475-478, 606, 604
src/lib/components/storage/explorer/TabBar.svelte 59.52% 33.33% 65.51% 61.53% 33-37, 43-63, 116, 123-128, 162-164
src/lib/components/storage/modals/details/Treemap.svelte 0% 0% 0% 0% 15-228
src/lib/components/storage/sidebar/BucketList.svelte 82.12% 67.39% 83.87% 76.23% 34-35, 51-60, 67-84, 97, 113, 123, 125, 190, 206, 207, 209
src/lib/components/storage/sidebar/StorageConnectionSidebar.svelte 62.68% 23.52% 60.86% 57.6% 54-69, 85-87, 96-101, 105-116, 121-133, 142-154, 146, 160-159, 179-181, 268-280, 294, 304, 305, 322
src/lib/components/trino/RunButton.svelte 100% 88% 100% 100%
src/lib/components/ui/ContextMenu.svelte 96.51% 90.32% 96.29% 98.46% 12, 68, 138
src/lib/components/ui/Dropdown.svelte 95.31% 83.72% 100% 97.61% 81, 109, 151
src/lib/components/ui/DropdownMenu.svelte 100% 100% 100% 100%
src/lib/components/ui/MenuItems.svelte 96.77% 83.33% 87.5% 93.33% 49
src/lib/components/ui/menu-keyboard.ts 94.44% 84.61% 100% 100% 16
src/lib/components/ui/__tests__/DropdownMenuWrapper.svelte 100% 100% 100% 100%
src/lib/components/ui/__tests__/DropdownWrapper.svelte 100% 66.66% 100% 100%
src/routes/(app)/settings/connections/+page.svelte 0% 0% 0% 0% 18-182
Generated in workflow #1361 for commit 7f95b79 by the Vitest Coverage Report Action

@Bohreromir
Bohreromir marked this pull request as ready for review November 26, 2026 14:28
@Bohreromir Bohreromir moved this to Development: Waiting for Review in Stackable Engineering Nov 26, 2026
The menu list itself had the focus, which has no visible focus style,
so keyboard users could not see where they were. Opening the row menus
from the keyboard (#495) made this visible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development: Waiting for Review

Development

Successfully merging this pull request may close these issues.

Button-triggered menus should be dropdowns instead of contextmenus

1 participant