Skip to content

feat(navigation): add list top/bottom jump shortcuts and select all toggle - #1616

Open
ashvin-to wants to merge 3 commits into
yorukot:mainfrom
ashvin-to:feat/list-navigation-shortcuts
Open

feat(navigation): add list top/bottom jump shortcuts and select all toggle#1616
ashvin-to wants to merge 3 commits into
yorukot:mainfrom
ashvin-to:feat/list-navigation-shortcuts

Conversation

@ashvin-to

@ashvin-to ashvin-to commented Aug 5, 2026

Copy link
Copy Markdown

Description

This PR adds keyboard shortcuts for:

  1. Top () / Bottom () List Navigation: Jump directly to the top or bottom item across file panels, sidebar, metadata, and processbar panels.
  2. Select All / Deselect All Toggle (): In file panel selection mode, pressing A toggles selecting all items if not all are selected, or deselecting all items if all are currently selected.

Related Issues

Fixes #1614
Partially addresses #300

✅ Pre-Submission Checklist

  • I have run go fmt ./... to format the code
  • I have run golangci-lint run and fixed any reported issues
  • I have tested my changes and verified they work as expected
  • I have reviewed the diff to make sure I’m not committing any debug logs
  • I have checked that the PR title follows Conventional Commits

Summary by CodeRabbit

  • New Features

    • Added Home and End hotkeys to jump directly to the top or bottom of file lists, sidebars, process lists, and metadata panels.
    • Added mouse support for scrolling, focusing panels, selecting sidebar items, moving through files, and double-clicking directories.
    • Clicking different interface areas now updates focus more intuitively.
    • “Select all” now toggles between selecting and deselecting all files.
  • Bug Fixes

    • Improved navigation and focus handling for empty lists and panel boundaries.
  • Tests

    • Added coverage for mouse focus, boundary navigation, and selection toggling.

@github-actions github-actions Bot added awaiting pr review test related PR / Issue related to testcases or testing in general. new hotkeys labels Aug 5, 2026
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds Home and End navigation for focused panels, mouse-based focus and file interaction, toggleable file selection, and supporting tests. It also propagates mouse commands through Update and adds a generated database file to .gitignore.

Changes

Navigation and interaction

Layer / File(s) Summary
Panel navigation and hotkey dispatch
src/internal/common/config_type.go, src/internal/key_function.go, src/internal/ui/*/navigation.go, src/internal/ui/filepanel/utils.go, src/superfile_config/hotkeys.toml, src/internal/ui/filepanel/navigation_test.go
Adds ListTop and ListBottom behavior across panels and maps them to home and end.
Mouse focus and click handling
src/internal/model.go, src/internal/mouse_function.go, src/internal/ui/filemodel/navigation.go, src/internal/mouse_function_test.go
Adds coordinate-based focus, cursor movement, sidebar selection, double-click directory navigation, and command propagation.
File-panel selection toggle
src/internal/ui/filepanel/update.go, src/internal/ui/filepanel/navigation_test.go
SelectAllItem now selects all items or clears all selections based on current selection state.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested labels: new feature

Suggested reviewers: lazysegtree

Sequence Diagram(s)

sequenceDiagram
  participant Mouse
  participant Update
  participant MouseHandler
  participant PanelModel
  Mouse->>Update: left-click coordinates
  Update->>MouseHandler: handle mouse message
  MouseHandler->>PanelModel: resolve focus and update cursor
  PanelModel-->>MouseHandler: updated panel state
  MouseHandler-->>Update: command
Loading
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The pull request implements both requested features, but it binds Home/End instead of the requested g/G shortcuts [#1614]. Bind the list-top and list-bottom actions to g and G, or confirm that Home and End intentionally replace the issue's requested shortcuts.
Out of Scope Changes check ⚠️ Warning The pull request includes unrelated mouse handling, panel focus, scrolling, sidebar click, and .gitignore changes beyond issue #1614. Move unrelated mouse, focus, scrolling, sidebar, and .gitignore changes into separate pull requests.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the list jump shortcuts and select-all toggle implemented by the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/internal/ui/filepanel/update.go`:
- Around line 84-90: Update SelectAllItem to determine whether all items in the
current m.element collection are selected by checking each item.Location
individually, rather than comparing SelectedCount() with len(m.element). Toggle
by resetting selections when every current item is selected; otherwise select
the current items, while preserving selections outside the current directory.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4218ba3a-c5f5-4b88-8267-a9194bce5997

📥 Commits

Reviewing files that changed from the base of the PR and between a97381e and 93652bb.

📒 Files selected for processing (15)
  • .gitignore
  • src/internal/common/config_type.go
  • src/internal/key_function.go
  • src/internal/model.go
  • src/internal/mouse_function.go
  • src/internal/mouse_function_test.go
  • src/internal/ui/filemodel/navigation.go
  • src/internal/ui/filepanel/navigation.go
  • src/internal/ui/filepanel/navigation_test.go
  • src/internal/ui/filepanel/update.go
  • src/internal/ui/filepanel/utils.go
  • src/internal/ui/metadata/model.go
  • src/internal/ui/processbar/model_navigation.go
  • src/internal/ui/sidebar/navigation.go
  • src/superfile_config/hotkeys.toml

Comment thread src/internal/ui/filepanel/update.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting pr review new hotkeys test related PR / Issue related to testcases or testing in general.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add shortcuts for jumping to the first/last item and toggling model selection

1 participant