Skip to content

Navigation Menu

Sign in
Sign up

fix(action-items): treat <details> blocks as archive, not live work - #98

Merged
jordanrburger merged 1 commit into
main from
claude/scout-action-items-parsing-9537d3
Sep 3, 2026
Merged

fix(action-items): treat <details> blocks as archive, not live work #98
jordanrburger merged 1 commit into
main from
claude/scout-action-items-parsing-9537d3

Conversation

@jordanrburger

@jordanrburger jordanrburger commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

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

ActionItemsParser had 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 — to section.bullets, which SectionView.focus draws one numbered row per. Archived - [x] lines were parsed as live tasks.

It compounded, because each run wraps the previous focus in another <details>:

day focus rows <details> blocks
08-26 20 2
08-28 41 4
08-30 70 6
08-31 122 12
09-01 174 16
09-02 203 19

The fix

Parse <details> regions into ActionSection.CollapsedGroup rather 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 before after (live) preserved in archive
💡 Today's Focus 203 rows 7 175 bullets in 3 groups
🔴 Urgent 170 tasks 46 124 tasks in 1 group

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

  1. The tags are unbalanced — 26 opens against 24 closes. A plain depth counter would treat everything after the orphan as archived, so regions force-close at the next ## heading.
  2. <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

  • Superseded meeting tables stacked below today's, because tables were collected at section level regardless of region. MeetingsTableView now takes tables: so a group can reuse it.
  • The focus renderer counted rows itself over lines that already carried 1. , printing "1 1. ..." — and numbering the lede paragraph and the ⏸️ Verified negatives footer as if they were ranked items. ActionItemsParser.focusOrdinal now 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

  • 15 new tests in 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.
  • Full suite: 513 tests in 93 suites pass on platform=macOS, including the three-repo ParserContractTests corpus guard (the corpus is untouched).
  • Verified end-to-end by parsing all eight of the local vault's real daily files.

🤖 Generated with Claude Code

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>
jordanrburger merged commit 12f1def into main Sep 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /