Skip to content

docs: add keybinding improvement proposal for TUI#49

Open
AndreaDiazCorreia wants to merge 2 commits intomainfrom
proposal/keybinding-improvements
Open

docs: add keybinding improvement proposal for TUI#49
AndreaDiazCorreia wants to merge 2 commits intomainfrom
proposal/keybinding-improvements

Conversation

@AndreaDiazCorreia
Copy link
Copy Markdown
Member

@AndreaDiazCorreia AndreaDiazCorreia commented Apr 3, 2026

Adds a proposal document outlining keybinding improvements for the Mostrix TUI, inspired by conventions from widely-used terminal applications like lazydocker, bluetui, and htop. The proposal covers three phases: quick wins (q to quit, ? for help, Tab to cycle tabs, Shift+M for mode switch), a context-aware keybinding hint bar in the footer, and optional advanced navigation features. It includes a comparison with existing TUI conventions, documents all current keybindings, and identifies a doc-code discrepancy where Q to quit is documented but was removed from the code.

Summary by CodeRabbit

  • Documentation
    • Added a proposal outlining visible keyboard and navigation changes: press "q" to trigger exit confirmation, "?" as an alternative help key, Tab/BackTab to cycle top-level tabs in normal mode, and Shift+M to switch User/Admin mode.
    • Describes a persistent, context-aware footer hint bar and optional future shortcuts (direct tab keys, j/k navigation, refresh, search).

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 3, 2026

Walkthrough

A new documentation file proposes a three-phase plan to standardize Mostrix TUI keybindings, specifying concrete shortcuts (q, ?), tab-cycling changes, mode-switch restrictions, a persistent context-aware footer hint bar, and optional advanced navigation ideas with implementation notes.

Changes

Cohort / File(s) Summary
Keybinding Proposal Documentation
docs/KEYBINDING_PROPOSAL.md
Added a detailed proposal describing phased keybinding changes: add q for exit confirmation, ? for help, alter Tab/BackTab tab cycling, restrict mode switch to Shift+M, define a persistent context-aware footer hint bar, and list optional advanced navigation features and implementation ordering notes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐇 I nibble keys and hop with glee, q to leave, ? to see,

Tabs I circle, hints appear, a soft-lit trail to steer,
Shifted modes and clearer ways—tiny hops, delightful days. ✨

🚥 Pre-merge checks | ✅ 3
✅ 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 'docs: add keybinding improvement proposal for TUI' clearly and concisely describes the main change—adding documentation about proposed keybinding improvements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch proposal/keybinding-improvements

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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
docs/KEYBINDING_PROPOSAL.md (1)

140-144: Avoid brittle hard-coded line numbers in cross-file references.

Line 140 and Line 143 pin exact line numbers in other files/docs; these will drift quickly and make the proposal stale. Prefer section anchors, symbol names, or quoted snippets only.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/KEYBINDING_PROPOSAL.md` around lines 140 - 144, The proposal currently
references exact line numbers for the "'Q' to quit" entry in the TUI_INTERFACE
doc but the keybinding was removed (see the comment "'q' key removed - use Exit
tab instead." in the key_handler mod), and those hard-coded line numbers will
drift; update the KEYBINDING_PROPOSAL.md references to remove line numbers and
instead point to stable anchors or section headers (or include a short quoted
snippet) for the TUI_INTERFACE entry, and also update the text to reflect that
the 'Q' binding is gone by citing the key_handler mod comment/symbol so the doc
stays accurate and resilient to edits.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/KEYBINDING_PROPOSAL.md`:
- Around line 72-74: Replace the absolutist phrase "not a recognized convention
in any major TUI" in KEYBINDING_PROPOSAL.md with a softer term such as "less
common" or "uncommon" (e.g., change to "Ctrl+H is less common in major TUIs") so
the wording is accurate over time; locate the sentence containing "Ctrl+H" and
update that clause only while preserving the surrounding explanation about
discoverability and the recommendation to prefer "?".

