Skip to content

Commit 6cba5ee

Browse files
committed
feat(ui): 每页候选数下限放宽至 2
- 前端 slider min 由 3 改为 2, 支持 2-10 范围 - 分号/引号选第 2/3 候选键加当前页边界保护, 防止候选数=2 时跨页选到下一页首项 - 同步更新 settings-checklist 文档描述
1 parent 1ed1a97 commit 6cba5ee

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

docs/testing/settings-checklist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
| 序号 | 功能 | 配置项 | 初步状态 | 实测状态 | 备注 |
6969
|------|------|--------|----------|----------|------|
7070
| 13 | 字体大小 | `ui.font_size` || | 12-36px |
71-
| 14 | 每页候选数 | `ui.candidates_per_page` || | 3-9|
71+
| 14 | 每页候选数 | `ui.candidates_per_page` || | 2-10|
7272
| 15 | 自定义字体 | `ui.font_path` || | 字体文件路径 |
7373

7474
### 3.2 编码显示

wind_input/internal/coordinator/handle_key_event.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ func (c *Coordinator) HandleKeyEvent(data bridge.KeyEventData) (result *bridge.K
646646
if len(c.inputBuffer) > 0 {
647647
pageStart := (c.currentPage - 1) * c.candidatesPerPage
648648
idx := pageStart + 1
649-
if idx < len(c.candidates) {
649+
if idx < len(c.candidates) && idx-pageStart < c.candidatesPerPage {
650650
return c.selectCandidate(idx)
651651
}
652652
// 候选不足时(含无候选),按 overflow 策略处理
@@ -673,7 +673,7 @@ func (c *Coordinator) HandleKeyEvent(data bridge.KeyEventData) (result *bridge.K
673673
if len(c.inputBuffer) > 0 {
674674
pageStart := (c.currentPage - 1) * c.candidatesPerPage
675675
idx := pageStart + 2
676-
if idx < len(c.candidates) {
676+
if idx < len(c.candidates) && idx-pageStart < c.candidatesPerPage {
677677
return c.selectCandidate(idx)
678678
}
679679
// 候选不足时(含无候选),按 overflow 策略处理

wind_setting/frontend/src/schemas/appearance.schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const candidateWindowSchema: PageSchema = [
4444
key: "ui.candidates_per_page",
4545
label: "每页候选数",
4646
hint: "每页显示的候选词数量",
47-
min: 3,
47+
min: 2,
4848
max: 10,
4949
step: 1,
5050
displayValue: (v) => `${v} 个`,

0 commit comments

Comments
 (0)