Skip to content

Fix backward navigation to wrap around to last item#25

Merged
pheuberger merged 1 commit into
mainfrom
claude/fix-bookmark-nav-start-uS7sC
Feb 5, 2026
Merged

Fix backward navigation to wrap around to last item#25
pheuberger merged 1 commit into
mainfrom
claude/fix-bookmark-nav-start-uS7sC

Conversation

@pheuberger
Copy link
Copy Markdown
Owner

Summary

Fixed backward navigation (previous item) in bookmark lists to properly wrap around to the last item when at the beginning, and handle empty lists correctly.

Key Changes

  • BookmarkList.jsx: Updated selectPrev callback to wrap navigation from index 0 to the last item in the filtered list

    • Added check for empty lists (returns -1 when no items available)
    • Added wrap-around logic: when at index -1 (no selection), jump to last item
    • Added dependency on filteredBookmarks.length to ensure callback updates when list changes
  • InboxView.jsx: Applied identical fix to selectPrev callback for consistency

    • Added check for empty lists (returns -1 when no items available)
    • Added wrap-around logic: when at index -1 (no selection), jump to last item
    • Added dependency on bookmarks.length to ensure callback updates when list changes

Implementation Details

The changes enable circular navigation where pressing "previous" at the start of a list wraps to the end, improving UX for keyboard navigation. Both components now handle edge cases consistently:

  • Empty lists return -1 (no valid selection)
  • Navigation from index 0 stays at 0 (no wrap in this direction)
  • Navigation from -1 (unselected) jumps to the last valid index

https://claude.ai/code/session_01S1ZzZyJ7qKkPzkwsQhEYsz

When pressing 'k' with no bookmark selected, start from the last item
instead of the first. This applies to all views: bookmarks, tags, read
later, and inbox.

https://claude.ai/code/session_01S1ZzZyJ7qKkPzkwsQhEYsz
@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 5, 2026

Deploy Preview for hypermarkk ready!

Name Link
🔨 Latest commit dbc575f
🔍 Latest deploy log https://app.netlify.com/projects/hypermarkk/deploys/6984705c5f082d0008502a17
😎 Deploy Preview https://deploy-preview-25--hypermarkk.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pheuberger pheuberger merged commit 86bb334 into main Feb 5, 2026
7 checks passed
@pheuberger pheuberger deleted the claude/fix-bookmark-nav-start-uS7sC branch February 5, 2026 10:31
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.

2 participants