---

Nitpick comments:
In `@docs/KEYBINDING_PROPOSAL.md`:
- Around line 140-144: The proposal currently references exact line numbers for
the "'Q' to quit" entry in the TUI_INTERFACE doc but the keybinding was removed
(see the comment "'q' key removed - use Exit tab instead." in the key_handler
mod), and those hard-coded line numbers will drift; update the
KEYBINDING_PROPOSAL.md references to remove line numbers and instead point to
stable anchors or section headers (or include a short quoted snippet) for the
TUI_INTERFACE entry, and also update the text to reflect that the 'Q' binding is
gone by citing the key_handler mod comment/symbol so the doc stays accurate and
resilient to edits.
🪄 Autofix (Beta)

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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 91d1d520-a184-4256-8313-9e7d35d84934

📥 Commits

Reviewing files that changed from the base of the PR and between d6502b4 and c97e835.

📒 Files selected for processing (1)
  • docs/KEYBINDING_PROPOSAL.md

Comment thread docs/KEYBINDING_PROPOSAL.md Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
docs/KEYBINDING_PROPOSAL.md (1)

264-265: Clarify hint bar merge strategy.

Lines 264-265 state the hint bar "should yield to it or merge them to avoid duplication." Consider specifying which approach is preferred or under what conditions each applies. For example: "The global hint bar should not render when on the Disputes In Progress tab to avoid duplication" or "The global hint bar should merge with Disputes-specific hints."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/KEYBINDING_PROPOSAL.md` around lines 264 - 265, Clarify the merge
strategy by specifying a single rule: prefer hiding the global hint bar when the
Disputes In Progress tab is active to avoid duplication, and if a unified
display is later desired, define a merge behavior where Disputes-specific footer
hints take precedence and are appended to any condensed global hint; update the
text around "global hint bar" and "Disputes In Progress tab" to state this
explicit behavior and the fallback merge order.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/KEYBINDING_PROPOSAL.md`:
- Around line 135-144: The docs still instruct users to press `Q` to quit but
the implementation removed that keybinding; update the documented sentence that
currently reads "Pressing `Q` or selecting the Exit tab shows a confirmation
popup..." to remove the `Q` reference and state that selecting the Exit tab
shows the confirmation popup (or explicitly note that the `Q` key was removed
and users must use the Exit tab), ensuring the documentation matches the code
comment "'q' key removed - use Exit tab instead." and any other occurrences of
the `Q` keybinding in the same document.

---

Nitpick comments:
In `@docs/KEYBINDING_PROPOSAL.md`:
- Around line 264-265: Clarify the merge strategy by specifying a single rule:
prefer hiding the global hint bar when the Disputes In Progress tab is active to
avoid duplication, and if a unified display is later desired, define a merge
behavior where Disputes-specific footer hints take precedence and are appended
to any condensed global hint; update the text around "global hint bar" and
"Disputes In Progress tab" to state this explicit behavior and the fallback
merge order.
🪄 Autofix (Beta)

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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 72983d7c-69c6-4f2f-98c1-6b981b56c4f8

📥 Commits

Reviewing files that changed from the base of the PR and between c97e835 and 1fa3198.

📒 Files selected for processing (1)
  • docs/KEYBINDING_PROPOSAL.md

Comment thread docs/KEYBINDING_PROPOSAL.md
Comment thread docs/KEYBINDING_PROPOSAL.md
@grunch
Copy link
Copy Markdown
Member

grunch commented Apr 10, 2026

Great add, I lilke most of it but I disagree with the "q" to quit, yes all simple TUIs have q to quit, but this is not a simple TUI app, mostrix have two modes and each mode have many options, q to quit can work on TUI where they don't have a input text but we have several input text.

I propose ctrl+D to quit which is the "standard" for more complex TUIs, and keep the exit tab and enter to exit there.

About moving with tabs that could be the done only if we think how to behave in the case admin want to move between tabs to talk to buyer/seller

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