Repository navigation
設定頁:拆成各區塊元件、同步與通知分類收進子頁、頂欄搜尋 - #487
Merged
Merged
Conversation
Carinoasd
force-pushed
the
perf/io-db-wal
branch
from
November 27, 2026 08:09
f8b4625 to
ca08937
Compare
Carinoasd
force-pushed
the
refactor/settings-ia-search
branch
from
November 27, 2026 08:09
624736b to
947f61d
Compare
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.
疊在 #486 上(base 是
perf/io-db-wal)。不新增設定鍵,不動packages/。1. 檔案拆解與重建範圍
settings_page.dart從 2022 行降到 290 行,只剩骨架:Scaffold、頂欄搜尋鈕、雙欄/單欄排版、Android 權限 cubit。view/sections/(part of settings_page.dart):帳號、外觀、未讀標示、視窗、行為、通知同步、簽到、儲存、進階、備份、除錯、其他。需要本地狀態的(視窗的托盤切換、通知同步的系統通知切換、帳號的登入狀態訂閱)是各自的StatefulWidget。BlocBuilder拿掉了。每個區塊用SettingsSelect(sections/settings_shared.dart,包一層BlocSelector),select回傳只含該區塊讀到的欄位的 record,靠 record 的值比對決定要不要重建。沒有任何區塊回傳整個settingsMap。UploadImageSettingsGroup的參數是整個SettingsMap,外面包一層只選它用到的三個欄位。2. 二級頁
/settings/crossDeviceSyncsettings-cross-device-sync-entry,右側顯示「已關閉」或「已開啟 · N/10 項」。10 項全關時是「已開啟 · 0/10 項」。settings-cross-device-sync,底下一行說明閱讀進度、常用語與屏蔽列表一律同步;10 個子開關沿用settings-crossDeviceSync*。/settings/noticeCategoriessettings-notice-categories,顯示「已開啟 N/8 項」,只在會發系統通知時出現(和原本那一組的條件相同)。notice-category-*、notice-followed-thread-interval、notice-quiet-hours、notice-quiet-start、notice-quiet-end。分類和靜音時段分成兩組。SettingsSubPageBody)。3. 搜尋設定
settings-search)開全螢幕搜尋頁,輸入框settings-search-field。settingsPage.search.keywords,以設定列的 key 對應。為此替 13 個原本沒有 key 的設定列補了ValueKey(主題模式、語言、強調色、字型、文字大小、代理、清除快取、匯出、匯入、關於、更新、通知同步間隔、自動簽到)。onChanged,有副作用的開關(托盤、系統通知、背景服務)行為和在主頁點一樣。pop(該項目)交回SettingsPage,確認mounted後捲到那一列,呼叫它自己的onTap(開彈窗或進頁面)。不會用到已關閉頁面的BuildContext。SettingsPage開對應子頁。ExpansionTile加了maintainState: true,收合時裡面的列仍然建好(不在畫面上),搜尋才找得到。4. 相容性
ValueKey全部保留。唯一的語意變動是settings-cross-device-sync現在在子頁上,主頁入口用新的 key。test_281讀原始碼的路徑改到sections/appearance_section.dart;test_845原本在主頁找通知分類開關,改成找入口列並確認分類開關不在主頁。驗證
dart ./Makefile.dart build、dart ./scripts/check_strict_analyzing.dart:No issues found。test_1425_settings_search_and_subpages_test.dart(16 個):同步入口的狀態文案(含 0/10)、同步子頁與通知分類子頁的 key 與切換、搜尋(關鍵字、標題、群組、多詞、無結果、空輸入)、開關在結果中切換、彈窗由設定頁開啟、子頁項目跳轉、收合的除錯列找得到、三語關鍵字各一、三語關鍵字的 key 一致、改一個開關只重建所在區塊。🤖 Generated with Claude Code