e.stopPropagation()}
+ onPointerDown={e => e.stopPropagation()}
+ >
+
setName(e.target.value)}
+ className="h-7 text-xs font-mono"
+ maxLength={30}
+ autoFocus
+ onKeyDown={e => {
+ e.stopPropagation();
+ if (e.key === 'Enter') { e.preventDefault(); submit(); }
+ if (e.key === 'Escape') { e.preventDefault(); onCancel(); }
+ }}
+ />
+
+ {LABEL_COLORS.map(c => (
+
+
+
+
+
+
+ );
+}
diff --git a/frontend/src/components/sidebar/StackContextMenu.tsx b/frontend/src/components/sidebar/StackContextMenu.tsx
index c5c5e047..e79be42c 100644
--- a/frontend/src/components/sidebar/StackContextMenu.tsx
+++ b/frontend/src/components/sidebar/StackContextMenu.tsx
@@ -1,13 +1,15 @@
-import type { ReactNode } from 'react';
-import { Check } from 'lucide-react';
+import { useState, type ReactNode } from 'react';
+import { Check, Plus } from 'lucide-react';
import {
ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuSeparator,
ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger,
} from '@/components/ui/context-menu';
import { LabelDot } from '@/components/LabelPill';
+import { MAX_LABELS_PER_NODE } from '@/components/label-types';
import { cn } from '@/lib/utils';
import type { MenuGroup, MenuItem, StackMenuCtx } from './sidebar-types';
import { useStackMenuItems } from '@/hooks/useStackMenuItems';
+import { LabelInlineCreateForm } from './LabelInlineCreateForm';
interface StackContextMenuProps {
file: string;
@@ -27,32 +29,51 @@ function GroupHeader({ id }: { id: string }) {
}
function LabelsSub({ item, ctx }: { item: MenuItem; ctx: StackMenuCtx }) {
+ const [creating, setCreating] = useState(false);
return (
-