feat: Claude session profiles + light UI mode#2
Merged
Conversation
Profiles are named bundles of env vars merged into a session's pty env at
spawn time. Each value is either a literal string or a reference to a host
env var ($VAR / ${VAR}); unresolved refs are dropped (not passed through
literally) so secrets never leak via missing env.
Use case: rapidly switch the inference backend per session by overriding
ANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN — e.g. swap Anthropic for DeepSeek
or GLM without restarting the app.
Selection precedence:
sessionOptions.profileId (per-session override, "none" = pass-through)
-> global default profile (from profiles.json)
-> no profile
UI:
- New-session popover lists each profile as a launch option (default tagged)
- "Manage profiles…" entry opens a modal: list / create / edit / delete /
set default. Editor enforces env-name regex and previews ref vs literal.
- Configure dialog gets a profile dropdown.
Storage: <userData>/profiles.json (atomic tmp+rename). No encryption — values
are literals or refs, not raw secrets.
Light UI mode: body.theme-light CSS overrides for sidebar, header, dialogs,
inputs. Toggled in Global Settings; persisted to localStorage and applied
at app load. Two new terminal themes (Light, Solarized Light).
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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.
Summary
Adds Claude session profiles — named bundles of env vars (e.g.
ANTHROPIC_BASE_URL,ANTHROPIC_AUTH_TOKEN) merged into a session's pty env at spawn time. Lets you rapidly switch inference backends (Anthropic → DeepSeek → GLM) per session without restarting the app.Also adds a light UI mode + two light terminal themes.
Profiles
Storage:
<userData>/profiles.json(atomic tmp+rename). Plain JSON — values are either literals or references like\$DEEPSEEK_API_KEY/\${DEEPSEEK_API_KEY}resolved against the host process env at spawn time. Unresolved refs are dropped, not passed through literally — so missing host env vars never silently leak fake secrets into Claude.Selection precedence at spawn:
sessionOptions.profileIdif set ('none'= pass-through, ignore default)defaultProfileIdinprofiles.json)UI:
env refvsliteralindicator per value, suggestsANTHROPIC_BASE_URL+ANTHROPIC_AUTH_TOKENfor new profilesExample profile (DeepSeek):
{ \"id\": \"deepseek\", \"name\": \"DeepSeek\", \"env\": { \"ANTHROPIC_BASE_URL\": \"https://api.deepseek.com/anthropic\", \"ANTHROPIC_AUTH_TOKEN\": \"\$DEEPSEEK_API_KEY\", \"ANTHROPIC_MODEL\": \"deepseek-chat\" } }User sets
DEEPSEEK_API_KEYonce viasetx(Windows) / shell rc (mac/linux); profile references it. Switching to GLM or anything else is just a new profile.Light UI mode
theme-lighttoggled via Global Settings → "Light UI Mode". Persisted inlocalStorage, applied at app load (avoids dark-flash).Test plan
npm test→ 145/145 passing (added 14 unit tests for profiles)Files
profiles.jstest/profiles.test.jspublic/profiles-panel.jspreload.jswindow.api.profiles.{list,save,delete,setDefault}main.jsprofilesModule.init; merge resolved profile env intoptyEnvat session spawnpublic/dialogs.jspublic/settings-panel.jspublic/terminal-themes.jslight+solarizedLightterminal themespublic/style.cssbody.theme-lightoverridespublic/app.jspublic/index.htmlprofiles-panel.js🤖 Generated with Claude Code