Repository navigation
feat(timestamps): capture timestamps as links on new installs - #369
Merged
Merged
Conversation
New installs default the timestamp template to "- {{linktime}} ", so a
captured timestamp is a playable obsidian://podnotes link. A missing
data.json now decodes from DEFAULT_SETTINGS.
Existing data keeps the template it has. PodNotes always writes the
template, so data without one is older or hand-edited and falls back to
the previous "- {{time}} " instead of the new default.
Refs #345
Vitest has no %p token, so these cases all shared one literal "%p" name. Lists that hold an empty array use explicit argument rows, because Vitest titles a bare [] in a mixed list as "undefined".
…oder LEGACY_TIMESTAMP_TEMPLATE has one reader, decodeTimestamp, so it becomes a module-local const there. The settingsMigrations header now says where the helpers run (the persistence codec) and when a stored value is rewritten.
Older data.json with a malformed timestamp.template decodes to the legacy plain template and reports the codec warning. Each row now states its exact warnings.
Existing installs keep their saved Capture timestamp format, which is often plain {{time}}.
The seeded default is already - {{linktime}} , so filling that value could never fail. Fill * {{linktime}} - instead and expect it in data.json and in the captured line.
Deploying podnotes with
|
| Latest commit: |
680ca82
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bf61af8a.podnotes.pages.dev |
| Branch Preview URL: | https://feat-timestamp-link-default.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
New installs now capture timestamps as playable links. The default
Capture timestamp formatchanges from- {{time}}to- {{linktime}}, so the first Capture Timestamp a new user runs inserts a link that seeks the player when clicked. Existing users keep the template saved in theirdata.json.Fixes #345
How it works:
DEFAULT_SETTINGS.timestamp.templateis- {{linktime}}.data.jsonis a new install. It decodes fromstructuredClone(DEFAULT_SETTINGS)and is saved as v2 right away, as before.data.jsonit wrote holdstimestamp.template, and no migration runs. Data without a template, or with a non-string one, is older or hand-edited. It falls back to the template it ran with,- {{time}}, so it doesn't switch to links behind the user's back.docs/docs/timestamps.mdnow tells existing users how to get links. The docs already called{{linktime}}the default.obsidian-e2e.config.mjsdefaultDatastays in sync withDEFAULT_SETTINGS, as enforced byscripts/e2e-config.test.ts.Also in this PR:
%pchanges to%oin fourit.eachtitles. Vitest 5 has no%p, so those titles printed a literal%p.loadSettingsnotes come out ofsrc/settingsMigrations.ts.Verification
Runtime: Obsidian 1.13.7 (installer 1.13.7), Linux, headless isolated worktree instance (
npm run start:e2e-obsidian). Feed: the verify-skill fixturePodNotes Fixtureserved athttp://127.0.0.1.nip.io:32045/feed.xml,Fixture Episode 1(60 s WAV). All steps go through the user path with.claude/skills/verify/ui.mjs: Settings to add the feed, the PodNotes view to play, the command palette forCapture Timestamp, and a click on the link in Reading view.Before, on master

1080891, new install. I deleted the vault'sdata.jsonand reloaded PodNotes. The plugin then held- {{time}}, and capture inserted plain text- 00:00:06.screen recording
After, new install. The runner rewrites

data.jsonfromdefaultDataon every start when the file is missing, so a cold start does not exercise the missing-file path. Instead, with Obsidian running, I set a custom format+ {{time}} customin Settings, ranplugin:disable id=podnotes, deleteddata.json(confirmed absent), and ranplugin:enable id=podnotes. The plugin loaded- {{linktime}}, not the custom value from memory, and wrote{"schemaVersion":2,"timestamp":{"template":"- {{linktime}} ","offset":0}}. After re-adding the fixture feed, capture inserted- [00:00:06](obsidian://podnotes?episodeName=Fixture%20Episode%201&url=...&time=6.195475). Clicking the link in Reading view moved playback from 16.35 s back to 9.02 s (api.currentTime, read about 3 s after the click), still onFixture Episode 1.screen recording of capture and click-to-seek
After, existing user. I took the

data.jsonwritten by master (- {{time}}, one saved feed), rebuilt with this branch, and reloaded. The template stayed- {{time}}in memory and on disk, and capture inserted plain- 00:00:06.Setting still applies. I filled

* {{linktime}} -in Settings > PodNotes. It was persisted todata.json, and capture inserted* [00:00:06](obsidian://podnotes?...&time=6.22399) -.dev:errorsreported no errors.Unit tests: new install (
nullandundefineddata, plus the firstsaveDatainloadSettings), a realistic v2data.jsonkeeping- {{time}}and a custom template through decode and encode, and v0 data with no timestamp setting, only an offset, or a non-string template. Each test was proven to fail on the defect it names by reverting the line it guards.Checks on head
680ca82, after mergingorigin/master(Node 22.23.2):npm run lint: passnpm run format:check: pass ("All matched files use the correct format.")npm run typecheck: passnpm run build: passnpm run test: pass (svelte-check 0 errors and 0 warnings; Vitest 80 files, 1209 tests)npm run docs:build: the samemkdocs build -f docs/mkdocs.yml -d site, run throughuv run --with-requirements docs/requirements.txtbecause mkdocs is not installed on this machine: passRelease impact
Settings: the default
timestamp.templatefor new installs changes to- {{linktime}}. No migration. Existingdata.jsonfiles keep their saved template, and data without one keeps- {{time}}. No storage schema, API, or URI changes.