Repository navigation
feat(native): settings modal with search, general, appearance, chat, threads, keybindings, archive and environments - #30
Merged
Merged
Conversation
Client settings decode per key with the contract's defaults and keep unknown keys; the file is written atomically. Server settings the Threads panel edits decode leniently and save as ServerSettingsPatch entries. Ports settings search and nav order, snooze preset rules, the keymap table, and archive grouping, with tests and a headless probe.
… keybindings, archive and about Cmd+, and the app menu open settings over the current thread: section nav and search, General, Appearance (themes and modes switch live, interface size, chat width), Chat, Labs, Threads (defaults, snooze options, usage limits, auto-settle, streaming), a read-only Keybindings table, Archive with unarchive and delete, and Environments with Disconnect. Server-backed rows save through server.updateSettings and follow config updates.
Adds the web's Open settings action and lists settings search results in the palette; picking one opens the modal at that row.
…fallback fields Both keys now decode once on ServerSettings; a test guards every flattened key against being shadowed.
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.
Problem
The native client had no settings. Theme followed the OS only, per-device preferences could not be changed, server-backed defaults (permissions, workspace, auto-settle, snooze options) were read-only, and there was no way to see archived threads, the keymap, or the connected environment.
Approach
Shell (
crates/app/src/settings/mod.rs,crates/core/src/settings/search.rs). A modal over the current thread: max 1280×960, radius 16, 240px nav, content max 896, asAppRouteModal.tsxand design system §5 describe. It opens from Cmd+, the app menu ("Settings..."), the command palette ("Open settings"), and from palette settings results. Esc clears search first and then closes; the backdrop closes too. Nav order and labels followSETTINGS_NAV_GROUPS. Sections that aren't ported are hidden, and empty groups are dropped. Settings search portssearchSettings(same ranking, keybinding results last) over the rows that exist. Up/Down/Enter work,/and Cmd+F focus search, and a result scrolls to and tints its row. The view only exists while the modal is open.Where edits go (
crates/app/src/settings/store.rs).ClientSettingsSchemakeys insettings.jsonunderT3_NATIVE_HOME.crates/core/src/client_settings.rsdecodes each key on its own with the contract default, keeps unknown keys, and survives a corrupt file. Writes go through the store's existing ordered, coalescing, atomic writer, off the UI thread.ClientSettings(send shortcut, follow-up, plan mode, notification mode) is re-derived from the same file on every edit, so changes take effect live.ServerSettingsPatchentries throughserver.updateSettings. The reply is applied as asettingsUpdatedevent, so every view reads the saved value. A failure shows the web's "Setting not saved / Could not save on {label}: …" above the page.Panels (copy and defaults ported from the named web sources):
SettingsPanels.tsx,NotificationSettings.tsx): thread notifications (default Off), in-app notifications, project grouping (remembers the last repository mode), project order, Working section, unpin/archive/delete confirmations, quit shortcut, time format. Reset buttons appear when a value differs from its default.ThemeSettings.tsx,AppearanceSettingsPanel.tsx,TypographySettings.tsx): System/Light/Dark tiles and the theme library (T3 Code plustokens::BUILT_IN_THEMES). These switch live and atomically throughcrate::theme, stored with the web'st3code:theme/t3code:theme-appearance-modevocabulary. Interface font size (12–20) drives the rem scale. Chat width (comfortable 736 / wide 1152 / full) drives the transcript and composer lane.ThreadsSettingsPanel,ProjectDefaultsSettings.tsx,SnoozePresetsSettings.tsx): add-project base directory, default model, fallback model, permissions, workspace. The snooze options editor covers when, amount stepper, unit, time, remove, add (max 8), the "Menu now" preview, passed/duplicate notes, and reset. Also: usage limits, auto-settle (merged, inactive, days, keep PRs behind thethreadAutoSettlementScopecapability), and response streaming.groupKeybindingRows, labelled withcommandLabel. It reusescrate::keybindingsfor decoding and shortcut labels.ArchivedThreadsPanel.tsx,orchestration.getArchivedShellSnapshot): grouped by project, newest first. Unarchive works from a button or the right-click menu. Delete is in the right-click menu and confirms with a native prompt (theconfirmAndDeleteThreadcopy) while delete confirmation is on.forget_connection), and the app version.Settings primitives (button variants, switch, select with keyboard support, section/group/row) live in
settings/controls.rsand are sized in rems, so the modal follows the interface size.Ledger rows
ST-SHELL, ST-GENERAL, ST-APPEARANCE, ST-CHAT, ST-THREADS, ST-ENVS, ST-LABS, ST-ABOUT, ST-ARCHIVE →
partial; KB-USER native path extended.Verification
cargo test -p t3-core -p t3-clientpasses (new tests cover client settings decoding and round trips, legacyconfirmQuit, theme mode pinning, thread settings defaults and lenient decoding, a guard that no flattened key is shadowed byServerSettings, patch payloads, the update reply through the reducer, snooze labels and editor rules, nav and search ranking, keymap rows and groups, and archive grouping and labels).cargo clippy --workspace --all-targets -- -D warnings,node scripts/gen-theme.ts --check,node --test parity/sync.test.ts,node conformance/generate.ts --checkall pass.crates/client/examples/settings_probe.rs):keymap 81 commands; first: ("Appearance: Cycle", ["⌥⇧⌘A"]), thread settings decoded with defaults.screencapture: could not create image from display). Before/after images still need to be taken.Gaps
server.upsertKeybinding/server.removeKeybinding) wait on KB-USER editing.hiddenThreadTags, and shows a folder icon instead of project favicons.SidebarSettingsdefaults), time format, confirmations, response streaming display. Each feature's owner can readsettings::store::client(cx).Built by Claude Opus 5.5 in Claude Code.