Showing the changes to apps/web/src/components/ProjectScriptsControl.tsx (1 of 11 files). Show all
Unified · Split
| @@ -63,6 +63,7 @@ import { cn } from "~/lib/utils"; · 62 unmodified lines | ||
| 63 | 63 | import { |
| 64 | 64 | THREAD_DETAILS_PANEL_CHEVRON_CLASS, |
| 65 | 65 | THREAD_DETAILS_PANEL_ICON_CLASS, |
| 66 | + THREAD_DETAILS_PANEL_ROW_POPUP_CLASS, | |
| 66 | 67 | THREAD_DETAILS_PANEL_ROW_CLASS, |
| 67 | 68 | THREAD_DETAILS_PANEL_SPLIT_GROUP_CLASS, |
| 68 | 69 | THREAD_DETAILS_PANEL_SPLIT_PRIMARY_CLASS, |
| @@ -134,6 +135,7 @@ export default function ProjectScriptsControl({ · 65 unmodified lines | ||
| 134 | 135 | }: ProjectScriptsControlProps) { |
| 135 | 136 | const isPanel = displayMode === "panel"; |
| 136 | 137 | const ActionGroup = isPanel ? "div" : Group; |
| 138 | + const panelAnchorRef = React.useRef<HTMLDivElement | null>(null); | |
| 137 | 139 | const addScriptFormId = React.useId(); |
| 138 | 140 | const [editingScriptId, setEditingScriptId] = useState<string | null>(null); |
| 139 | 141 | const [dialogOpen, setDialogOpen] = useState(false); |
| @@ -267,7 +269,9 @@ export default function ProjectScriptsControl({ · 127 unmodified lines | ||
| 267 | 269 | <ActionGroup |
| 268 | 270 | role="group" |
| 269 | 271 | aria-label="Project scripts" |
| 270 | − {...(isPanel ? { className: THREAD_DETAILS_PANEL_SPLIT_GROUP_CLASS } : {})} | |
| 272 | + {...(isPanel | |
| 273 | + ? { className: THREAD_DETAILS_PANEL_SPLIT_GROUP_CLASS, ref: panelAnchorRef } | |
| 274 | + : {})} | |
| 271 | 275 | > |
| 272 | 276 | <Tooltip> |
| 273 | 277 | <TooltipTrigger |
| @@ -316,7 +320,11 @@ export default function ProjectScriptsControl({ · 42 unmodified lines | ||
| 316 | 320 | className={isPanel ? THREAD_DETAILS_PANEL_CHEVRON_CLASS : "size-4"} |
| 317 | 321 | /> |
| 318 | 322 | </MenuTrigger> |
| 319 | − <MenuPopup align="end"> | |
| 323 | + <MenuPopup | |
| 324 | + align="end" | |
| 325 | + {...(isPanel ? { anchor: panelAnchorRef } : {})} | |
| 326 | + className={isPanel ? THREAD_DETAILS_PANEL_ROW_POPUP_CLASS : undefined} | |
| 327 | + > | |
| 320 | 328 | {scripts.map((script) => { |
| 321 | 329 | const shortcutLabel = shortcutLabelForCommand( |
| 322 | 330 | keybindings, |