fix(#23): 底部控制列自適應流式佈局 — 英文 label 不再截斷#29
Merged
Conversation
#21 未開字型時搜尋會以 charset=None 回退查整個 IDS 資料庫、資料量過大 而崩潰;#22 清空搜尋框時結果區未同步清空、停留在上次搜尋。兩者同屬 搜尋框 callback 路徑,抽單一純函式 resolve_search_action 統一決策 (auto/clear/noop/gate/search),UI 僅負責 dispatch(統一而非添加)。 - hanzi_core: 新增 resolve_search_action 純函式 - glyphs_ui: search_callback 改為依 resolver dispatch;on_glyph_changed 自動跟隨路徑也改走同一 resolver(自動模式搜尋框恆為空),確保「當前字 無資料庫資料(如拉丁字母)」在清空搜尋框與自動跟隨兩路徑一致視為無 選擇而清空;抽 _current_selection_glyph/_current_selection_char /_show_selection_char/_clear_all_results 共用 helper;perform_search 開頭加 #21 防禦性 font guard(defense-in-depth) - localization: 新增 hint_open_font 四語提示(en/zh-Hant/zh-Hans/ja) - tests: 新增 test_resolve_search_action(8 測試涵蓋全分支) 核心邏輯 TDD 驗證(151 passed 零回歸);UI 行為實機驗證通過。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
固定座標假設了字串長度(英文 "Deep Analysis"/"Derived" 比中日文長), 80px/60px 容不下英文 label 而截斷。改以實機量測 checkbox 寬度(sizeToFit) + flow_layout 純函式由左到右流式擺放,滑桿左緣接續其後,所有語言 (en/zh-Hant/zh-Hans/ja)與未來字串都不再截斷。實機四語驗證 OK。 - hanzi_core.py: 新增 flow_layout 純函式(5 tests,先紅後綠) - glyphs_ui.py: _measured_checkbox_width + _layout_bottom_bar;minSize 寬 420→470 - 比照 resolve_search_action:純邏輯 TDD、UI 量測黏合靠實機 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
而崩潰;#22 清空搜尋框時結果區未同步清空、停留在上次搜尋。兩者同屬 搜尋框 callback 路徑,抽單一純函式 resolve_search_action 統一決策 (auto/clear/noop/gate/search),UI 僅負責 dispatch(統一而非添加)。 - hanzi_core: 新增 resolve_search_action 純函式 - glyphs_ui: search_callback 改為依 resolver dispatch;on_glyph_changed 自動跟隨路徑也改走同一 resolver(自動模式搜尋框恆為空),確保「當前字 無資料庫資料(如拉丁字母)」在清空搜尋框與自動跟隨兩路徑一致視為無 選擇而清空;抽 _current_selection_glyph/_current_selection_char /_show_selection_char/_clear_all_results 共用 helper;perform_search 開頭加 #21 防禦性 font guard(defense-in-depth) - localization: 新增 hint_open_font 四語提示(en/zh-Hant/zh-Hans/ja) - tests: 新增 test_resolve_search_action(8 測試涵蓋全分支) 核心邏輯 TDD 驗證(151 passed 零回歸);UI 行為實機驗證通過。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
固定座標假設了字串長度(英文 "Deep Analysis"/"Derived" 比中日文長), 80px/60px 容不下英文 label 而截斷。改以實機量測 checkbox 寬度(sizeToFit) + flow_layout 純函式由左到右流式擺放,滑桿左緣接續其後,所有語言 (en/zh-Hant/zh-Hans/ja)與未來字串都不再截斷。實機四語驗證 OK。 - hanzi_core.py: 新增 flow_layout 純函式(5 tests,先紅後綠) - glyphs_ui.py: _measured_checkbox_width + _layout_bottom_bar;minSize 寬 420→470 - 比照 resolve_search_action:純邏輯 TDD、UI 量測黏合靠實機 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
固定座標假設了字串長度(英文 "Deep Analysis"/"Derived" 比中日文長), 80px/60px 容不下英文 label 而截斷。改以實機量測 checkbox 寬度(sizeToFit) + flow_layout 純函式由左到右流式擺放,滑桿左緣接續其後,所有語言 (en/zh-Hant/zh-Hans/ja)與未來字串都不再截斷。實機四語驗證 OK。 - hanzi_core.py: 新增 flow_layout 純函式(5 tests,先紅後綠) - glyphs_ui.py: _measured_checkbox_width + _layout_bottom_bar;minSize 寬 420→470 - 比照 resolve_search_action:純邏輯 TDD、UI 量測黏合靠實機 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
承接已關閉的 #25(base 分支隨 #24 合併刪除而自動關閉)。內容為 #23 修正,已 rebase 到含 #21/#22/#26 的最新 main。
Closes #23
Co-Authored-By: Claude Fable 5 noreply@anthropic.com