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);
// Autofill tags based on context when opening
const initialTags = createMemo(() => {
if (!isOpen()) return [];
const tags: string[] = [];
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)
let lastInitialTags: string[] = [];
createEffect(() => {
const initial = props.initialTags || [];
setTags(prev => {
// 1. Identify context tags that were removed
const removed = lastInitialTags.filter(t => !initial.includes(t));
// 2. Filter them out of the current tag list
let next = prev.filter(t => !removed.includes(t));
// 3. Add new context tags that aren't already present
initial.forEach(t => {
if (!next.includes(t)) next.push(t);
if (initial.length > 0) {
setTags(prev => {
// Merge initial tags if not already present
const next = [...prev];
initial.forEach(t => {
if (!next.includes(t)) next.push(t);
});
return next;
});
return next;
});
lastInitialTags = [...initial];
}
});
// Reactive shorthand parsing