Skip to content

fix(keymap): enable digit tab switch in gui - #284

Merged
thisisgm merged 1 commit into
thisisgm:mainfrom
joebaus:fix/gui-digit-tabs
Oct 13, 2026
Merged

thisisgm merged 1 commit into
thisisgm:mainfrom
joebaus:fix/gui-digit-tabs

Conversation

@joebaus

@joebaus joebaus commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Bare 1-9 never switched tabs in the GUI while t, w, [ and ] all worked.

Root cause: the [digits] fallback in tools/flea-keymap-gen only answered when frontend is tui, but ui/Pane.qml reaches Focus.handleKey which calls Keymap.lookup with no frontend, so it defaults to gui and every digit returned empty. ui/js/Tabs.js already handled tab1 through tab9, so only the lookup needed to change.

Fix: widen the DIGITS gate to tui or gui, regenerate ui/js/Keymap.js with the tool, and assert tab1 and tab9 under both frontends in tests/js/keymap.js. The modifiers check is untouched, so Ctrl+1 through Ctrl+3 still switch views, and typed digits still reach the filter and search lines because those return before the lookup. The file budget ceiling for tests/js/keymap.js moves 309 to 310 for the added assertion.

Verified: tests/keymap-gen.sh clean, ./tests/js.sh keymap 646 checks 0 failed, ./tests/js.sh tabs 204 checks 0 failed, full ./tests/js.sh 11271 checks 0 failed, file budget exit 0, qmllint gate 0 regressions, plus a live FLEA_UI=$PWD/ui ./target/release/flea --gui run where 1/2/3 switch tabs and 9 on three tabs reports No tab 9.

Known limitation left out on purpose: the ? sheet still does not list 1-9 because no sheet group claims tab1 through tab9, so they stay bound and hinted but off the sheet. Happy to follow up separately.

Summary by CodeRabbit

  • New Features
    • In the GUI listing, press an unmodified number from 1 to 9 to select the corresponding tab.

The DIGITS fallback only answered tui, so bare 1-9 never reached Tabs.act in gui.
Widen the gate to gui as well and assert tab1 and tab9 under both frontends.
Ctrl+1-3 views still win by mask and typed digits still reach the query lines.
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 36f8b096-ea9e-4d09-9c29-2eea2354fc0e

📥 Commits

Reviewing files that changed from the base of the PR and between abb536e and 979bcd3.


📒 Files selected for processing (4)
  • tests/js/keymap.js
  • tools/flea-file-budget
  • tools/flea-keymap-gen
  • ui/js/Keymap.js

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.



📝 Walkthrough

Walkthrough

Unmodified digits in the configured range now select the corresponding tab in both GUI and TUI frontends. GUI keymap tests cover digits 1 and 9.

Changes

Numeric tab shortcuts

Layer / File(s) Summary
Enable numeric tab shortcuts in GUI
tools/flea-keymap-gen, ui/js/Keymap.js, tests/js/keymap.js, tools/flea-file-budget
The digit-to-tab fallback now accepts both GUI and TUI frontends. GUI tests expect unmodified 1 and 9 to select tabs 1 and 9. The recorded test-file ceiling increases from 309 to 310.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Suggested reviewers: thisisgm


Merge Risk: ⚪ Minimal · up to 979bc

Unmodified GUI digits reach the existing numbered-tab selection, while digits typed into search or filter fields remain text. No actionable merge risk remains.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: enabling digit-based tab switching in the GUI keymap.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (2 skipped: 2 unsupported.)


  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 Biome (2.5.14)
tests/js/keymap.js

File contains syntax errors that prevent linting: Line 1: Expected a statement but instead found '.'.; Line 1: Expected a semicolon or an implicit semicolon after a statement, but found none; Line 1: Expected a semicolon or an implicit semicolon after a statement, but found none


ui/js/Keymap.js

File contains syntax errors that prevent linting: Line 1: Expected a statement but instead found '.pragma library'.



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.

@thisisgm
thisisgm merged commit 469b62a into thisisgm:main Oct 13, 2026
1 check passed
@thisisgm

Copy link
Copy Markdown
Owner

merged as authored; a bare digit switches to that tab (979bcd3, v0.3.10). Thanks @joebaus! https://github.com/thisisgm/flea/releases/tag/v0.3.10

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