Skip to content

feat(vault): audio bookmarks for VaultPlayerScreen - #179

Merged
libravault-xyz merged 1 commit into
devfrom
feature/vault-player-bookmarks
Aug 19, 2026
Merged

libravault-xyz merged 1 commit into
devfrom
feature/vault-player-bookmarks

Conversation

@claude

@claude claude Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds bookmark support to VaultPlayerScreen/VaultPlayerViewModel (vault-native audio playback), which was deliberately left out of the PR that added bookmarks/highlights to the vault-native EPUB/PDF reader (#171/#175).

  • VaultPlayerViewModel now holds a VaultStore reference (same pattern as VaultReaderViewModel), seeds a bookmarks: StateFlow<List<VaultBookmark>> from the manifest entry on load, and exposes addBookmark/removeBookmark/updateBookmarkNote/seekToBookmark.
  • addBookmark uses the "ms:N" positionRef convention Bookmark.positionRef/VaultBookmark.positionRef already document for audio, fed from uiState.positionMs (the same value the seek bar displays) rather than reading player.currentPosition directly — this keeps the write path testable without a real ExoPlayer, matching this file's existing "pre-playback paths only" JVM-test constraint.
  • VaultPlayerScreen gets the same add-bookmark/show-bookmarks icon pair as VaultReaderScreen, and reuses VaultBookmarksSheet unchanged in shape (local showBookmarksSheet remembered state, same as the reader screen).
  • VaultBookmarksSheet's sort key and label formatting gained an "ms:" branch (mm:ss / h:mm:ss, matching feature:player's own formatting) so unlabeled audio bookmarks sort and display correctly — previously they'd have sorted last and printed the raw "ms:12345" string.
  • Updated VaultBookmark.positionRef's doc comment in core/vaultstore/VaultManifest.kt to mention the "ms:N" convention.

Risk callout

