Fix addShortcutToLeftSidebar, use new API (Closes #509)#511
Conversation
… current page shortcuts. Update command label for clarity.
WalkthroughVersion number incremented from 1.7.2 to 1.7.3. The Jump Navigation feature's shortcut functionality was refactored from DOM-based manipulation to a direct API call using Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/features/jumpNav.tsx (1)
481-486: ConfirmaddShortcutbehavior when focused on a blockThis now passes the result of
getCurrentPageUid()directly intowindow.roamAlphaAPI.data.page.addShortcut(uid, 0). SincegetOpenPageOrBlockUid()may return a block UID when zoomed into a block, please double‑check thataddShortcutaccepts both page and block UIDs, or else consider resolving the containing page UID before calling it to avoid subtle misbehavior in that state. The@ts-expect-errorusage is fine as a temporary bridge until the types catch up.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (2)
package.json(1 hunks)src/features/jumpNav.tsx(2 hunks)
🔇 Additional comments (2)
src/features/jumpNav.tsx (1)
623-625: Label change matches new shortcut behaviorThe new label “Add current page to shortcuts” is clearer and aligns with calling the official shortcut API instead of DOM interaction. No issues from a UX or wiring perspective.
package.json (1)
26-26: Patch version bump is appropriateIncrementing the version to 1.7.3 for this behavioral fix is consistent with semantic versioning; no further changes needed here.
https://www.loom.com/share/70f0edaaf9be4dc4884b8cefd2bd30b8
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.