Skip to content

Addressing PR comments#107

Draft
Claude wants to merge 8 commits intomainfrom
claude/add-ctrl-tab-for-tabs
Draft

Addressing PR comments#107
Claude wants to merge 8 commits intomainfrom
claude/add-ctrl-tab-for-tabs

Conversation

@Claude
Copy link
Contributor

@Claude Claude AI commented Mar 4, 2026

Original prompt

This section details on the original issue you should resolve

<issue_title>Switch device information tabs with Ctrl+Tab</issue_title>
<issue_description>Version and Environment

  • GSmartControl version: 1.1.4 (latest)
  • OS: Windows 10 22H2

Is your feature request related to a problem? Please describe.
Device information windows cannot be navigated using the keyboard.
Most importantly, tabs (General, Attributes, Statistics, etc.) cannot be switched using the keyboard as far as I could tell.

Describe the solution you'd like
Pressing Ctrl+Tab would switch tabs, similar to how browser tabs can be switched in this fashion.

Describe alternatives you've considered
Only alternative I could find was clicking the tabs with the mouse, which is not as good ergonomically.

Additional context
This is a standard feature in tabbed interfaces (browsers, shell windows, etc.)
</issue_description>

Comments on the Issue (you are @claude[agent] in this section)

Co-authored-by: ashaduri <2302268+ashaduri@users.noreply.github.com>
@Claude Claude AI changed the title [WIP] Add keyboard navigation for device information tabs Add Ctrl+Tab keyboard navigation for device information tabs Mar 4, 2026
@ashaduri ashaduri requested a review from Copilot March 6, 2026 14:37
@ashaduri
Copy link
Owner

ashaduri commented Mar 6, 2026

@claude[agent] Cycle through sub-tabs as well (present in Advanced tab)

Copy link
Contributor

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 keyboard navigation to the device information window so users can switch between information tabs without using the mouse, aligning behavior with common tabbed UIs.

Changes:

  • Adds GscInfoWindow::on_key_press_event() override to intercept Ctrl+Tab / Ctrl+Shift+Tab.
  • Switches main_notebook pages with wrap-around using Gtk::Notebook page APIs.

Reviewed changes

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

File Description
src/gui/gsc_info_window.h Declares on_key_press_event() override for keyboard-driven tab navigation.
src/gui/gsc_info_window.cpp Implements Ctrl+Tab / Ctrl+Shift+Tab handling to move between notebook pages.

Co-authored-by: ashaduri <2302268+ashaduri@users.noreply.github.com>
@Claude
Copy link
Contributor Author

Claude AI commented Mar 6, 2026

@claude[agent] Cycle through sub-tabs as well (present in Advanced tab)

Done in 9427d82. Ctrl+Tab now cycles through Advanced tab sub-tabs when that tab is active and visible, otherwise cycles through main tabs.

@Claude Claude AI changed the title Add Ctrl+Tab keyboard navigation for device information tabs Add Ctrl+Tab keyboard navigation for device information tabs and sub-tabs Mar 6, 2026
@ashaduri ashaduri requested a review from Copilot March 6, 2026 19:11

This comment was marked as resolved.

ashaduri and others added 3 commits March 7, 2026 16:18
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ashaduri
Copy link
Owner

ashaduri commented Mar 7, 2026

@claude[agent] fix build issues

…code

Co-authored-by: ashaduri <2302268+ashaduri@users.noreply.github.com>
@Claude
Copy link
Contributor Author

Claude AI commented Mar 7, 2026

@claude[agent] fix build issues

Fixed in dcce1f1. The function had corrupted/duplicate code blocks causing syntax errors. Cleaned up to properly structure the lambda helper and main logic flow.

@Claude Claude AI changed the title Add Ctrl+Tab keyboard navigation for device information tabs and sub-tabs Addressing PR comments Mar 7, 2026
@ashaduri ashaduri requested a review from Copilot March 7, 2026 16:38
Copy link
Contributor

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 2 out of 2 changed files in this pull request and generated 1 comment.

if (main_notebook) {
// Check if we're on the Advanced tab with sub-tabs
auto* advanced_notebook = lookup_widget<Gtk::Notebook*>("advanced_notebook");
if (advanced_notebook && advanced_notebook->get_visible()) {
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

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

advanced_notebook->get_visible() reflects the widget's “visible” property, not whether the Advanced page is currently the active page in main_notebook. If Advanced has 2+ visible sub-tabs, this will consume Ctrl+Tab even when the user is on another main tab (it will change the hidden sub-tab selection and return true), so main tab switching won’t work.

Consider gating sub-tab cycling on the Advanced page being the current main_notebook page (e.g., compare main_notebook->get_nth_page(main_notebook->get_current_page()) against the advanced_tab_vbox widget / use page_num()), or check advanced_notebook->get_mapped()/is_drawable() instead of get_visible() before handling the event.

Suggested change
if (advanced_notebook && advanced_notebook->get_visible()) {
if (advanced_notebook && advanced_notebook->is_drawable()) {

Copilot uses AI. Check for mistakes.
Copy link
Owner

Choose a reason for hiding this comment

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

@claude[agent] Fix by checking whether current tab is Advanced

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in b6df8fd. Now checks if Advanced tab is the current active page using page_num() before handling sub-tab cycling. This prevents Ctrl+Tab from being consumed when the user is on other main tabs.

Co-authored-by: ashaduri <2302268+ashaduri@users.noreply.github.com>
@Claude
Copy link
Contributor Author

Claude AI commented Mar 7, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

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.

Switch device information tabs with Ctrl+Tab

3 participants