From 124917968e6777870754a827b179543c6018f76d Mon Sep 17 00:00:00 2001 From: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Date: Tue, 22 Sep 2026 00:34:05 -0700 Subject: [PATCH] refactor(web): one minimum width for menus, three widths for popovers MenuPopup decided whether to apply its minimum width by scanning the incoming className for w-/min-w- tokens, and 37 menus picked widths from fourteen values. Menus size to their content; they now share one minimum (10rem) and a viewport cap, and no width prop. Popovers hold prose and forms, so a fixed width is real: width="sm|md|lg" (16, 20, 24rem). Select lists match their trigger, as SelectPopup already does. Visible effect: menus that had forced a width of 14-24rem now fit their content from a 10rem floor; popovers snap to the nearest of three widths (e.g. 18rem becomes 20rem, 28rem becomes 24rem); the keybinding selects match their trigger instead of a fixed floor. Co-Authored-By: Claude Fable 5 --- apps/web/src/browser/BrowserDeviceToolbar.tsx | 2 +- apps/web/src/components/BranchToolbar.tsx | 2 +- apps/web/src/components/DiffPanel.tsx | 4 ++-- apps/web/src/components/GitActionsControl.tsx | 6 ++--- apps/web/src/components/LegacySidebar.tsx | 2 +- .../src/components/ProjectScriptsControl.tsx | 4 +--- apps/web/src/components/RightPanelTabs.tsx | 10 ++------- apps/web/src/components/Sidebar.tsx | 2 +- .../components/chat/AssistantCitationChip.tsx | 2 +- apps/web/src/components/chat/ChatHeader.tsx | 1 - .../chat/ComposerPendingApprovalActions.tsx | 7 +----- .../components/chat/ContextWindowMeter.tsx | 3 ++- .../src/components/chat/DraftHeroHeadline.tsx | 2 +- .../src/components/chat/MessagesTimeline.tsx | 3 ++- apps/web/src/components/chat/OpenInPicker.tsx | 2 +- .../chat/SnapShotAttachmentDetails.tsx | 2 +- .../chat/useAutoBalanceUpdateBanner.tsx | 2 +- apps/web/src/components/contextChipParts.tsx | 3 ++- .../components/device/DeviceToolVersions.tsx | 2 +- .../src/components/files/FileBreadcrumbs.tsx | 1 - .../components/preview/PreviewMoreMenu.tsx | 4 ++-- .../pullRequest/PullRequestChecksPopover.tsx | 2 +- .../pullRequest/PullRequestCodeTab.tsx | 2 +- .../pullRequest/PullRequestComposer.tsx | 2 +- .../pullRequest/PullRequestDetailPanel.tsx | 4 ++-- .../pullRequest/PullRequestListFilters.tsx | 8 +++---- .../pullRequest/PullRequestReactions.tsx | 2 +- .../pullRequest/PullRequestStackMenu.tsx | 2 +- .../pullRequest/PullRequestStackPopover.tsx | 1 - .../settings/ConnectionsSettings.tsx | 4 ++-- .../settings/EnvironmentIconPicker.tsx | 2 +- .../settings/IntegrationsSettings.tsx | 6 ++--- .../settings/KeybindingsSettings.tsx | 22 ++++--------------- .../settings/ProjectActionsSettings.tsx | 2 +- .../settings/ProviderInstanceCard.tsx | 6 +---- .../settings/SettingInheritance.tsx | 2 +- .../settings/SettingsBreadcrumb.tsx | 4 +--- .../components/sidebar/SidebarUpdatePill.tsx | 2 +- apps/web/src/components/ui/menu.tsx | 10 ++------- apps/web/src/components/ui/popover.tsx | 12 ++++++++++ apps/web/src/components/usage/UsagePage.tsx | 2 +- .../components/usage/UsagePriceOverrides.tsx | 2 +- apps/web/src/routes/_chat.pull-requests.tsx | 2 +- 43 files changed, 69 insertions(+), 98 deletions(-) diff --git a/apps/web/src/browser/BrowserDeviceToolbar.tsx b/apps/web/src/browser/BrowserDeviceToolbar.tsx index e8ad80b597ba..cf78e5095a38 100644 --- a/apps/web/src/browser/BrowserDeviceToolbar.tsx +++ b/apps/web/src/browser/BrowserDeviceToolbar.tsx @@ -197,7 +197,7 @@ export function BrowserDeviceToolbar({ > - + Responsive Standard diff --git a/apps/web/src/components/BranchToolbar.tsx b/apps/web/src/components/BranchToolbar.tsx index ffc89c33e794..607236f2d63b 100644 --- a/apps/web/src/components/BranchToolbar.tsx +++ b/apps/web/src/components/BranchToolbar.tsx @@ -217,7 +217,7 @@ const MobileRunContextSelector = memo(function MobileRunContextSelector({ {triggerContent} - + {showEnvironmentPicker && availableEnvironments && onEnvironmentChange ? ( <> diff --git a/apps/web/src/components/DiffPanel.tsx b/apps/web/src/components/DiffPanel.tsx index 2a598ff12928..ac8623067abe 100644 --- a/apps/web/src/components/DiffPanel.tsx +++ b/apps/web/src/components/DiffPanel.tsx @@ -678,7 +678,7 @@ export default function DiffPanel({ {selectedScopeLabel} - + Working tree @@ -692,7 +692,7 @@ export default function DiffPanel({ Turn - + {orderedTurnDiffSummaries.map((summary) => { const turnCount = diff --git a/apps/web/src/components/GitActionsControl.tsx b/apps/web/src/components/GitActionsControl.tsx index 841adf2fcbb3..4f461ce21cfd 100644 --- a/apps/web/src/components/GitActionsControl.tsx +++ b/apps/web/src/components/GitActionsControl.tsx @@ -1793,7 +1793,7 @@ export default function GitActionsControl({ Git actions - {gitItems} + {gitItems} ) @@ -1859,9 +1859,7 @@ export default function GitActionsControl({ >