-
Notifications
You must be signed in to change notification settings - Fork 2
fix(action-items): treat <details> blocks as archive, not live work - #98
Merged
Merged
fix(action-items): treat <details> blocks as archive, not live work #98jordanrburger merged 1 commit into
jordanrburger merged 1 commit into
Conversation
Today's Focus rendered 203 numbered rows, eight of which read `</details>`, and 🔴 Urgent showed 170 tasks when only 46 were live. Root cause: `ActionItemsParser` had no branch for HTML `<details>` blocks. The sessions wrap superseded focus lists and parked run-groups in `<details><summary>...</summary>` so Obsidian collapses them; the parser fell through to the paragraph path and appended every line inside — the bare tag lines included — to `section.bullets`, which the focus renderer draws one numbered row per. Archived `- [x]` lines were parsed as live tasks. It compounded: each run wraps the previous focus in another `<details>`, so the row count climbed 20 → 41 → 56 → 70 → 122 → 174 → 203 over eight days. Parse `<details>` regions into `ActionSection.CollapsedGroup` instead — archived content is history, but not disposable (one Parked block held 124 open rows under the summary "Expand to work them"), so it keeps its tasks, bullets and tables and renders behind a disclosure below the live list. On the real file: Focus 203 → 7 live rows, Urgent 170 → 46, with all 124 parked rows preserved and still actionable. The urgent menu-bar badge and every section count now see live work only. Two properties of the real files drive `HTMLDetailsScanner`: - The tags are unbalanced (26 opens against 24 closes), so an orphan must not swallow the rest of the file — regions force-close at the next `## `. - `<details>` also appears as prose inside backticks when the run notes discuss the markup, so inline-code spans are masked before scanning. Also fixes two adjacent defects the same section surfaced: superseded meeting tables stacked below today's, and the focus renderer counted rows itself over lines that already carried `1. `, printing "1 1. ..." and numbering the lede paragraph as if it were a ranked item. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
Today's Focus showed 203 numbered rows, eight of them reading
</details>, and 🔴 Urgent showed 170 tasks when only 46 were live.Root cause
ActionItemsParserhad no branch for HTML<details>blocks.The action-items sessions wrap superseded focus lists and parked run-groups in
<details><summary>...</summary>so Obsidian collapses them. The parser fell through to its paragraph path and appended every line inside — the bare tag lines included — tosection.bullets, whichSectionView.focusdraws one numbered row per. Archived- [x]lines were parsed as live tasks.It compounded, because each run wraps the previous focus in another
<details>:<details>blocksThe fix
Parse
<details>regions intoActionSection.CollapsedGrouprather than into the live lists. Archived content is history, but it is not disposable — one Parked block held 124 open rows under the summary "Expand to work them" — so a group keeps its tasks, bullets and tables and renders behind a disclosure below the live list, still fully actionable.Measured on a real day's file:
Section counts, the search/status filter, the board, and the urgent menu-bar badge now all see live work only.
Two properties of the real files that shape
HTMLDetailsScanner##heading.<details>also appears as prose, inside backticks, where the run notes discuss the markup itself. Inline-code spans are masked before scanning (only<is rewritten, to a same-width character, so ranges stay index-compatible with the original).Two adjacent defects the same section surfaced
MeetingsTableViewnow takestables:so a group can reuse it.1., printing "1 1. ..." — and numbering the lede paragraph and the ⏸️ Verified negatives footer as if they were ranked items.ActionItemsParser.focusOrdinalnow splits the source ordinal; prose renders as prose.Archive rows are deliberately not multi-selectable: the selectable set derives from
section.tasks, so a checked archive row would be reconciled away on the next reparse and silently skipped by Copy — and "Select all" sweeping a 124-row parked block into a copy isn't what the button means.Testing
CollapsedDetailsTests/FocusOrdinalTests— tag lines never becoming content, nested flattening, the unbalanced-tag and inline-code traps, one-line and summary-less regions, archived tables, and id stability/collision.platform=macOS, including the three-repoParserContractTestscorpus guard (the corpus is untouched).🤖 Generated with Claude Code