bucket handling fixes
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user