This touches core/vaultstore/**, which is on agent-policy.yml's sensitive_paths list — it's a single-line doc-comment update (positionRef KDoc), no logic change, but classify_pr_risk.py will still force risk:high on this PR per policy. No new storage/schema work — VaultStore.addBookmark/removeBookmark/updateBookmarkNote already existed and are unchanged.

No new dependencies, no network calls.

Test plan

  • ./gradlew :feature:vault:testDebugUnitTest — green, including new VaultPlayerViewModelTest bookmark cases (add/remove/update-note via the store-only "unknown fileId" pre-playback path, seekToBookmark ms-parsing) and a new VaultBookmarksSheetUiTest case for the "ms:" label.
  • ./gradlew :core:vaultstore:testDebugUnitTest — green (doc-comment-only change there).
  • Manual verification in a running app (not done in this pass — no device/emulator available in this environment).

Closes #177.

@claude claude Bot added the status:needs-qa PR open, awaiting qa-agent verification label Aug 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: PASSED

✅ iOS Simulator Build & Unit Tests - success
✅ Android Core Modules - success

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

Copy link
Copy Markdown
Collaborator

Automated pipeline health check (2026-08-17): This PR has been sitting on status:needs-qa since 2026-08-15 15:21 UTC (~53h) with only the informational build-status comment — no QA-agent run has ever posted a verdict.

Confirmed via git diff --name-only origin/dev origin/feature/vault-player-bookmarks -- .github/workflows/: this branch's copies of android-tts-audio-test.yml, dev-agent.yml, ios-app-build.yml, jvm-tests.yml, pr-intake.yml, principal-review.yml, qa-agent.yml, and ui-tests.yml have all drifted from dev (merge-base 0c2300a vs current dev tip 06e54d0). This is the same stale-branch/OIDC-validation-failure pattern tracked in #254 — I also find zero qa-agent.yml runs in the workflow history for this branch, consistent with the token exchange being silently rejected before the agent step ever ran.

Since this PR touches core/vaultstore/** (a sensitive_paths entry in .github/agent-policy.yml), this routine won't rebase it automatically. Recommend a human rebase dev into this branch and re-apply status:needs-qa, or review directly.


Generated by Claude Code

@libravault-xyz
libravault-xyz force-pushed the feature/vault-player-bookmarks branch from 27c2638 to a49f052 Compare August 18, 2026 05:35
@libravault-xyz libravault-xyz added status:needs-qa PR open, awaiting qa-agent verification and removed status:needs-qa PR open, awaiting qa-agent verification labels Aug 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: PASSED

✅ iOS Simulator Build & Unit Tests - success
✅ Android Core Modules - success

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

Copy link
Copy Markdown
Collaborator

Automated pipeline health check — corrected diagnosis, a new gap found (filed as #288): The 2026-08-17 20:35 UTC comment above correctly identified stale .github/workflows/** on this branch, but that's not the reason nothing has happened since — someone (or a previous run of this routine) relabeled status:needs-qa at 05:35Z today, and qa-agent.yml run 32103470915 actually executed, but produced zero visible signal: its Resolve target and check for status:blocked step succeeded, then every subsequent step shows conclusion: skipped, and no comment was posted.

Root cause: this PR's body never contains a bare Closes #177 (or Fixes/Resolves) line — only incidental prose mentioning other issues (#171/#175). The actual Closes #177 text only exists in the commit message, which resolve_linked_issue.sh doesn't read. qa-agent.yml's guard step silently sets skip=true and exits when it can't resolve a linked issue at all — unlike its other skip paths (capacity, status:blocked, drift, crash), this one posts no PR comment, so the run leaves no trace. Filed as #288 with the full diagnosis and a suggested fix (mirroring #237's precedent for a related but distinct silent-skip case).

Net effect: relabeling status:needs-qa again will keep reproducing this exact silent no-op, since the PR body never changes on its own. Two separate things need a human's attention before this PR can move: rebase dev into this branch (the workflow-file drift already flagged), and add a Closes #177 line to the PR body — then re-apply status:needs-qa.


Generated by Claude Code

@libravault-xyz libravault-xyz added status:needs-qa PR open, awaiting qa-agent verification and removed status:needs-qa PR open, awaiting qa-agent verification labels Aug 19, 2026
@github-actions github-actions Bot removed the status:needs-qa PR open, awaiting qa-agent verification label Aug 19, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:needs-info Dev/QA agent needs more detail before proceeding label Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR's branch is stale relative to dev — specifically, .github/workflows/qa-agent.yml differs between this branch and dev. GitHub Actions refuses to mint the OIDC token claude-code-action needs when a pull_request-triggered, id-token: write workflow's own file doesn't byte-match the base branch (its own anti-tampering check), so the QA agent step was skipped rather than silently no-opping (see issue #254 for the full diagnosis). Rebase/merge dev into this branch and re-add status:needs-qa to retry.

Wires VaultPlayerViewModel/VaultPlayerScreen up to VaultStore's existing
addBookmark/removeBookmark/updateBookmarkNote, mirroring feature:player's
"ms:N" positionRef convention and VaultReaderViewModel's store-backed
bookmark wiring. Extends VaultBookmarksSheet's label/sort formatting to
handle "ms:N" refs so it can be reused as-is for audio.

Closes #177
@libravault-xyz
libravault-xyz force-pushed the feature/vault-player-bookmarks branch from a49f052 to 5afdd83 Compare August 19, 2026 06:09
@libravault-xyz

Copy link
Copy Markdown
Collaborator

Root-caused why this sat silent on status:needs-qa all day: the PR body never had a bare Closes #N line, so qa-agent.yml couldn't resolve the linked issue and no-opped with zero signal — filed as #288, fixed by #289 (now merged). Added Closes #177. to the body and rebased onto dev (also picked up #289's own fix plus #298's principal-review turn-cap fix — this branch was stale on both). Re-applying status:needs-qa to retry now that both are resolvable.

@libravault-xyz libravault-xyz added status:needs-qa PR open, awaiting qa-agent verification and removed status:needs-info Dev/QA agent needs more detail before proceeding labels Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: PASSED

✅ iOS Simulator Build & Unit Tests - success
✅ Android Core Modules - success

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

@claude

claude Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

QA verification — PR #179 vs issue #177

Acceptance criteria (issue #177):

  • VaultPlayerViewModel/VaultPlayerScreen gain bookmark support mirroring the regular Player's shape — confirmed: VaultPlayerViewModel now holds a VaultStore reference, seeds bookmarks: StateFlow<List<VaultBookmark>> from the manifest entry on load, and exposes addBookmark/removeBookmark/updateBookmarkNote/seekToBookmark, matching VaultReaderViewModel's existing pattern method-for-method.
  • Wiring only, no new storage work — VaultStore.addBookmark/removeBookmark/updateBookmarkNote (core/vaultstore/.../VaultStore.kt:407+) are unchanged; the only edit under core/vaultstore/** is a one-line KDoc addition on VaultBookmark.positionRef mentioning the "ms:N" convention — verified via git diff HEAD~1 HEAD -- core/vaultstore/..., no logic touched.
  • "ms:N" position-ref convention fed from current playback position — addBookmark uses _uiState.value.positionMs (the same value driving the seek bar), not player.currentPosition directly, which is also what keeps it unit-testable without a real ExoPlayer.
  • VaultPlayerScreen gets add-bookmark/show-bookmarks icons + a bookmarks sheet — BookmarkAdd/Bookmark IconButtons added to the TopAppBar, VaultBookmarksSheet reused as-is and extended with an "ms:" branch in both its sort-key and label-formatting helpers (previously unhandled → sorted last, printed raw "ms:12345").

What I ran:

  • ./gradlew :feature:vault:testDebugUnitTest :core:vaultstore:testDebugUnitTest --continue → BUILD SUCCESSFUL (4m 42s), including the new VaultPlayerViewModelTest bookmark cases and VaultBookmarksSheetUiTest's new "ms:" label case.
  • ./gradlew testDebugUnitTest --continue (full repo suite, to check for regressions outside the touched modules) → BUILD SUCCESSFUL (4m 27s), no FAILED tasks, no test failures.

Test-quality check: VaultPlayerViewModel didn't have any bookmark methods at all pre-fix (git show HEAD~1:...VaultPlayerViewModel.kt | grep addBookmark → no output), so the new tests exercise genuinely new code, not a path that already passed. The bookmark tests use the same "unknown fileId, store-only" pre-playback setup as the existing locked/not-found tests (no relaxed mocks masking a broken assertion) — addBookmark's store call is verified with exact-argument coVerify, and seekToBookmark's ms-parsing is asserted against real output state, not just "doesn't throw."

Regressions / related areas: VaultReaderViewModel's own bookmark methods are untouched; VaultBookmarksSheet's pre-existing "page:" and Locator-JSON branches are unaffected by the new "ms:" branch (each is its own when arm) and the existing PDF/EPUB VaultBookmarksSheetUiTest cases still pass alongside the new audio case.

AGENTS.md conventions: New/changed behavior has unit test coverage (required for non-trivial changes); no hardcoded versions; commit message follows Conventional Commits (feat(vault): ...) and is a single, scoped commit; branch name follows the feature/<slug> convention. The PR description's manual-verification checkbox is honestly left unchecked with a reason (no device/emulator in this environment) rather than falsely claimed — consistent with this repo's "a green run is not evidence of anything you didn't actually check" standard.

No gaps found against the issue's checklist.

QA verdict: PASS

@github-actions github-actions Bot removed the status:needs-qa PR open, awaiting qa-agent verification label Aug 19, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:needs-review QA passed, awaiting principal-review-agent label Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Principal review: PR #179

Verdict: human-merge — risk:high. classify_pr_risk.py was independently re-run against origin/dev...origin/feature/vault-player-bookmarks (head 5afdd83, matching the PR's current HEAD) and confirms core/vaultstore/src/main/kotlin/xyz/libravault/core/vaultstore/VaultManifest.kt matches the core/vaultstore/** sensitive-path glob — exactly what the PR description itself calls out. Note: no risk:* label is actually applied to this PR (only status:needs-review), so this classification comes from re-running the script directly rather than trusting a label.

Verified against ground truth (not just the PR description)

  • Diff is otherwise as described: 6 files, +224/-10, no .github/workflows/**, no build-logic/**/gradle/libs.versions.toml, no new networking. The sensitive-path hit is exactly the one-line KDoc change claimed — no other logic change in core/vaultstore.
  • VaultStore.addBookmark/removeBookmark/updateBookmarkNote signatures (core/vaultstore/.../VaultStore.kt:407-454) match how VaultPlayerViewModel calls them, including param order (fileId, positionRef, label, note) — pre-existing, unchanged methods, as claimed.
  • "Same pattern as VaultReaderViewModel" claim checks out: both hold private var store: VaultStore? = null, set it once unlocked, and null-guard every bookmark mutator with val s = store ?: return.
  • Tests actually exercise the new code, not mocks-of-mocks: ran ./gradlew :feature:vault:testDebugUnitTest :core:vaultstore:testDebugUnitTest locally (BUILD SUCCESSFUL, 4m43s). Confirmed via the JUnit XML that all 8 VaultPlayerViewModelTest cases (including the 6 new bookmark ones) and all 4 VaultBookmarksSheetUiTest cases (including the new "ms:" label case) actually ran and passed — 0 skipped, 0 failed.
  • CI checks correspond to the real HEAD commit: pulled check-runs for commit 5afdd83 directly from the GitHub API (not just the PR's cached statusCheckRollup) — JVM Tests, QA Agent verify, and iOS build/test are all success against that exact SHA.
  • No status:blocked on the PR or its issue (Vault: audio bookmarks for VaultPlayerScreen #177).

Findings (non-blocking, for the record)

  1. PLAUSIBLE, minor — narrow optimistic-state race in seekToBookmark (VaultPlayerViewModel.kt:186-191). It unconditionally does _uiState.update { it.copy(positionMs = ms, isPlaying = true) } even when player is still null, rather than gating on player != null the way addBookmark/removeBookmark gate on store != null. In the current UI this is only reachable through a narrow window: _bookmarks.value is populated (line 91) before player is assigned (line 96) in the same init coroutine, separated by a suspending s.openReader(fileId) call — so a bookmark tap in that gap would flip isPlaying to true and set a stale positionMs while nothing is actually playing, self-correcting only once the position ticker or Player.Listener next fires. Doesn't block this PR given the risk tier is already risk:high for policy reasons, but worth a human glance.
  2. Simplification, cosmetic — formatPosition in VaultPlayerViewModel.kt:193-199 and formatVaultBookmarkPositionMs in VaultBookmarksSheet.kt:94-100 are byte-for-byte identical mm:ss/h:mm:ss formatters, now duplicated a second time (the sheet already had its own copy before this PR, per its doc comment on intentionally not sharing across feature:vault's reading UI — but this specific formatter used to only exist in one place; now it exists in both VaultPlayerViewModel and VaultBookmarksSheet). Not worth blocking on, just flagging for a future pass.

No CONFIRMED findings. Routing to human-merge is purely the risk:high sensitive-path policy, not a defect in the change itself.

@github-actions github-actions Bot added status:needs-human-merge Principal review done, requires human merge decision and removed status:needs-review QA passed, awaiting principal-review-agent labels Aug 19, 2026
@libravault-xyz
libravault-xyz merged commit f83c662 into dev Aug 19, 2026
14 checks passed
@libravault-xyz
libravault-xyz deleted the feature/vault-player-bookmarks branch August 19, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:needs-human-merge Principal review done, requires human merge decision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vault: audio bookmarks for VaultPlayerScreen

1 participant