fix reorder in virtual buckets, split view tags, editor/preview cleanup

- Fix card drag reorder in favorites/journal/current (filter logic
  now mirrors renderBoard)
- Split view shows tag-matched cards as own group alongside related
- Remove extract/tree-view buttons from detail preview (edit-only)
- Context menu tag input: Enter assigns tag directly
- Tag autocomplete closes on ESC/click-outside globally
- Close modal cleans up both autocomplete popups

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
thandClaude Opus 4.6 committed 2026-04-07 22:42:08 +02:00
1 parent 6855381d5c
commit 9018f09351
5 files changed
+90 -41

No files matched your search

+15 -7
View File
@@ -448,18 +448,26 @@ async function handleCardDrop(e, el, targetId) {
return;
}
// Compute new order
// Compute new order — must mirror renderBoard's filtering
let filtered;
if (state.activeGroup) {
const parent = state.cards.find(c => c.id == state.activeGroup);
filtered = parent ? sortedCards([parent, ...getChildren(parent.id)]) : [];
} else {
filtered = sortedCards(state.cards.filter(c => {
if (c.parent_id) return false;
if (state.activeBucket === 'none') return !c.bucket_id;
if (state.activeBucket !== 'all') return c.bucket_id == state.activeBucket;
return true;
}));
const root = state.cards.filter(c => !c.parent_id);
if (state.activeBucket === 'favorites') {
const favs = getFavorites();
filtered = sortedCards(root.filter(c => favs.includes(String(c.id))));
} else if (state.activeBucket === 'journal') {
filtered = root.filter(c => /^\d{4}-\d{2}-\d{2}/.test(c.title));
filtered.sort((a, b) => b.title.localeCompare(a.title));
} else if (state.activeBucket === 'none') {
filtered = sortedCards(root.filter(c => !c.bucket_id && !/^\d{4}-\d{2}-\d{2}/.test(c.title)));
} else if (state.activeBucket !== 'all' && state.activeBucket !== 'current') {
filtered = sortedCards(root.filter(c => c.bucket_id == state.activeBucket));
} else {
filtered = sortedCards(root);
}
}
const ids = filtered.map(c => String(c.id)).filter(i => i !== String(dragId));
ids.splice(wasBefore ? ids.indexOf(String(targetId)) : ids.indexOf(String(targetId)) + 1, 0, String(dragId));