refactor(settings): split Settings.tsx + simplify Advanced labels#416
Merged
Conversation
…plify Advanced labels Settings.tsx (2835 → ~2150 lines) split by logical responsibility: each tab now lives in src/pages/settings/. Pure mechanical extraction — no behavior change. - settings/shared.tsx — SettingRow, Toggle, inputStyle, AsrPresetId - settings/AdvancedSection.tsx - settings/ShortcutsSection.tsx - settings/PermissionsSection.tsx (incl. PermissionPill / HotkeyStatusPill / WindowsImeStatusPill) - settings/LanguageSection.tsx - settings/AboutUpdateControl.tsx - Settings.tsx keeps RecordingSection + ProvidersSection (their helper tangle is large; follow-up PR), re-exports Toggle / AboutUpdateControl so SettingsModal's existing imports keep working. Advanced settings labels: shortened verbose copy across zh-CN / zh-TW / en / ja / ko. "启用流式输入" → "流式输入", "同步写入剪贴板" → "同步到剪贴板", desc / hint blocks trimmed; the toggle already conveys enable/disable so the verb prefix was redundant. Verified: tsc clean, vite build green, cargo check green, cargo test --lib 222/222 passing.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
appergb
pushed a commit
that referenced
this pull request
May 12, 2026
First beta after Stable 1.3.0. Carries the Settings modularization refactor (PR #416). Tagged as v1.3.1-1-beta-tauri to trigger the release-tauri.yml Beta-channel build (prerelease=true, manifest filenames carry -beta suffix so the Stable in-app updater endpoint cannot pick this up).
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.
User description
Summary
Settings.tsxballooned to 2835 lines — well past the 800-line hard-split trigger inCLAUDE.md. This PR moves each tab (Advanced / Shortcuts / Permissions / Language / About) into its own file undersrc/pages/settings/, plus ashared.tsxfor theSettingRow/Toggle/inputStyleatoms used cross-section.Settings.tsxdrops to ~2150 lines and re-exports the public symbols (Toggle,AboutUpdateControl,SettingsSectionId,NAVIGATE_LOCAL_ASR_EVENT) soSettingsModal/FloatingShellkeep working unchanged.RecordingSectionandProvidersSectionstay inSettings.tsxfor now (their helper tangle —HotkeyRecorder,MicrophonePickerDialog,ProviderTools,CredentialField,LocalAsrProviderHint,LLM_PRESETS/ASR_PRESETS— is large; follow-up PR).启用流式输入 → 流式输入,同步写入剪贴板 → 同步到剪贴板, plus trimmedstreamingInsertDescand per-OS hint blocks across all five locales (zh-CN / zh-TW / en / ja / ko). The Toggle next to the label already conveys enable/disable; the prefix was redundant. Long technical detail stays in the description / hint text.Why this is safe
Settings.tsxvia the new directory; the public surface (export { Toggle, AboutUpdateControl, SettingsSectionId, NAVIGATE_LOCAL_ASR_EVENT }) is preserved by re-export.AsrPresetIdwas lifted out of theas constderivation inSettings.tsxintoshared.tsxsoAdvancedSectioncan depend on it without importing back fromSettings.tsx(one-way deps).Test plan
npm run build— tsc clean, vite build green.cargo check --manifest-path src-tauri/Cargo.toml— green (83 pre-existing warnings, unchanged).cargo test --manifest-path src-tauri/Cargo.toml --lib— 222 passed; 0 failed.npx tsx src/lib/providerSetup.test.ts— passes silently (assertion script throws on failure).PR Type
Enhancement
Description
Split Settings.tsx into per-section modules: Advanced, Shortcuts, Permissions, Language, AboutUpdateControl, shared
Shorten Advanced labels and hints across all five locales (zh-CN, zh-TW, en, ja, ko)
Preserve public exports for backward compatibility; zero functional change
File Walkthrough
5 files
Shorten Advanced labels and hints for streaming insert/clipboardShorten Advanced labels and hints in JapaneseShorten Advanced labels and hints in KoreanShorten Advanced labels and hints in Simplified ChineseShorten Advanced labels and hints in Traditional Chinese7 files
Decompose into per-section modules and re-export shared componentsExtract about update control componentExtract Advanced settings tab (streaming insert, local ASR)Extract language selection panelExtract permissions and connectivity status panelExtract shortcut configuration panelExtract shared utilities (Toggle, SettingRow, inputStyle, AsrPresetId)