fix(web): align thread details panel controls and menus (#3606)
This commit is contained in:
1 parent
29cd06590a
commit
89ec767058
11 files changed
+81
-19
No files matched your search
@@ -38,6 +38,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,
|
||||
@@ -80,6 +81,7 @@ export default function ProjectScriptsControl({
|
||||
=======
|
||||
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);
|
||||
>>>>>>> abd5cc5ff8 (Map thread panel into title bar and sidebar)
|
||||
@@ -177,7 +179,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
|
||||
@@ -229,7 +233,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,
|
||||
|
||||
Reference in new issue
Block a user