bucket handling fixes better

This commit is contained in:
2026-03-03 10:18:41 -06:00
parent d9a2b05bb1
commit 7ee6b795f7
2 changed files with 11 additions and 14 deletions
+2
View File
@@ -9,6 +9,8 @@ export const QuickEntry: Component = () => {
const [isOpen, setIsOpen] = createSignal(false); const [isOpen, setIsOpen] = createSignal(false);
// Autofill tags based on context when opening // Autofill tags based on context when opening
const initialTags = createMemo(() => { const initialTags = createMemo(() => {
if (!isOpen()) return [];
const tags: string[] = []; const tags: string[] = [];
const ctx = currentTaskContext(); const ctx = currentTaskContext();
+9 -14
View File
@@ -44,23 +44,18 @@ export const QuickEntryForm: Component<QuickEntryFormProps> = (props) => {
}); });
// Reactive sync from props (handles context changes while open) // Reactive sync from props (handles context changes while open)
let lastInitialTags: string[] = [];
createEffect(() => { createEffect(() => {
const initial = props.initialTags || []; const initial = props.initialTags || [];
if (initial.length > 0) {
setTags(prev => { setTags(prev => {
// 1. Identify context tags that were removed // Merge initial tags if not already present
const removed = lastInitialTags.filter(t => !initial.includes(t)); const next = [...prev];
// 2. Filter them out of the current tag list initial.forEach(t => {
let next = prev.filter(t => !removed.includes(t)); if (!next.includes(t)) next.push(t);
// 3. Add new context tags that aren't already present });
initial.forEach(t => { return next;
if (!next.includes(t)) next.push(t);
}); });
return next; }
});
lastInitialTags = [...initial];
}); });
// Reactive shorthand parsing // Reactive shorthand parsing