bucket handling fixes

This commit is contained in:
2026-03-03 10:15:41 -06:00
parent 8020e16ca1
commit d9a2b05bb1
2 changed files with 45 additions and 28 deletions
+20
View File
@@ -43,6 +43,26 @@ 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);
});
return next;
});
lastInitialTags = [...initial];
});
// Reactive shorthand parsing
createEffect(() => {
const text = input();