Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@fcoury
Copy link
Owner

@fcoury fcoury commented Dec 13, 2025

Summary

  • Add Shift+Tab support to navigate backwards through the UI focus cycle

Changes

  • Tab: Query → Grid → Sidebar (if visible) → Query (forward)
  • Shift+Tab: Query → Sidebar (if visible) → Grid → Query (backward)

Test plan

  • Press Tab to cycle forward through focus areas
  • Press Shift+Tab to cycle backward through focus areas
  • Verify behavior with sidebar hidden (should skip sidebar)

Summary by CodeRabbit

  • New Features

    • Enhanced keyboard navigation: press Tab to advance and Shift+Tab to move backward through the query editor, data grid, and sidebar. Focus cycling adapts to current position and sidebar visibility for smoother keyboard-driven workflows.
  • Chores

    • Internal code hygiene updates with no user-visible behavior changes.

✏️ Tip: You can customize this high-level summary in your review settings.

Add support for Shift+Tab to navigate backwards through the UI focus
cycle (Query → Sidebar → Grid), reversing the existing Tab behavior.
@coderabbitai
Copy link

coderabbitai bot commented Dec 13, 2025

Walkthrough

Adds Tab and Shift+Tab (BackTab) keyboard handling in App::on_key to cycle focus among Focus::Query, Focus::Grid, and Focus::Sidebar(SidebarSection::Schema), with behavior conditional on current focus and sidebar visibility. Also adds a clippy allow attribute to Sidebar::render.

Changes

Cohort / File(s) Change Summary
Focus navigation
crates/tsql/src/app/app.rs
Added Tab / BackTab handling in App::on_key to cycle focus between Focus::Query, Focus::Grid, and Focus::Sidebar(SidebarSection::Schema); branches return early after changing focus and consider sidebar visibility.
Lint suppression
crates/tsql/src/ui/sidebar.rs
Added #[allow(clippy::too_many_arguments)] to Sidebar::render method; no signature or logic changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review the new Tab/BackTab branching in app.rs for correct focus transitions and that early returns don't skip unrelated key handling.
  • Verify handling when the sidebar is hidden and ensure no null/invalid focus states are possible.
  • Confirm unit/UI tests (if present) reflect the new navigation behavior.

"I hop between keys and nibble the focus line,
From query to grid, then sidebar so fine.
Shift me back, press Tab once more—
A rabbit's trail across the UI floor. 🐇"

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add Shift+Tab for backwards focus navigation' directly and clearly summarizes the main change—adding Shift+Tab support for backward focus navigation in the UI.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fcoury/shift-tab-backwards

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

Copy link

@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: 0

🧹 Nitpick comments (1)
crates/tsql/src/ui/sidebar.rs (1)

55-68: Avoid blanket clippy::too_many_arguments by grouping render inputs (or justify in a comment).

Sidebar::render already takes enough inputs that future tweaks will keep inflating the signature; consider a small SidebarRenderContext/RenderParams struct (or splitting connections/schema renders at call site) instead of suppressing the lint. If you keep the allow, add a short comment explaining why this is the least-bad option here (e.g., performance/borrowing constraints).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between cf210fd and 7ef3d27.

📒 Files selected for processing (1)
  • crates/tsql/src/ui/sidebar.rs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test (windows-latest)

@fcoury fcoury merged commit 0b81bef into master Dec 13, 2025
5 of 6 checks passed
@fcoury fcoury deleted the fcoury/shift-tab-backwards branch December 13, 2025 23:48
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