Repository navigation
fix(capture): persist repeated captures in Live Preview tables - #471
Merged
Merged
Conversation
Deploying podnotes with
|
| Latest commit: |
ff4e973
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://36dae794.podnotes.pages.dev |
| Branch Preview URL: | https://fix-table-cell-capture.podnotes.pages.dev |
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.
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, withTMPDIR=/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:e2eAll 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 usehttp://podnotes.test:33494/feed.xml,Fixture Episode 1, and a template with links, pipes and a newline. After capture,dev:errorsreportsNo errors captured.Verification report and assertion logs with mutation scripts.
Every deliberately wrong implementation fails:
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.
tableCellWriterutility in CaptureService.ts that finds the nested cell editor viaeditorComponent.tableCell.editor, decodes escaped pipes before insertion, and falls back to the note editor when unavailable.editorTargetnow also considers the currently tracked active leaf, so captures work in the window before Obsidian emits an active-leaf-change event.editorComponent.tableCell.editorwhen a Live Preview cell is active; if Obsidian changes this internal structure,tableCellWriterreturns null and the note-editor fallback applies.Macroscope summarized ff4e973.