fix(ui): show full repo names and reopen the canvas menu at a new right-click

This commit is contained in:
sam committed 2026-10-24 21:46:12 +11:00
1 parent 15a9bcebdf
commit e428248a74
3 files changed
+13 -6

No files matched your search

+10 -3
View File
@@ -264,11 +264,18 @@ watch(anchor, async (node) => {
// The right-click menu opens at the pointer, for the step under it or for the
// canvas itself.
const menu = ref<{ open: boolean; x: number; y: number; step?: StepNodeData }>({ open: false, x: 0, y: 0 });
function openMenu(event: MouseEvent, step?: StepNodeData): void {
// A right-click while the menu is open closes it first, so it reopens at the
// new pointer instead of keeping its old anchor.
async function openMenu(event: MouseEvent, step?: StepNodeData): Promise<void> {
if (!editable.value) return;
event.preventDefault();
const box = container.value?.getBoundingClientRect();
menu.value = { open: true, x: event.clientX - (box?.left ?? 0), y: event.clientY - (box?.top ?? 0), step };
const next = { open: true, x: event.clientX - (box?.left ?? 0), y: event.clientY - (box?.top ?? 0), step };
if (menu.value.open) {
menu.value = { ...menu.value, open: false };
await nextTick();
}
menu.value = next;
}
function onNodeMenu({ event, node }: NodeMouseEvent): void {
if (node.type !== "step" || (node.data as StepNodeData).kind === "workflow") return;
@@ -326,7 +333,7 @@ const beforePath = computed(() => menuPath.value ? [...menuPath.value.slice(0, -
</DialogContent>
</Dialog>
<DropdownMenu v-model:open="menu.open">
<DropdownMenu v-model:open="menu.open" :modal="false">
<DropdownMenuTrigger as-child>
<span class="pointer-events-none absolute size-0" :style="{ left: `${menu.x}px`, top: `${menu.y}px` }" />
</DropdownMenuTrigger>