Skip to content

implemented full keyboard navigation support#10

Merged
ravindu2012 merged 5 commits intomasterfrom
keyboard-navigation
Mar 9, 2026
Merged

implemented full keyboard navigation support#10
ravindu2012 merged 5 commits intomasterfrom
keyboard-navigation

Conversation

@IsxImattI
Copy link
Copy Markdown
Collaborator

Summary

Brief description of the changes.

Type of Change

  • Bug fix
  • New feature
  • Improvement/refactor
  • Documentation
  • Other

Related Issue

Fixes #6

Changes Made

  • added InputBindings to MainWindow for F5 (Home), Ctrl+F (Search), Ctrl+S (Save), Ctrl+N (New), and Esc (Close Tab).

  • developed a FindVisualChild utility in MainWindow.xaml.cs to programmatically focus the search TextBox within complex DataTemplates when Ctrl+F is pressed.

  • assigned logical TabIndex values to all interactive elements in CenterTemplate, ListTemplate, and TransactionFormTemplate.

  • added _ prefix to Content properties of primary buttons (Save, Clear, Void, New, Edit, etc.) to enable Alt + Key shortcuts.

  • connected global shortcuts to ViewModel commands using a custom RelayCommand implementation.

Screenshots

N/A

Checklist

  • I have tested my changes locally
  • My code follows Clean Architecture (dependencies flow inward)
  • ViewModels follow MVVM pattern
  • I have added tests for new business logic

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds app-wide keyboard navigation support in the WPF shell by wiring global shortcuts and improving tab/Alt-key navigation across key views, addressing Issue #6’s “power user” keyboard workflow goal.

Changes:

  • Added Window.InputBindings in MainWindow for Home/Find/Close Tab/Save/New shortcuts.
  • Implemented code-behind command handlers for global actions (focus search, close tab, global save/new) plus a visual-tree helper.
  • Updated shared DataTemplates to include TabIndex ordering and access keys (underscored button content).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
src/Presentation/QBD.WPF/Themes/DataTemplates.xaml Adds TabIndex values and access keys (_) for keyboard navigation within templates.
src/Presentation/QBD.WPF/MainWindow.xaml Adds global KeyBindings for keyboard shortcuts at the window level.
src/Presentation/QBD.WPF/MainWindow.xaml.cs Exposes commands for keybindings and implements global save/new/close/focus-search behaviors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

src/Presentation/QBD.WPF/Themes/DataTemplates.xaml:116

  • CenterTemplate: only the filter TextBox/Button/ListBox have explicit TabIndex values, but the adjacent New/Edit buttons still have the default TabIndex (0). In WPF that will typically place New/Edit earlier in the tab sequence than the intended search-first flow, making tab navigation inconsistent. Assign TabIndex values to New/Edit (and any other focusable controls in this panel) consistent with the intended order; similarly consider adding access keys if you want Alt+Key parity with ListTemplate.
                <StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="8,4">
                    <Button Content="New" Command="{Binding NewEntityCommand}" Padding="8,2" Margin="0,0,4,0"/>
                    <Button Content="Edit" Command="{Binding EditEntityCommand}" Padding="8,2"/>
                </StackPanel>

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ravindu2012 and others added 3 commits March 9, 2026 14:48
- Cache ICommand properties to avoid allocating on every binding access
- Rename RelayCommand to ActionCommand to avoid conflict with CommunityToolkit.Mvvm
- Fix FocusSearch to match TextBox by binding path (FilterText/SearchText) instead of TabIndex
- Scope search to selected tab content instead of entire TabControl
- Add InputGestureText hints for F5, Ctrl+F, and Esc shortcuts in menus
- Add F1 keybinding and Help > Keyboard Shortcuts menu item
- Show themed dialog listing all shortcuts with their actions
- Covers global shortcuts (F1, F5, Ctrl+N/S/F, Esc) and form-level access keys (Alt+S/P/L/V/R/N/E/D)
@ravindu2012 ravindu2012 merged commit 7a4f302 into master Mar 9, 2026
@IsxImattI IsxImattI deleted the keyboard-navigation branch March 9, 2026 09:38
ravindu2012 added a commit that referenced this pull request Mar 12, 2026
implemented full keyboard navigation support
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.

Add keyboard navigation support across all views

3 participants