fix(view): reliably reveal PodNotes view via command + ribbon icon (#55)#199
Merged
Conversation
The Show PodNotes command was gated to only appear when no view leaf existed, and it never revealed the leaf it set. Once the view was open but hidden (collapsed sidebar, sidebar-icon overflow, or dragged out of sight) there was no way to bring it back: the command disappeared from the palette and did nothing when bound to a hotkey. Add an activateView() helper that reuses the existing leaf when present and always calls revealLeaf, wire the Show PodNotes command to it as a plain always-available callback, and add a left-ribbon podcast icon as a persistent, overflow-proof entry point. Update the command docs. Closes #55
…ocs (#55) Add an onload wiring test that asserts the podnotes-show-leaf command is registered as a plain always-available callback (never the old leaf-gated checkCallback) and that both the command and the ribbon icon route to activateView. activateView's own unit tests stay green under a refactor that reintroduced the gate, so this locks the actual #55 regression. Soften the ribbon docs: the icon is hideable via Manage ribbon actions and appears in the ribbon menu on mobile, so drop the 'always visible' claim. Addresses review nits; no behavior change.
Deploying podnotes with
|
| Latest commit: |
046f0ec
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://793a8f65.podnotes.pages.dev |
| Branch Preview URL: | https://chhoumann-55-toolbar-icon-mi.podnotes.pages.dev |
Owner
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
What & why
Fixes #55. For some users the PodNotes pane never appears, and once the view exists but is hidden there was no way to bring it back.
Reproduced in real Obsidian (this checkout's build, isolated vault):
Show PodNotesin paletteRoot cause in
src/main.ts:Show PodNotescommand used acheckCallbackthat returnedfalse(hiding the command) whenever a leaf of the view type already existed. So once the view was open-but-hidden (collapsed sidebar, right-sidebar icon overflow, dragged out of sight), the command disappeared from the palette and did nothing when bound to a hotkey.setViewStatebut neverrevealLeaf, so the leaf was never surfaced.Change
activateView(): reuse an existing leaf when present, otherwise create one in the right sidebar, then alwaysrevealLeafit.Show PodNotesfromcheckCallbackto a plain, always-availablecallbackthat callsactivateView()— so it works from the palette and as a hotkey regardless of current state.onLayoutReadyis unchanged: startup still creates the leaf without force-revealing, so launches stay non-intrusive.docs/docs/commands.md.Verification
Real Obsidian (isolated worktree vault), after the fix:
activateView()reuses the leaf and reveals it (rightCollapsed: true → false, leaf count stays 1).rightCollapsed: false).Show PodNotescommand is always available in the palette.onunloadstill detaches leaves on disable/enable.Gates (Node 22):
lintclean ·format:checkclean ·typecheckclean ·check:a11y0 errors/0 warnings ·buildok ·test458 passed, including newsrc/main.activateView.test.ts(activateView reuse/reveal/null-safety + anonloadwiring test that locks the command-is-a-callback-not-checkCallback and ribbon→activateView regression).Review
Ran a deep correctness/security pass plus two adversarial reviewers (incompleteness + regression lenses), each finding adversarially verified. No blockers; the two confirmed nits are folded into the second commit:
activateView's internals), andVisible change
A podcast icon in the left ribbon (label "Show PodNotes"). Clicking it — or running the command, or its hotkey — reliably reveals the PodNotes pane, including when it is already open but hidden.
Scope note
This targets the reproducible failure mode: discoverability and reliably revealing the view. The 2023 report also mentioned choppy direct-file playback with no controls; that predates the Svelte 5 view rewrite and isn't reproducible on current master, so it's out of scope here.