Skip to content

fix(view): reliably reveal PodNotes view via command + ribbon icon (#55)#199

Merged
chhoumann merged 2 commits into
masterfrom
chhoumann/55-toolbar-icon-missing
Jun 16, 2026
Merged

fix(view): reliably reveal PodNotes view via command + ribbon icon (#55)#199
chhoumann merged 2 commits into
masterfrom
chhoumann/55-toolbar-icon-missing

Conversation

@chhoumann

Copy link
Copy Markdown
Owner

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):

State Show PodNotes in palette After invoking Result
Leaf exists, sidebar collapsed (the reported case) Unavailable sidebar stays collapsed view never shown
No leaf, sidebar collapsed available leaf created but sidebar stays collapsed view never shown

Root cause in src/main.ts:

  • The Show PodNotes command used a checkCallback that returned false (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.
  • Even when it ran, it called setViewState but never revealLeaf, so the leaf was never surfaced.
  • There was no ribbon icon, so the only entry point was the overflow-prone right-sidebar header — exactly the scenario in the original report.

Change

  • Add activateView(): reuse an existing leaf when present, otherwise create one in the right sidebar, then always revealLeaf it.
  • Switch Show PodNotes from checkCallback to a plain, always-available callback that calls activateView() — so it works from the palette and as a hotkey regardless of current state.
  • Add a left-ribbon podcast icon ("Show PodNotes") as a persistent, overflow-proof entry point (addresses the sidebar-overflow hypothesis from the issue thread).
  • onLayoutReady is unchanged: startup still creates the leaf without force-revealing, so launches stay non-intrusive.
  • Update docs/docs/commands.md.

Verification

Real Obsidian (isolated worktree vault), after the fix:

  • Leaf exists + collapsed sidebar → activateView() reuses the leaf and reveals it (rightCollapsed: true → false, leaf count stays 1).
  • No leaf + collapsed sidebar → creates and reveals (leaf count 1, rightCollapsed: false).
  • Ribbon podcast icon now present in the left ribbon; the Show PodNotes command is always available in the palette.
  • Sequential and concurrent double-activation both converge to exactly 1 leaf (no duplicate-leaf race); onunload still detaches leaves on disable/enable.

Gates (Node 22): lint clean · format:check clean · typecheck clean · check:a11y 0 errors/0 warnings · build ok · test 458 passed, including new src/main.activateView.test.ts (activateView reuse/reveal/null-safety + an onload wiring 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:

  • a wiring test that locks the actual gate-removal/ribbon regression (not just activateView's internals), and
  • softened ribbon docs (the icon is hideable via Manage ribbon actions and lives in the ribbon menu on mobile).

Visible 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.

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.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying podnotes with  Cloudflare Pages  Cloudflare Pages

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

View logs

@chhoumann chhoumann marked this pull request as draft June 16, 2026 08:56
@chhoumann chhoumann marked this pull request as ready for review June 16, 2026 08:57
@chhoumann

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 046f0ec2c5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@chhoumann chhoumann merged commit fa1d708 into master Jun 16, 2026
2 checks passed
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.

Podnotes Icon Not Appearing in Toolbar

1 participant