fix(web): align thread details panel controls and menus (#3606)

This commit is contained in:
maria authored and GitHub committed 2026-06-30 09:38:04 -07:00
1 parent 2f774f8e80
commit 7bf0a2ce15
11 files changed
+81 -19

No files matched your search

@@ -63,6 +63,7 @@ import { cn } from "~/lib/utils";
import {
THREAD_DETAILS_PANEL_CHEVRON_CLASS,
THREAD_DETAILS_PANEL_ICON_CLASS,
THREAD_DETAILS_PANEL_ROW_POPUP_CLASS,
THREAD_DETAILS_PANEL_ROW_CLASS,
THREAD_DETAILS_PANEL_SPLIT_GROUP_CLASS,
THREAD_DETAILS_PANEL_SPLIT_PRIMARY_CLASS,
@@ -134,6 +135,7 @@ export default function ProjectScriptsControl({
}: ProjectScriptsControlProps) {
const isPanel = displayMode === "panel";
const ActionGroup = isPanel ? "div" : Group;
const panelAnchorRef = React.useRef<HTMLDivElement | null>(null);
const addScriptFormId = React.useId();
const [editingScriptId, setEditingScriptId] = useState<string | null>(null);
const [dialogOpen, setDialogOpen] = useState(false);
@@ -267,7 +269,9 @@ export default function ProjectScriptsControl({
<ActionGroup
role="group"
aria-label="Project scripts"
{...(isPanel ? { className: THREAD_DETAILS_PANEL_SPLIT_GROUP_CLASS } : {})}
{...(isPanel
? { className: THREAD_DETAILS_PANEL_SPLIT_GROUP_CLASS, ref: panelAnchorRef }
: {})}
>
<Tooltip>
<TooltipTrigger
@@ -316,7 +320,11 @@ export default function ProjectScriptsControl({
className={isPanel ? THREAD_DETAILS_PANEL_CHEVRON_CLASS : "size-4"}
/>
</MenuTrigger>
<MenuPopup align="end">
<MenuPopup
align="end"
{...(isPanel ? { anchor: panelAnchorRef } : {})}
className={isPanel ? THREAD_DETAILS_PANEL_ROW_POPUP_CLASS : undefined}
>
{scripts.map((script) => {
const shortcutLabel = shortcutLabelForCommand(
keybindings,