Skip to content

fix(capture): persist repeated captures in Live Preview tables - #471

Merged
chhoumann merged 3 commits into
masterfrom
fix/table-cell-capture
Oct 14, 2026
Merged

chhoumann merged 3 commits into
masterfrom
fix/table-cell-capture

Conversation

@chhoumann

@chhoumann chhoumann commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

Repeated timestamp and segment captures now persist in the focused Live Preview table cell. All capture entry points use the cell's own editor, with pipes escaped and newlines flattened. Undo still requires the whole note to match the captured state and restores the exact saved text.

Obsidian asynchronously remaps outer-editor edits into a decoded cell document. Escaped pipes put those documents at different lengths, causing the second capture to fail with a RangeError. Undo extends the inverse start before the cell to avoid that remapping while preserving its end position. A player click also retains its note during Obsidian's deferred focus-change event.

Fixes #445

#390 was already fixed by #468 and closed with exact master-code references.

Verification

Verified on Linux in this worktree's isolated vault. The regression fails on master with a missing second capture and the reported RangeError. The fix passes repeated captures, full player, mini player, the registered MediaSession callback, pipe parity, paragraphs, Source mode, and exact Undo with wide columns, split views, closed tabs, intervening edits, and capture immediately after Undo. The headset check invokes its installed callback; physical hardware was not tested.

Commands run with Node v22.23.2 through fnm exec --using 22, with TMPDIR=/data/home/tmp/podnotes-note2:

npm run lint
npm run format:check
npm run typecheck
npm run build
npm run test
npm run test:tooling
npm run docs:build
npm run test:e2e
npm run size
PODNOTES_OBSIDIAN_APP=/opt/Obsidian/obsidian npm run test:e2e

All commands pass on the final head. The application suite passes 2,547 tests and the tooling suite passes 13 tests. The docs build checks 18 pages and all 112 legacy fragments. An independent verifier passes all 186 E2E tests in 24 files on fresh vaults in both Obsidian 1.14.4 and 1.13.7, including all ten table-capture cases. Both instances are stopped.

The automated fixture is Table capture podcast / Table episode, paused at 30 seconds. Screenshots use http://podnotes.test:33494/feed.xml, Fixture Episode 1, and a template with links, pipes and a newline. After capture, dev:errors reports No errors captured.

Verification report and assertion logs with mutation scripts.

Before After
Only the first capture persists All three captures persist

Every deliberately wrong implementation fails:

Mutation Failing test
Write through the outer editor Repeated captures, unit and real Obsidian
Send escaped Markdown straight to the cell Cell text and pipe parity, unit and real Obsidian
Undo with a narrow inverse Exact Undo, unit and real Obsidian with a wide column
Extend the inverse end to the row boundary Real Obsidian capture immediately after Undo
Ignore the pending active leaf Unit capture during a deferred focus-change event
Drop the writer's receiver Unit cell capture
Omit the null guard Unit paragraph capture
Strip all backslashes before pipes Unit pipe parity

Production main.js: 311,433 raw bytes (+333), 98,473 gzip at level 9 (+128). The gzip limit remains 100,000 bytes, with 1,527 bytes free.

Release impact

None for settings, storage, public API or URI behavior. The cell editor is a private Obsidian API, checked on both supported runtime lines.

Docs at release

In docs/src/content/docs/timestamps.md, expand the table-cell bullet under Limits of capture and links to say: "In Source mode and Live Preview, repeated timestamp and range captures stay in the selected table cell. PodNotes escapes pipe characters and turns line breaks into spaces. The capture notice's Undo restores the note only while its entire contents still match the captured state."

Note

Fix repeated timestamp captures in Live Preview table cells

Previously, captures made while a Live Preview table cell editor was active did not persist correctly to the note. Timestamp captures now detect the table-cell editor and insert text through it, letting Obsidian write the properly escaped form back into the note.

  • Adds a tableCellWriter utility in CaptureService.ts that finds the nested cell editor via editorComponent.tableCell.editor, decodes escaped pipes before insertion, and falls back to the note editor when unavailable.
  • editorTarget now also considers the currently tracked active leaf, so captures work in the window before Obsidian emits an active-leaf-change event.
  • Undo for table-cell captures restores from the containing line boundary, and conflicting edits block the restore with a refusal notice.
  • Adds unit tests with a reusable fake-editor mock in captureEditor.ts and end-to-end coverage in table-cell-capture.test.ts for repeated captures, pipe escaping, split panes, tab-state changes, and Source mode.
  • Behavioral Change: captures that previously wrote through the note editor's selection now route through the undocumented editorComponent.tableCell.editor when a Live Preview cell is active; if Obsidian changes this internal structure, tableCellWriter returns null and the note-editor fallback applies.

Macroscope summarized ff4e973.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Deploying podnotes with  Cloudflare Pages  Cloudflare Pages

Latest commit: ff4e973
Status: ✅  Deploy successful!
Preview URL: https://36dae794.podnotes.pages.dev
Branch Preview URL: https://fix-table-cell-capture.podnotes.pages.dev

View logs

@chhoumann
chhoumann merged commit 311fe48 into master Oct 14, 2026
16 checks passed
@chhoumann
chhoumann deleted the fix/table-cell-capture branch October 14, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repeated captures into a Live Preview table cell fail with a CodeMirror RangeError

1 participant