feat(gui): add category-switch keyboard shortcuts (Alt+arrows / Alt+F)#136
Open
StudentWeis wants to merge 1 commit into
Open
feat(gui): add category-switch keyboard shortcuts (Alt+arrows / Alt+F)#136StudentWeis wants to merge 1 commit into
StudentWeis wants to merge 1 commit into
Conversation
Alt+Right / Alt+Left cycle the content filter (All → Text → Image → Files → All), and Alt+F toggles the favorites-only filter. The two dimensions remain orthogonal, so users can scope to e.g. "favorited images" entirely from the keyboard. Implemented as proper GPUI actions registered via bind_keys so the favorites toggle also fires while the search input is focused (Tab and Alt+arrow are intercepted by the Input context, so cycling is list-focused — consistent with existing j/k/h/l). Refs #135
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
为分类筛选条加上键盘快捷键,避免用户用全局快捷键唤起后还要切到鼠标点筛选按钮(响应 discussion #134)。
Linked Issue
Closes #135
Changes
Alt + →/Alt + ←:在All → Text → Image → Files → All之间循环切换内容分类过滤Alt + F:切换"仅收藏"过滤;与内容分类正交,可组合(如"收藏的图片"),且搜索框聚焦时也生效CycleFilterNext/CycleFilterPrev/ToggleFavoritesFilter),在src/app.rs通过bind_keys注册next_content_filter(current, forward) -> ContentFilter,覆盖单元测试(正向 / 反向循环)src/gui/panel/help.rs新增两行,i18n 键help_cycle_filter/help_toggle_favorites_filter三种语言齐备设计说明
tab/shift-tab绑成了IndentInline/OutdentInline(gpui-component-0.5.1/src/input/state.rs:127-128),用 Tab 会让搜索框里行为不一致。Alt+方向键有同类问题(Input 也绑了MoveToPreviousWord/MoveToNextWord),但只影响"搜索框聚焦时的循环切换"——和现有j/k/h/l在搜索框中失效的语义一致。alt-f,所以全局bind_keys优先级足够。All等价于"无过滤",再按一次Alt+F关闭收藏过滤——和现有点击行为一致(点已激活的过滤按钮会重置)。Testing
scripts/precheck.shpasses locally(cargo check / clippy / test 442 passed / i18n / icons / themes / machete 全部 OK)next_content_filter_cycles_forward/next_content_filter_cycles_backward)Self-Check
thiserror(no manualimpl Display/Error) — N/A,本次无新错误类型