mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-10-26 01:34:51 +08:00
main
59
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ba6a8a5554 |
fix(apps): group Claude Desktop by whether it is installed
Claude Desktop was grouped by whether it was connected to CC Switch, so an installed but unconnected Desktop showed up under "Not installed". `get_claude_desktop_status` now reports `installed`. Desktop has no command to probe, so it is inferred: connected, or Desktop's own data directory (`Claude`, created on its first launch; `Claude-3p` is not counted because CC Switch writes it too) exists, or on macOS a Claude.app bundle is in /Applications or ~/Applications. The apps page groups the Desktop row by it; the row still says whether it is connected. |
||
|
|
2afe8cdbef |
refactor(omp): rename the internal app id from ohmypi to omp
Match the binary name, the Apps page tool id and the i18n keys that already used omp. The app is unreleased, so nothing persisted needs a migration; ohmypi stays accepted as an alias when parsing app ids. Show the app by default like Pi and Kimi Code. |
||
|
|
c8945d2d91 |
feat(omp): add Oh My Pi support
Squashed from #6747 (head
|
||
|
|
d6a2324196 |
feat(kimi): give provider cards real add/remove actions
Kimi is additive, but both card groups only offered "Switch", which wrote the provider into config.toml and changed default_model at once, so the Added / Available split did nothing. - Available cards get "Add": a new add_provider_to_live_config command writes the provider and its models into config.toml without changing default_model, so they show up in Kimi's /model list. A node already in config.toml belongs to Kimi and is never overwritten from the archive. - Added cards get a "Remove" button; "Set as default" (select the provider's model) moves into the more menu, as for OpenCode/OpenClaw. - The provider owning default_model is marked with the gray "Default" status like OpenCode, and cannot be removed. |
||
|
|
e4873bc8aa |
feat(kimi): add Kimi Code support (#8687)
Add Kimi Code as the 12th managed app (additive mode): native multi-provider config in ~/.kimi-code/config.toml (honors KIMI_CODE_HOME), presets derived from the Pi catalog, MCP (stdio/HTTP/SSE), Skills with native-directory protection, global prompts, session browsing/resume, and session-log usage import. Local routing and aggregation do not apply; official OAuth stays managed by Kimi Code. Schema v21 -> v22 adds enabled_kimi columns. |
||
|
|
c7dceb8036 |
feat(agy): integrate Antigravity CLI management (#8268)
Add Antigravity CLI (agy) as a managed app: provider switching for the native login and API-key modes, MCP and Skills sync through ~/.gemini/config, session browsing and session-log usage import. Co-authored-by: peterLwk888 <lwk1124@outlook.com> |
||
|
|
eadfc1516c |
feat(opencode): set the default model from an added provider card
OpenCode picks its startup model from the top-level `model`
("<provider>/<model>") in opencode.json, but CC Switch had no way to set
it, so users had to edit the file by hand after adding providers.
Reuse the OpenClaw "Set as default" card action for OpenCode:
- Backend: `opencode_config::{get,set}_default_model` read/write only the
top-level `model` through the existing format-preserving edit path
(comments kept, `small_model` untouched), rejecting values that are not
"<provider>/<model>". New commands `get_opencode_default_model` and
`set_opencode_default_model`.
- Frontend: the additive section builder's `openclawDefault/openclawModels`
become generic `defaultModel/defaultModelOptions`; the default card is
marked and other added cards get "Set as default" with a model menu.
Model options come from the same fragment the backend writes (a stored
full config is unwrapped) and skip natively disabled models. Built-in
providers that declare no models get no button. Unlike OpenClaw, the
default provider can still be removed, matching the old behavior.
Existing generic notification texts are reused, so no new strings.
Refs #8509
|
||
|
|
6aeaeb17ab |
feat(codex): pick the aggregation sub-agent model and default classic tools on
Aggregation mode used to strip [agents] default_subagent_model, so Codex sub-agents always followed the main model (#8286). Users can now choose a sub-agent model and reasoning effort for aggregation, both in the "Switch to Aggregation" dialog and in a new Aggregation settings sheet on the Stack tab. - The choice is a device setting (settings.json). On every rewrite it is checked against the merged model catalog: an id that is no longer published (member removed, or it is now the default provider) is not written, so sub-agents fall back to the main model instead of every spawn failing, and it comes back when the member is re-added. An effort the model does not support is dropped. - Codex reads [agents] when a thread starts: new conversations pick up a change without a restart; open ones keep the old value. - The classic sub-agent tools toggle moves from Settings into the sheet and is now on by default: with the newer tools the main agent's provider encrypts the task and a sub-agent on another provider gets nothing (#8253). It is stored under a new key, codexStackClassicTools; the old codexStackClassicSubagents key was written as false on every save since v4.0.10, so it is no longer read. - Docs and the four locales updated. |
||
|
|
68411d82fb |
feat(providers): keep uploaded icons in a named "My Icons" library
Uploading an icon used to attach the image to the one provider being edited, shown as a lone "Custom icon" strip above the built-in grid. It had no name, could not be searched and had to be uploaded again for every provider that wanted it. The icon picker now has two groups, filtered by the same search box: - My Icons: the first tile uploads an image. After it is resized, a dialog asks for a name (the file name by default); "Save and Use" stores it in the library and selects it. Library icons show their names, can be picked by any provider in any app, and can be renamed or deleted from the buttons that appear on hover. Uploading an image that is already in the library reuses the existing entry. A current custom icon that is not in the library (for example one from an import link) shows as "Current icon" and can be saved, named after the provider. - Built-in Icons, as before. Clicking an icon now selects it and closes the picker, so the "Done" button is gone; "Clear icon" next to the search box removes the icon. The library lives in the settings table under `custom_icons`, which is already cloud-synced. Providers still store the image itself, not a library id, so renaming or deleting a library entry never changes a provider that uses it, and a provider shows its icon on a device whose library differs. Adding to the library decodes the PNG fully like saving a provider does, caps the library at 100 icons and names at 64 characters. SQL import and cloud sync drop library entries whose image is invalid, alongside the existing provider and universal provider cleanup; unknown fields on the remaining entries are kept. The naming dialog stops its submit event from propagating: React events bubble through portals, so without it saving a name would also submit the provider form the picker is rendered in. The user manual's icon section (2.3, zh/en/ja) describes the new flow. |
||
|
|
bee47fdf48 |
feat(deeplink): let provider links bring their own icon via iconUrl
A provider link can now carry `iconUrl`, an https address of the site's own logo. The confirmation dialog downloads it as soon as it opens and shows it at the top; importing stores it as the card's custom icon. No extra confirmation step. Any failure is silent: the card falls back to the built-in `icon` name, or to the name's initials. The image goes through the same path as a local upload: the backend returns a data URI, the frontend redraws it on a canvas into a 96x96 PNG, and the provider save validation checks it again. The address itself is never stored or rendered, and the import command never downloads. The download (`deeplink/icon_fetch.rs`): - Parsing drops addresses that are not https, use an IP or a non-default port, carry credentials or exceed 2048 characters; the rest of the link still imports. - Every resolved address must be public, and the connection is pinned to them so a second DNS answer cannot point it elsewhere. Redirects are followed by hand, up to 3, and each hop is checked again. - No system proxy, no cookies, no Referer, 5 s overall timeout, body read as a stream and capped at 256 KB. - Content-Type must be PNG, JPEG, WebP or SVG and match the file's magic bytes; bitmap dimensions are read from the header and capped at 4096. - 198.18.0.0/15 is allowed on purpose: Clash and Surge fake-ip mode resolve every domain into it. The trade-off is written next to `is_public_ipv4`. - Errors are logged without the URL, which may carry query tokens. Closes #8117 |
||
|
|
98222d19e3 |
fix(deeplink): stop losing links on cold start and tighten import checks
Deep links that arrived before the frontend was listening were dropped: on Windows/Linux the plugin emits the startup URL before our handler is registered, and Tauri events fired before the JS listener exists (cold start, window rebuilt in lightweight mode) go nowhere. - Keep the parsed link (or parse error) in a backend pending slot with a monotonic id and emit `deeplink-pending`. The dialog peeks on mount and on every notification, and acks by id only after the link is shown, so an interrupted read never loses it and a stale ack never clears a newer link. - Read `get_current()` after registering the URL handler so the startup URL is handled on Windows/Linux. - Drop our own `RunEvent::Opened` handling on macOS; the deep-link plugin already emits it, which made links open twice. - Process pending links serially in the dialog (rerun on notifications that arrive mid-processing) so a late read of an older link can't replace a newer one, including during config merge. The effect no longer depends on `t`, so the startup language sync can't interrupt it. - Reject `configUrl` up front instead of failing after the user confirms. - Accept `mcode` for prompts and `pi`/`mcode` for MCP apps. - Warn on the confirm dialog when the provider will be switched to right away (`enabled=true`), and refresh the tray menu after a provider import. |
||
|
|
0fc67c3b35 |
fix(codex): warn about stale Codex clients on Windows without a process table
The stale-client check reads the process table, which Windows does not have, so neither the model list notice nor the cached-account notice ever appeared there, and the restart button always reported that the daemon was not running. On Windows the managed daemon is now found through its own daemon.pid: the process is opened by pid and counts as running only while it is still active and its creation time matches the recorded one, so a reused pid is not mistaken for it. Restart is only offered for a daemon known to be running, since Codex's restart command starts one otherwise. The desktop app and editor plugins cannot be seen there, so the notice falls back to "changed since you last dismissed it": the model list and login fingerprints are recorded in codex-client-ack.json when the user closes the notice, through the new acknowledge_codex_stale_clients command, and a later change shows it again with wording that says CC Switch cannot tell whether those clients are open. Without a record the current state is taken as acknowledged, so upgrading does not show it, and the first login seen becomes the baseline, so signing in is not reported as an account switch. Closing the notice used to hide it until the app, mode or provider changed, so changing the model list again on the same provider stayed silent on every platform. The stack view now carries a revision derived from the same fingerprints, and the notice reappears once it changes. |
||
|
|
31e5ae3f6a |
feat(sessions): show total tokens and API-price cost in the reader header
The reader toolbar now ends with the session's total tokens and its cost at API prices, using the same totals and formatting as the usage dashboard; hovering shows requests and the input / output / cache split. The new get_session_usage_summary command sums only rows imported from session logs: they carry the client's own session ID and are imported whether or not the request went through the router, while proxy rows carry an inferred ID and would double count. Sessions with no detail rows (scanning off, or older than the 30-day rollup) show nothing. The shared row-to-UsageSummary mapping is extracted so the dashboard summary and the per-session query use one implementation. |
||
|
|
c19c117009 |
feat(ui): set the aggregation default from the card's more menu
After the "start aggregation with this as default" button went away, the aggregation preview showed the default-after-switch but had no control to change it; the default could only be picked in the confirm dialog. Once in aggregation mode it was an icon-only star next to remove. Move "set as default" to the top of each card's more menu on the aggregation tab, in both states, and leave add / remove as the only row actions: - In aggregation mode it takes effect at once, also for providers not added yet (the backend adds the new default to the list). - In direct mode it only records the choice through set_proxy_route; the card moves to the default section and the confirm dialog preselects it. - While routing it is listed but disabled with the reason: the default and the route target are one pointer, so changing it would switch the live route from a preview. On Codex, when the default is an official account and the target is a third-party provider, the item says the official subscription's models won't be part of the aggregation. That was previously a silent side effect of changing the default. Mode-specific menu items come from the presentation builder (CardPresentation.menuItems), like the row buttons. |
||
|
|
c55a36c0bf |
feat(ui): rebuild the accounts center and Hermes memory pages
Accounts center: each service is now one card with a help tip, "Add
account" and a ⋯ menu ("Delete all accounts…" from two accounts up).
Account rows show the default and re-login badges, the sign-in date, how
many providers use the account, the remaining quota with a refresh time,
and a ⋯ menu for set default, sign in again and delete. Waiting, loading,
load-failure and login-failure states are drawn in place. Deleting still
confirms first and names the affected providers. Provider forms keep
their account picker.
Hermes memory: the save button moves to the page header and is the only
solid button. The file tabs mark unsaved edits with a dot and keep drafts
when switching. The enable row shows the real file path, or that Hermes
skips the file while it is off; the editor is a plain monospace area; the
meter shows characters remaining and warns when over the limit. When
changes take effect is said in the toasts, and "Adjust limit in Hermes
Web UI" asks before starting the Web UI.
|
||
|
|
b7a5ef2885 |
feat(ui): follow the spec for preset versions, tray problems and skills storage
Presets: name the Tencent family "Tencent Cloud" (腾讯云), since it also covers pay-as-you-go plans in some apps, and let a family list its versions in design order (Kimi by region, Tencent Lite before Pro). Families without an order keep the preset file order. Tray: a failed tray switch no longer expires after ten minutes. It stays until the app switches successfully or its page is opened in the main window, reported through the new tray_app_page_seen command. Skills storage and sync: turn the sheet into the spec's dialog with a real three-way sync method (auto, symlink only, copy only; auto was shown as symlink before), radio buttons for where the main copy lives, the real CC Switch skills path with an Open button, and a visible line explaining why "Move and switch" is unavailable. |
||
|
|
e9170adb65 |
feat(ui): settle the open v7 follow-ups for presets, tray and panels
Presets: add optional family/versionKey fields so one vendor's regional and plan variants show as a single row in step 1 (Claude 94 presets -> 71 rows) and as a version switch in step 2. Switching versions after the user typed into the form asks first, since the form is refilled. The category field and preset order are unchanged. Tray: show a dot and a problem tooltip on the icon only while the routing service failed to start, fell back to direct, or a tray action failed; spell out that quitting stops the routing service while it is in use; name the default provider in the Stack submenu title; add the "restart X to apply" line after tray switches; refresh the tray when the routing service starts or stops. Panels: record when the background session scan last finished and show the newer of that and a manual sync on the usage page; add resync_mcp_to_apps and resync_skills_to_apps; report per-repo failures from skill discovery and update checks; report ZIP skills skipped because the directory is taken. MCP/Skills bulk actions keep applying to the filtered rows only. |
||
|
|
4f8d1424a6 |
feat(tray): rebuild the tray menu around apps and their modes
The native menu now lists Claude Code, Claude Desktop, Codex, Gemini CLI and Grok Build (hidden apps are skipped; additive apps stay out). Each app row reads "name · mode · provider · quota" and opens a submenu that states the mode and only offers providers that switching can actually use: providers that need routing open the app page with the same needs-routing dialog, official subscriptions are disabled under routing, and the menu is read-only while failover is on instead of silently turning failover off. Projects move into the app submenus. Quota text matches the cards (remaining, "running low" under 10%, no emoji). A problems section appears only when something needs action: the routing service is down while apps use it, an app fell back to direct at startup, or a tray switch failed. On Windows a left click opens the window and a right click shows the menu; macOS and Linux keep the menu on left click. |
||
|
|
b999b07bec |
feat(ui): rebuild the global pages and finish the v7 visual pass
Pages (phase 4): - Usage: v7 layout (filter row, four metrics with more on demand, switchable trend, request log / provider / model / pricing tabs, data sources sheet). Latency becomes output speed: output / (duration - first token), shown only for requests with at least 100 output tokens; provider totals sum output and generation time instead of averaging. - Sessions: single-column list grouped by project or time, drilling into a reader with resume, find, question jump and copy actions. - MCP and Skills share one app matrix (neutral checks, retry on failed writes, column bulk actions with undo); MCP add/edit moves into a drawer with form/JSON modes; Skills merges installed and discover and always shows a Pi column. - Prompts: one page for eight apps including Hermes SOUL.md, enable and disable as buttons, delete with undo instead of a confirm, copy to other apps, import existing files; app pages show the active prompt. - Add provider is two steps: pick a preset (always-on search including Chinese names and domains, categories inferred for display, sorted by name with no promoted entries), then fill the form. Edit pages name the provider and warn when it is the one in use. - App page menu links to that app's usage. Visual pass (phase 6): - Secondary pages cover only the content area so the sidebar stays. - Cmd/Ctrl+K jumps to apps, pages and settings sections. - Legacy button variants, primary color, dialogs, toasts and sheets follow v7 tokens; hard-coded palette classes and 10px text across the remaining components are replaced with tokens. |
||
|
|
4aab608f7c |
feat(ui): add the v7 mode layer to provider pages and routing settings
Switch-style apps (Claude Code, Codex, Gemini CLI, Grok Build) get a mode row (Direct / Routing / Stack). Tabs only change what is viewed; taking effect goes through buttons that state the consequence, with a confirm dialog for entering a proxy mode and a one-step, undoable return to direct. Provider cards are drawn from a per-mode presentation model (status, buttons, chips, queue order, disabled reasons) instead of each card inspecting proxy state, and additive apps get Added / Available sections. Backend: entering a mode can pick the route target in the same step, `get_app_mode` reports the effective mode per app, and startup attach failures are kept for the UI to surface with a retry. Settings gains a Local Routing section (service, listen address, apps using routing, failover tuning) replacing the old proxy tab and toggles. Claude Desktop gets an access bar for model mapping and service state. |
||
|
|
40aa2864a2 |
feat(ui): move to a sidebar shell with global pages and grouped settings
Replace the header toolbar and icon-only app switcher with the v7 shell: - Sidebar (200px, collapses to a 72px icon rail under 960px, Cmd/Ctrl+\ toggles and remembers the choice): the app list with mode tags and "needs attention" dots, then Usage (today's cost), Accounts (re-login dot), MCP, Skills, Prompts and Sessions pinned to the bottom, and an Apps / Settings footer. Settings swaps the sidebar for its own directory. - Every screen gets a 52px page header; Linux in-app window controls sit at its far right. macOS traffic lights move down to centre in the 44px sidebar top bar. - Usage, Accounts, MCP, Skills, Prompts (with an app picker) and Sessions become global pages instead of settings tabs or per-app toolbar buttons. OpenClaw and Hermes switch to their own pages with a segmented control; OpenClaw's env, tools and agents merge into one Config page. - New Apps page: per-app install / upgrade with path and install source, batch upgrade, conflict details, manual commands, and the "show in sidebar" switch that used to live in settings. Tool management moves out of About into a shared hook; a read-only list_tool_installations command feeds the page so it does not share calls with the upgrade preflight. - Settings regroup into General, App config, Local routing, Network, Data and About, using row/card layout. Path settings save per section; switches still save immediately. Skills storage and sync move to a sheet on the Skills page. - New opt-in "check app updates on startup" setting (off by default): when on, a background check puts a neutral dot on Apps. - Switch adopts the v7 track and action colour; env-conflict banner joins the page flow instead of overlaying the header. The old route / Stack / failover toggles stay in the provider page header until the mode tabs land. |
||
|
|
52e0fa8a6c |
feat(proxy): warn when Codex clients hold an old Stack model list
Codex's app-server reads the model catalog once at startup and keeps it, while config.toml is re-read per request. Since 0.159 the codex CLI talks to a managed daemon that only restarts on upgrade, so reopening codex after a Stack change still shows the old model list; the desktop app and editor extensions have the same problem with their own app-servers. In Codex Stack mode the provider list now shows a banner when a running Codex client started before the current catalog was written: - CLI daemon: a button restarts it through Codex's own `codex app-server daemon restart`, after a confirmation that running tasks will be interrupted. Nothing runs when the daemon is not up. - Desktop app / editor extensions: the banner explains how to fully quit and reopen them; CC Switch does not restart them. Staleness is judged against a device-local history of catalog generations (codex-catalog-history.json) rather than file times: an unchanged catalog is not rewritten, and quitting CC Switch removes the catalog pointer and restores it on the next start, so a daemon that survived a CC Switch restart still has the current catalog. Every Codex write and startup records the catalog a newly started Codex would read; processes that started before the oldest recorded generation count as stale. Processes are read with ps on macOS and Linux only; Windows shows no banner for now. |
||
|
|
b925c2bbf7 |
refactor(proxy): rename attached models to Stack mode
The mode that publishes several providers' models in one client model list is now called Stack in both the UI and the code. The feature is unreleased, so persisted names change without aliases: the live-state entry, the pending op, the settings flag and the two commands now use "stack". The proxy's own "attached" state (attached_route, mode.attached, op::ATTACH) keeps its name; it means the proxy contract is in place, not this mode. |
||
|
|
d3acdc2077 |
feat(proxy): make attached models a mode of its own next to routing
Attached models were a per-card toggle inside routing mode. Turn them into an attached mode that sits beside routing: settings show either the routing switch or the attached-mode switch on the main page, for Claude Code and Codex only (Gemini CLI and Grok Build keep routing). Turning one on first sends Claude Code and Codex apps that are in the other mode back to direct. In attached mode the provider list works like the additive apps: Add and Remove put a provider's models into the client's model picker, and "Set as default" picks the provider for unprefixed requests. The default is always on the list and cannot be removed; a new default set from the card, the tray or a project joins it. Official accounts can only be the default. There is no failover: default requests go to the default only, enabling failover is refused under the switch lock, and a late failover result from a request sent before entering attached mode is dropped. The queue is kept for routing mode. Internally attached mode is proxy mode plus PoolState.enabled, written on every proxy entry and committed with the client files. With the bit off nothing is published and the list is kept for next time. Also fix issues found reviewing the first two commits: - strip ChatGPT fingerprint headers only from Codex attached requests - recompute the Codex catalog when an attached member's row is edited - skip a member whose row cannot be projected instead of failing every write, and refuse to attach such rows - keep the gateway discovery switch as an exclusive field so a user's global value survives direct switches - tell the user when the route or config.toml owns the model catalog - read the Codex keychain entry by account key with a three-state result, outside the app lock and off the async runtime - retry the Codex rewrite on the next check when a refreshed official list could not be written |
||
|
|
73c187bee1 |
feat(proxy): attach third-party models to Codex in proxy mode
Merge attached providers' models into the Codex catalog as ccs-<key>/<model> rows after the route's own rows. Each row keeps its provider's tool profile, a fixed comp_hash and its own window; the global window keys move into the rows while models are attached. Attached requests keep their model, never carry the ChatGPT identity headers to a third party, and drop hosted web_search for native Responses gateways that reject it. With the official account as the route, the catalog lists every official model: fetched with the login Codex will use after the operation, cached per workspace, user and Codex version, refreshed in the background, with Codex's bundled list as the fallback. Logins CC Switch does not manage are only read, never refreshed. |
||
|
|
47d062fb9f |
feat(proxy): attach third-party models to Claude Code in proxy mode
Let proxy mode publish extra providers' models to Claude Code's /model picker as ccs-claude-<key>--<model> ids. A request that selects one goes straight to that provider and never touches routing state: no breaker permit or result, no status counters, no in-use update, no failover switch, no model mapping, single-provider timeouts. The list and a permanent key registry live in live-state.json and are committed with the client file in one operation; a failed change reports whether it was dropped or will be rolled forward. Unresolvable prefixed ids are rejected instead of falling back to the route. /v1/models serves the Anthropic-shaped list for gateway model discovery. |
||
|
|
fff09fab85 |
refactor(usage): extract shared models.dev fetch module
Move the models.dev download, response types, and model ID normalization out of the pricing module into src/lib/modelsDev.ts so other features can reuse the same data. The query key becomes ["models-dev"] because the cache now holds the raw catalog rather than pricing-only data. |
||
|
|
15c0b3ce23 |
feat(proxy): keep a per-app direct/proxy mode instead of backing up live files
Local routing no longer takes over a client by backing up its live config and restoring it later. Each routable app (Claude Code, Codex, Gemini CLI, Grok Build) now has a device-local mode in live-state.json: direct or proxy, whether it is attached, the proxy route, and the contract written into the client. proxy_config.enabled is kept only as a mirror for older versions. - Entering proxy mode writes the route's contract (local proxy address, placeholder credential, model aliases, provider-exclusive fields) into the client; leaving re-projects the direct provider. No backups. - The proxy route is independent of the direct provider. Switching while routing changes only the route; if the contract is unchanged the client file is neither read nor written. Failover records the new route and never touches client files. - Current-provider reads go through mode::current::provider_for with an explicit purpose (direct pointer vs. the provider in use); a unit test rejects direct calls to the old getters. - Quitting detaches (writes the direct config back, keeps the mode); startup re-attaches. Legacy takeover state is migrated on startup: backup rows are saved to ~/.cc-switch/backups/proxy-live-backup/ and deleted so an older build cannot replay them. - "Stop routing" returns every app to direct and then stops the server. Applying a project no longer disables routing; it moves the direct provider or the route depending on the mode. A provider used as the route cannot be deleted. - Codex and Grok Build still use their whole-file writers for proxy writes, and all three non-Claude apps for leaving; the direct row is backfilled from live before entering (never for the official Codex card), and leaving to an unbound official Codex card writes config.toml only. - The provider list marks the direct provider while routing. - Removes the backup/restore/hot-switch/crash-recovery paths from the proxy service, the unused tray Auto item, and the downgrade golden test. |
||
|
|
63ed5002e5 |
feat(claude): switch Claude Code by replacing only key fields
Switching, adding the first provider, editing the current provider, sync, universal providers and restoring after the local router all write settings.json through the write engine now. Only endpoint, credential, model and protocol fields plus the provider's own switches are replaced; hooks, plugins, permissions and everything else stay byte-for-byte. The file write and the current-provider pointer commit as one operation, so a crash in between rolls forward on startup. - No more backfill, no common-config snippet and no context-window injection for Claude. Window values left behind by the old injection are cleaned up from a frozen list. - The provider editor shows what settings.json will look like after switching. On save, provider fields go back to the row and other edits go to live as global settings, with a three-way check against external changes and a dialog to resolve conflicts. Row fields that never reach live are listed with a one-click add. - New Claude rows keep commonConfigEnabled: true so older versions that sync the row still merge their snippet. - Presets drop timeout and telemetry keys; a test now requires Claude presets to contain only key or provider-owned fields. |
||
|
|
06082e189d |
feat: add MiniMax Code harness support (#7383)
Add MiniMax Code (mcode) as a managed application: provider and model management through the native custom_provider configuration, MCP servers, Skills, global instructions (AGENTS.md), read-only local session history with resume, and usage import from the native runtime database. Native files shared by the TUI and desktop are written under the native lock with rollback when the database commit fails, unrelated native configuration is preserved, and the data directory honors MINIMAX_DATA_DIR and MAVIS_DATA_DIR. Deleting sessions stays in the native application because they are coupled to runtime state. |
||
|
|
84e75ad24a |
feat(pi): add native coding agent support (#6064)
* feat(pi): add native coding agent support * refactor(pi): align native provider management * fix(pi): allow removing global default provider * feat(pi): refine provider creation experience * refactor(pi): align prompt management UI * feat(pi): refine native prompt and provider UX * fix(pi): size config preview to content * feat(pi): refine native provider management * refactor(pi): remove unused integration paths * fix(pi): address review feedback * test(pi): align model picker assertions * fix(pi): preserve AGENTS.md during restore sync --------- Co-authored-by: Jason <farion1231@gmail.com> |
||
|
|
c49cf96a16 |
fix(grokbuild): complete proxy and deep-link integrations (#5677)
* fix(grokbuild): complete proxy integration * fix(deeplink): preview GrokBuild configs safely * test(app): stabilize provider integration suite * fix(grokbuild): address review feedback * fix(grokbuild): resolve remaining review findings * fix(grokbuild): use native sessions and harden previews |
||
|
|
1c0ee0c58a |
feat(grokbuild): add first-class Grok Build support (#5453)
* feat(grokbuild): add backend integration * feat(grokbuild): add provider and management UI * test(grokbuild): cover configuration and integrations * fix(grokbuild): address backend review feedback * fix(grokbuild): complete UI review feedback * feat(grokbuild): add CLI lifecycle management * fix(grokbuild): align provider icon fallback * test(grokbuild): cover provider icon persistence |
||
|
|
8cdaf90d8d |
refactor: replace JSON deep copy with deepClone helper and extract useTauriEvent hook (#3140)
* refactor: replace JSON.parse(JSON.stringify()) with structuredClone and extract useTauriEvent hook Replace all `JSON.parse(JSON.stringify())` deep copy patterns with native `structuredClone()` across production source (9 occurrences), tests (11 occurrences), and a hand-rolled `deepClone` utility in providerConfigUtils.ts. Add "ES2022" to tsconfig lib for type support. Extract a `useTauriEvent` hook to eliminate the repeated Tauri event listener boilerplate (`useEffect` + `active/disposed` flag + async `listen`) that was duplicated across App.tsx (3 listeners) and useUsageCacheBridge.ts. The hook handles async registration, race-condition guards, and cleanup automatically. * fix: add compatible deepClone helper - Add a shared deepClone helper with a structuredClone runtime guard and fallback. - Route clone call sites through the helper. - Preserve universal-provider-synced listener ordering and drop the dead-directory diff. * fix: harden Tauri event handling - Guard WebDAV sync status events against missing payloads. - Preserve settings query invalidation ordering before showing auto-sync errors. - Simplify useTauriEvent subscriptions to avoid dependency-driven re-listens. --------- Co-authored-by: zcb <zhangchongbiao@qiyuanlab.com> Co-authored-by: Jason <farion1231@gmail.com> |
||
|
|
8b3ad9caf9 |
feat(claude-desktop): add 3P provider switching with proxy gateway
Adds a new ClaudeDesktop AppType that writes Claude Desktop's third-party
inference profile under configLibrary/, sharing _meta.json with other
launchers (Ollama-compatible) so cc-switch can coexist with them.
Two switch modes:
- direct: provider already exposes claude-* / anthropic/claude-* model
ids on Anthropic Messages, Claude Desktop connects to it directly.
- proxy: cc-switch's local proxy acts as the inference gateway,
presenting only claude-* route names to Claude Desktop and mapping
them to real upstream models. Required after Anthropic restricted
Claude Desktop to claude-family ids.
Backend:
- New module claude_desktop_config with snapshot/rollback, official seed
bypass, /claude-desktop/v1/{models,messages} routes, and a single
source of truth for default proxy routes.
- Gateway token persisted in SQLite, validated on every proxied request.
- get_claude_desktop_status surfaces drift signals (stale models,
missing routes, proxy stopped, base URL mismatch, missing token).
Frontend:
- Slim ClaudeDesktopProviderForm independent from ProviderForm,
controlled by a top-level appId guard.
- ProviderList banner consumes the status query (5s polling) and
renders actionable diagnostics.
- ClaudeDesktopRouteToggle in the header to start/stop the local
gateway without touching takeover state.
- Three-locale i18n synchronised.
|
||
|
|
a0b585992a |
feat: add Hermes frontend types, API layer, and hooks (Phase 7)
- Add "hermes" to AppId union type and all exhaustive Record<AppId> - Add HermesModelConfig, HermesAgentConfig, HermesEnvConfig types - Add hermes field to VisibleApps, McpApps, ProxyTakeoverStatus - Create src/lib/api/hermes.ts with Tauri invoke wrappers - Create src/hooks/useHermes.ts with 5 query + 3 mutation hooks - Register hermes in APP_IDS, APP_ICON_MAP (violet color scheme) - Split MCP_SKILLS_APP_IDS into MCP_APP_IDS (includes hermes) and SKILLS_APP_IDS (excludes hermes, since Hermes has no Skills support) - Wire hermes additive-mode into App.tsx (remove/duplicate handlers), ProviderList.tsx (live provider ID query + In Config badge), mutations.ts (cache invalidation on switch/add/delete) - Add Hermes checkbox to McpFormModal - Add basic hermes i18n keys (en/zh/ja) |
||
|
|
3553d05bf0 |
feat(provider): additive provider key lifecycle & fix openclaw serializer panic (#1724)
* feat(provider): support additive provider key lifecycle management
Add `addToLive` parameter to add_provider so callers can opt out of
writing to the live config (e.g. when duplicating an inactive provider).
Add `originalId` parameter to update_provider to support provider key
renames — the old key is removed from live config before the new one
is written.
Frontend: ProviderForm now exposes provider-key input for openclaw app
type, and EditProviderDialog forwards originalId on save. Deep-link
import passes addToLive=true to preserve existing behavior.
* test(provider): add integration tests for additive provider key flows
Cover openclaw provider duplication scenario to verify that a generated
provider key is assigned automatically. Add MSW handlers for
get_openclaw_live_provider_ids, get_openclaw_default_model,
scan_openclaw_config_health, and check_env_conflicts endpoints.
Update EditProviderDialog mock to pass originalId alongside provider.
* fix(openclaw): replace json-five serializer to prevent panic on empty collections
json-five 0.3.1 panics when pretty-printing nested empty maps/arrays.
Switch value_to_rt_value() to serde_json::to_string_pretty() which
produces valid JSON5 output without the panic. Add regression test for
removing the last provider (empty providers map).
* style: apply rustfmt formatting to proxy and provider modules
Reformat chained .header() calls in ClaudeAdapter and StreamCheckService
for consistent alignment. Reorder imports alphabetically in stream_check.
Fix trailing whitespace in transform.rs and merge import lines in
provider/mod.rs.
* style: fix clippy warnings in live.rs and tray.rs
* refactor(provider): simplify live_config_managed and deduplicate tolerant live config checks
- Change live_config_managed from Option<bool> to bool with #[serde(default)]
- Extract repeated tolerant live config query into check_live_config_exists helper
- Fix duplicate key generation to also check live-only provider IDs
- Fix updateProvider test to match new { provider, originalId } call signature
- Add streaming_responses test type annotation for compiler inference
* fix(provider): distinguish legacy providers from db-only when tolerating live config errors
Change `ProviderMeta.live_config_managed` from `bool` to `Option<bool>`
to introduce a three-state semantic:
- `Some(true)`: provider has been written to live config
- `Some(false)`: explicitly db-only, never written to live config
- `None`: legacy data or unknown state (pre-existing providers)
Previously, legacy providers defaulted to `live_config_managed = false`
via `#[serde(default)]`, which silently swallowed live config parse
errors. This could mask genuine configuration issues for providers that
had actually been synced to live config before the field was introduced.
Now, only providers with an explicit `Some(false)` marker tolerate parse
errors; legacy `None` providers surface errors as before, preserving
safety for already-managed configurations.
Also wrap the `ensureQueryData` call for live provider IDs during
duplication in a try/catch so that a malformed config file shows a
user-facing toast instead of silently failing.
Add tests for both the legacy error propagation path and the frontend
duplication failure scenario.
* refactor(provider): unify OMO variant updates with atomic file-then-db writes and rollback
Consolidate the duplicated omo/omo-slim update branches into a single
match on the variant. Write the OMO config file from the in-memory
provider state *before* persisting to the database, so a file-write or
plugin-sync failure leaves the database unchanged. If `add_plugin`
fails after the config file is already written, roll back to the
previous on-disk contents via snapshot/restore.
Also:
- `sync_all_providers_to_live` now skips db-only providers
(`live_config_managed == Some(false)`) instead of attempting to write
them to live config.
- `import_{opencode,openclaw}_providers_from_live` mark imported
providers as `live_config_managed: Some(true)` so they are correctly
recognized during subsequent syncs.
- Extract OmoService helpers: `profile_data_from_provider`,
`snapshot_config_file`, `restore_config_file`, `write_profile_config`,
and the new public `write_provider_config_to_file`.
- Add 9 new tests covering sync skip, legacy restore, import marking,
OMO persistence, file-write failure, and plugin-sync rollback.
* fix(provider): fix additive provider delete/switch regressions and redundancy
- fix(delete): replace stale live_config_managed flag check with
check_live_config_exists so providers written to live before the
flag-flip logic was introduced are still cleaned up on delete
- fix(switch): make write_live_with_common_config return Err instead of
silently returning Ok when config structure is invalid, preventing
live_config_managed from being incorrectly flipped to true
- fix(update): block provider key rename for OMO/OMO Slim categories to
prevent orphaned current-state markers breaking OMO file syncs
- fix(switch): flip live_config_managed to true after successful live
write for DB-only additive providers so sync_all_providers_to_live
includes them on future syncs; roll back live write if DB update fails
- refactor(delete): merge symmetric OMO/OMO-Slim blocks into single
match-on-variant path; hoist DB read to top of additive branch
- refactor(remove_from_live_config): merge OMO/OMO-Slim if/else-if
into single match-on-variant path
- refactor(switch_normal): merge two OMO/OMO-Slim if blocks into one
OpenCode guard with (enable, disable) variant pair
- fix(update): remove redundant duplicate return Ok(true) after OMO
current-state write
* fix(test): use preferred_filename after OMO field rename
The merge from main brought in #1746 which renamed
OmoVariant.filename → preferred_filename, but the test helper
omo_config_path() was not updated, breaking compilation of all
new provider tests.
---------
Co-authored-by: Jason <farion1231@gmail.com>
|
||
|
|
8e2ffbc845 |
feat: add bulk delete for session manager (#1693)
* feat: add bulk delete for session manager * fix: address batch delete review issues * fix: keep session list in sync after batch delete |
||
|
|
8c3f18a9bd |
feat: add session deletion with per-provider cleanup and path safety
Add delete_session Tauri command dispatching to provider-specific deletion logic for all 5 providers (Claude, Codex, Gemini, OpenCode, OpenClaw). Includes path traversal protection via canonicalize + starts_with validation, session ID verification against file contents, frontend confirmation dialog with optimistic cache updates, i18n keys (zh/en/ja), and component tests. |
||
|
|
182015264c |
fix(openclaw): add openclaw to all Record<AppId, T> usages
Expand McpApps interface, APP_IDS, APP_ICON_MAP, enabledCounts initializers, and test mock data to include the openclaw key, resolving TypeScript errors after AppId union was extended. |
||
|
|
28b125b34f |
fix(openclaw): remove MCP/Skills/Prompts support from OpenClaw
OpenClaw only needs provider management functionality, not MCP, Skills, or Prompts features. This commit removes the incorrectly added support: - Revert SCHEMA_VERSION from 6 to 5 (remove v5->v6 migration) - Remove enabled_openclaw field from mcp_servers and skills tables - Remove openclaw field from McpApps and SkillApps structs - Update DAO queries to exclude enabled_openclaw column - Fix frontend components and types to exclude openclaw from MCP/Prompts - Update all related test files |
||
|
|
fedb08e846 |
feat(ui): add OpenClaw support to frontend components
- Update App.tsx with openclaw visibility and skills fallback - Add OpenClaw to AppSwitcher icon and display name maps - Update McpFormModal with openclaw in enabled apps - Update PromptFormModal/Panel with openclaw filename map - Update EndpointSpeedTest with openclaw timeout - Update AppVisibilitySettings with openclaw toggle - Update test state with openclaw defaults |
||
|
|
21754a7349 |
feat(opencode): Phase 7 - Frontend TypeScript type definitions
- Add "opencode" to AppId type in lib/api/types.ts - Extend McpApps interface with opencode field in types.ts - Add OpenCode-specific types: OpenCodeModel, OpenCodeProviderOptions, OpenCodeProviderConfig, OpenCodeMcpServerSpec - Add opencodeConfigDir to Settings interface - Add importOpenCodeFromLive() to providersApi - Fix type errors across components: - AppSwitcher: add opencode to icon/name mappings - McpFormModal: add opencode to enabledApps state - PromptFormModal/Panel: add opencode filename mapping - EndpointSpeedTest: add opencode timeout config - useBaseUrlState: add opencode to appType union - ProxyToggle: add opencode label - App.tsx: handle opencode fallback for SkillsPage - Update ProxyTakeoverStatus with opencode field (always false) - Fix test mocks in tests/msw/state.ts |
||
|
|
ff03ca1e63 |
feat(skills): unified management architecture with SSOT and React Query
- Introduce SSOT (Single Source of Truth) at ~/.cc-switch/skills/ - Add three-app toggle support (Claude/Codex/Gemini) for each skill - Refactor frontend to use TanStack Query hooks instead of manual state - Add UnifiedSkillsPanel for managing installed skills with app toggles - Add useSkills.ts with declarative data fetching hooks - Extend skills.ts API with unified install/uninstall/toggle methods - Support importing unmanaged skills from app directories - Add v2→v3 database migration for new skills table structure |
||
|
|
ddbff070d5 |
feat(settings): add option to skip Claude Code first-run confirmation
Add a new setting to automatically skip Claude Code's onboarding screen by writing hasCompletedOnboarding=true to ~/.claude.json. The setting defaults to enabled for better user experience. - Add set/clear_has_completed_onboarding functions in claude_mcp.rs - Add Tauri commands and frontend API integration - Add toggle in WindowSettings with i18n support (en/zh/ja) - Fix hardcoded Chinese text in tests to use i18n keys |
||
|
|
18207771ad |
feat(proxy): implement per-app takeover mode
Replace global live takeover with granular per-app control: - Add start_proxy_server command (start without takeover) - Add get_proxy_takeover_status to query each app's state - Add set_proxy_takeover_for_app for individual app control - Use live backup existence as SSOT for takeover state - Refactor sync_live_to_provider to eliminate code duplication - Update ProxyToggle to show status per active app |
||
|
|
e6654bd7f9 |
refactor(proxy): remove is_proxy_target in favor of failover_queue
- Remove `is_proxy_target` field from Provider struct (Rust & TypeScript) - Remove related DAO methods: get_proxy_target_provider, set_proxy_target - Remove deprecated Tauri commands: get_proxy_targets, set_proxy_target - Add `is_available()` method to CircuitBreaker for availability checks without consuming HalfOpen probe permits (used in select_providers) - Keep `allow_request()` for actual request gating with permit tracking - Update stream_check to use failover_queue instead of is_proxy_target - Clean up commented-out reset circuit breaker button in ProviderActions - Remove unused useProxyTargets and useSetProxyTarget hooks |
||
|
|
d38fcd63ea |
Refactor/UI (#273)
* feat(components): add reusable full-screen panel components
Add new full-screen panel components to support the UI refactoring:
- FullScreenPanel: Reusable full-screen layout component with header,
content area, and optional footer. Provides consistent layout for
settings, prompts, and other full-screen views.
- PromptFormPanel: Dedicated panel for creating and editing prompts
with markdown preview support. Features real-time validation and
integrated save/cancel actions.
- AgentsPanel: Panel component for managing agent configurations.
Provides a consistent interface for agent CRUD operations.
- RepoManagerPanel: Full-featured repository manager panel for Skills.
Supports repository listing, addition, deletion, and configuration
management with integrated validation.
These components establish the foundation for the upcoming settings
page migration from dialog-based to full-screen layout.
* refactor(settings): migrate from dialog to full-screen page layout
Complete migration of settings from modal dialog to dedicated full-screen
page, improving UX and providing more space for configuration options.
Changes:
- Remove SettingsDialog component (legacy modal-based interface)
- Add SettingsPage component with full-screen layout using FullScreenPanel
- Refactor App.tsx routing to support dedicated settings page
* Add settings route handler
* Update navigation logic from dialog-based to page-based
* Integrate with existing app switcher and provider management
- Update ImportExportSection to work with new page layout
* Improve spacing and layout for better readability
* Enhanced error handling and user feedback
* Better integration with page-level actions
- Enhance useSettings hook to support page-based workflow
* Add navigation state management
* Improve settings persistence logic
* Better error boundary handling
Benefits:
- More intuitive navigation with dedicated settings page
- Better use of screen space for complex configurations
- Improved accessibility with clearer visual hierarchy
- Consistent with modern desktop application patterns
- Easier to extend with new settings sections
This change is part of the larger UI refactoring initiative to modernize
the application interface and improve user experience.
* refactor(forms): simplify and modernize form components
Comprehensive refactoring of form components to reduce complexity,
improve maintainability, and enhance user experience.
Provider Forms:
- CodexCommonConfigModal & CodexConfigSections
* Simplified state management with reduced boilerplate
* Improved field validation and error handling
* Better layout with consistent spacing
* Enhanced model selection with visual indicators
- GeminiCommonConfigModal & GeminiConfigSections
* Streamlined authentication flow (OAuth vs API Key)
* Cleaner form layout with better grouping
* Improved validation feedback
* Better integration with parent components
- CommonConfigEditor
* Reduced from 178 to 68 lines (-62% complexity)
* Extracted reusable form patterns
* Improved JSON editing with syntax validation
* Better error messages and recovery options
- EndpointSpeedTest
* Complete rewrite for better UX
* Real-time testing progress indicators
* Enhanced error handling with retry logic
* Visual feedback for test results (color-coded latency)
MCP & Prompts:
- McpFormModal
* Simplified from 581 to ~360 lines
* Better stdio/http server type handling
* Improved form validation
* Enhanced multi-app selection (Claude/Codex/Gemini)
- PromptPanel
* Cleaner integration with PromptFormPanel
* Improved list/grid view switching
* Better state management for editing workflows
* Enhanced delete confirmation with safety checks
Code Quality Improvements:
- Reduced total lines by ~251 lines (-24% code reduction)
- Eliminated duplicate validation logic
- Improved TypeScript type safety
- Better component composition and separation of concerns
- Enhanced accessibility with proper ARIA labels
These changes make forms more intuitive, responsive, and easier to
maintain while reducing bundle size and improving runtime performance.
* style(ui): modernize component layouts and visual design
Update UI components with improved layouts, visual hierarchy, and
modern design patterns for better user experience.
Navigation & Brand Components:
- AppSwitcher
* Enhanced visual design with better spacing
* Improved active state indicators
* Smoother transitions and hover effects
* Better mobile responsiveness
- BrandIcons
* Optimized icon rendering performance
* Added support for more provider icons
* Improved SVG handling and fallbacks
* Better scaling across different screen sizes
Editor Components:
- JsonEditor
* Enhanced syntax highlighting
* Better error visualization
* Improved code formatting options
* Added line numbers and code folding support
- UsageScriptModal
* Complete layout overhaul (1239 lines refactored)
* Better script editor integration
* Improved template selection UI
* Enhanced preview and testing panels
* Better error feedback and validation
Provider Components:
- ProviderCard
* Redesigned card layout with modern aesthetics
* Better information density and readability
* Improved action buttons placement
* Enhanced status indicators (active/inactive)
- ProviderList
* Better grid/list view layouts
* Improved drag-and-drop visual feedback
* Enhanced sorting indicators
- ProviderActions
* Streamlined action menu
* Better icon consistency
* Improved tooltips and accessibility
Usage & Footer:
- UsageFooter
* Redesigned footer layout
* Better quota visualization
* Improved refresh controls
* Enhanced error states
Design System Updates:
- dialog.tsx (shadcn/ui component)
* Updated to latest design tokens
* Better overlay animations
* Improved focus management
- index.css
* Added 65 lines of global utility classes
* New animation keyframes
* Enhanced color variables for dark mode
* Improved typography scale
- tailwind.config.js
* Extended theme with new design tokens
* Added custom animations and transitions
* New spacing and sizing utilities
* Enhanced color palette
Visual Improvements:
- Consistent border radius across components
- Unified shadow system for depth perception
- Better color contrast for accessibility (WCAG AA)
- Smoother animations and transitions
- Improved dark mode support
These changes create a more polished, modern interface while
maintaining consistency with the application's design language.
* chore: update dialogs, i18n and improve component integration
Various functional updates and improvements across provider dialogs,
MCP panel, skills page, and internationalization.
Provider Dialogs:
- AddProviderDialog
* Simplified form state management
* Improved preset selection workflow
* Better validation error messages
* Enhanced template variable handling
- EditProviderDialog
* Streamlined edit flow with better state synchronization
* Improved handling of live config backfilling
* Better error recovery for failed updates
* Enhanced integration with parent components
MCP & Skills:
- UnifiedMcpPanel
* Reduced complexity from 140+ to ~95 lines
* Improved multi-app server management
* Better server type detection (stdio/http)
* Enhanced server status indicators
* Cleaner integration with MCP form modal
- SkillsPage
* Simplified navigation and state management
* Better integration with RepoManagerPanel
* Improved error handling for repository operations
* Enhanced loading states
- SkillCard
* Minor layout adjustments
* Better action button placement
Environment & Configuration:
- EnvWarningBanner
* Improved conflict detection messages
* Better visual hierarchy for warnings
* Enhanced dismissal behavior
- tauri.conf.json
* Updated build configuration
* Added new window management options
Internationalization:
- en.json & zh.json
* Added 17 new translation keys for new features
* Updated existing keys for better clarity
* Added translations for new settings page
* Improved consistency across UI text
Code Cleanup:
- mutations.ts
* Removed 14 lines of unused mutation definitions
* Cleaned up deprecated query invalidation logic
* Better type safety for mutation parameters
Overall Impact:
- Reduced total lines by 51 (-10% in affected files)
- Improved component integration and data flow
- Better error handling and user feedback
- Enhanced i18n coverage for new features
These changes improve the overall polish and integration of various
components while removing technical debt and unused code.
* feat(backend): add auto-launch functionality
Implement system auto-launch feature to allow CC-Switch to start
automatically on system boot, improving user convenience.
Backend Implementation:
- auto_launch.rs: New module for auto-launch management
* Cross-platform support using auto-launch crate
* Enable/disable auto-launch with system integration
* Proper error handling for permission issues
* Platform-specific implementations (macOS/Windows/Linux)
Command Layer:
- Add get_auto_launch command to check current status
- Add set_auto_launch command to toggle auto-start
- Integrate commands with settings API
Settings Integration:
- Extend Settings struct with auto_launch field
- Persist auto-launch preference in settings store
- Automatic state synchronization on app startup
Dependencies:
- Add auto-launch ^0.5.0 to Cargo.toml
- Update Cargo.lock with new dependency tree
Technical Details:
- Uses platform-specific auto-launch mechanisms:
* macOS: Login Items via LaunchServices
* Windows: Registry Run key
* Linux: XDG autostart desktop files
- Handles edge cases like permission denials gracefully
- Maintains settings consistency across app restarts
This feature enables users to have CC-Switch readily available
after system boot without manual intervention, particularly useful
for users who frequently switch between API providers.
* refactor(settings): enhance settings page with auto-launch integration
Complete refactoring of settings page architecture to integrate auto-launch
feature and improve overall settings management workflow.
SettingsPage Component:
- Integrate auto-launch toggle with WindowSettings section
- Improve layout and spacing for better visual hierarchy
- Enhanced error handling for settings operations
- Better loading states during settings updates
- Improved accessibility with proper ARIA labels
WindowSettings Component:
- Add auto-launch switch with real-time status
- Integrate with backend auto-launch commands
- Proper error feedback for permission issues
- Visual indicators for current auto-launch state
- Tooltip guidance for auto-launch functionality
useSettings Hook (Major Refactoring):
- Complete rewrite reducing complexity by ~30%
- Better separation of concerns with dedicated handlers
- Improved state management using React Query
- Enhanced auto-launch state synchronization
* Fetch auto-launch status on mount
* Real-time updates on toggle
* Proper error recovery
- Optimized re-renders with better memoization
- Cleaner API for component integration
- Better TypeScript type safety
Settings API:
- Add getAutoLaunch() method
- Add setAutoLaunch(enabled: boolean) method
- Type-safe Tauri command invocations
- Proper error propagation to UI layer
Architecture Improvements:
- Reduced hook complexity from 197 to ~140 effective lines
- Eliminated redundant state management logic
- Better error boundaries and fallback handling
- Improved testability with clearer separation
User Experience Enhancements:
- Instant visual feedback on auto-launch toggle
- Clear error messages for permission issues
- Loading indicators during async operations
- Consistent behavior across all platforms
This refactoring provides a solid foundation for future settings
additions while maintaining code quality and user experience.
* refactor(ui): optimize FullScreenPanel, Dialog and App routing
Comprehensive refactoring of core UI components to improve code quality,
maintainability, and user experience.
FullScreenPanel Component:
- Enhanced props interface with better TypeScript types
- Improved layout flexibility with customizable padding
- Better header/footer composition patterns
- Enhanced scroll behavior for long content
- Added support for custom actions in header
- Improved responsive design for different screen sizes
- Better integration with parent components
- Cleaner prop drilling with context where appropriate
Dialog Component (shadcn/ui):
- Updated to latest component patterns
- Improved animation timing and easing
- Better focus trap management
- Enhanced overlay styling with backdrop blur
- Improved accessibility (ARIA labels, keyboard navigation)
- Better close button positioning and styling
- Enhanced mobile responsiveness
- Cleaner composition with DialogHeader/Footer
App Component Routing:
- Refactored routing logic for better clarity
- Improved state management for navigation
- Better integration with settings page
- Enhanced error boundary handling
- Cleaner separation of layout concerns
- Improved provider context propagation
- Better handling of deep links
- Optimized re-renders with React.memo where appropriate
Code Quality Improvements:
- Reduced prop drilling with better component composition
- Improved TypeScript type safety
- Better separation of concerns
- Enhanced code readability with clearer naming
- Eliminated redundant logic
Performance Optimizations:
- Reduced unnecessary re-renders
- Better memoization of callbacks
- Optimized component tree structure
- Improved event handler efficiency
User Experience:
- Smoother transitions and animations
- Better visual feedback for interactions
- Improved loading states
- More consistent behavior across features
These changes create a more maintainable and performant foundation
for the application's UI layer while improving the overall user
experience with smoother interactions and better visual polish.
* refactor(features): modernize Skills, Prompts and Agents components
Major refactoring of feature components to improve code quality,
user experience, and maintainability.
SkillsPage Component (299 lines refactored):
- Complete rewrite of layout and state management
- Better integration with RepoManagerPanel
- Improved navigation between list and detail views
- Enhanced error handling with user-friendly messages
- Better loading states with skeleton screens
- Optimized re-renders with proper memoization
- Cleaner separation between list and form views
- Improved skill card interactions
- Better responsive design for different screen sizes
RepoManagerPanel Component (370 lines refactored):
- Streamlined repository management workflow
- Enhanced form validation with real-time feedback
- Improved repository list with better visual hierarchy
- Better handling of git operations (clone, pull, delete)
- Enhanced error recovery for network issues
- Cleaner state management reducing complexity
- Improved TypeScript type safety
- Better integration with Skills backend API
- Enhanced loading indicators for async operations
PromptPanel Component (249 lines refactored):
- Modernized layout with FullScreenPanel integration
- Better separation between list and edit modes
- Improved prompt card design with better readability
- Enhanced search and filter functionality
- Cleaner state management for editing workflow
- Better integration with PromptFormPanel
- Improved delete confirmation with safety checks
- Enhanced keyboard navigation support
PromptFormPanel Component (238 lines refactored):
- Streamlined form layout and validation
- Better markdown editor integration
- Real-time preview with syntax highlighting
- Improved validation error display
- Enhanced save/cancel workflow
- Better handling of large prompt content
- Cleaner form state management
- Improved accessibility features
AgentsPanel Component (33 lines modified):
- Minor layout adjustments for consistency
- Better integration with FullScreenPanel
- Improved placeholder states
- Enhanced error boundaries
Type Definitions (types.ts):
- Added 10 new type definitions
- Better type safety for Skills/Prompts/Agents
- Enhanced interfaces for repository management
- Improved typing for form validations
Architecture Improvements:
- Reduced component coupling
- Better prop interfaces with explicit types
- Improved error boundaries
- Enhanced code reusability
- Better testing surface
User Experience Enhancements:
- Smoother transitions between views
- Better visual feedback for actions
- Improved error messages
- Enhanced loading states
- More intuitive navigation flows
- Better responsive layouts
Code Quality:
- Net reduction of 29 lines while adding features
- Improved code organization
- Better naming conventions
- Enhanced documentation
- Cleaner control flow
These changes significantly improve the maintainability and user
experience of core feature components while establishing consistent
patterns for future development.
* style(ui): refine component layouts and improve visual consistency
Comprehensive UI polish across multiple components to enhance visual
design, improve user experience, and maintain consistency.
UsageScriptModal Component (1302 lines refactored):
- Complete layout overhaul for better usability
- Improved script editor with syntax highlighting
- Better template selection interface
- Enhanced test/preview panels with clearer separation
- Improved error feedback and validation messages
- Better modal sizing and responsiveness
- Cleaner tab navigation between sections
- Enhanced code formatting and readability
- Improved loading states for async operations
- Better integration with parent components
MCP Components:
- McpFormModal (42 lines):
* Streamlined form layout
* Better server type selection (stdio/http)
* Improved field grouping and labels
* Enhanced validation feedback
- UnifiedMcpPanel (14 lines):
* Minor layout adjustments
* Better list item spacing
* Improved server status indicators
* Enhanced action button placement
Provider Components:
- ProviderCard (11 lines):
* Refined card layout and spacing
* Better visual hierarchy
* Improved badge placement
* Enhanced hover effects
- ProviderList (5 lines):
* Minor grid layout adjustments
* Better drag-and-drop visual feedback
- GeminiConfigSections (4 lines):
* Field label alignment
* Improved spacing consistency
Editor & Footer Components:
- JsonEditor (13 lines):
* Better editor height management
* Improved error display
* Enhanced syntax highlighting
- UsageFooter (10 lines):
* Refined footer layout
* Better quota display
* Improved refresh button placement
Settings & Environment:
- ImportExportSection (24 lines):
* Better button layout
* Improved action grouping
* Enhanced visual feedback
- EnvWarningBanner (4 lines):
* Refined alert styling
* Better dismiss button placement
Global Styles (index.css):
- Added 11 lines of utility classes
- Improved transition timing
- Better focus indicators
- Enhanced scrollbar styling
- Refined spacing utilities
Design Improvements:
- Consistent spacing using design tokens
- Unified color palette application
- Better typography hierarchy
- Improved shadow system for depth
- Enhanced interactive states (hover, active, focus)
- Better border radius consistency
- Refined animation timings
Accessibility:
- Improved focus indicators
- Better keyboard navigation
- Enhanced screen reader support
- Improved color contrast ratios
Code Quality:
- Net increase of 68 lines due to UsageScriptModal improvements
- Better component organization
- Cleaner style application
- Reduced style duplication
These visual refinements create a more polished and professional
interface while maintaining excellent usability and accessibility
standards across all components.
* chore(i18n): add auto-launch translation keys
Add translation keys for new auto-launch feature to support
multi-language interface.
Translation Keys Added:
- autoLaunch: Label for auto-launch toggle
- autoLaunchDescription: Explanation of auto-launch functionality
- autoLaunchEnabled: Status message when enabled
Languages Updated:
- Chinese (zh.json): 简体中文翻译
- English (en.json): English translations
The translations maintain consistency with existing terminology
and provide clear, user-friendly descriptions of the auto-launch
feature across both supported languages.
* test: update test suites to match component refactoring
Comprehensive test updates to align with recent component refactoring
and new auto-launch functionality.
Component Tests:
- AddProviderDialog.test.tsx (10 lines):
* Updated test cases for new dialog behavior
* Enhanced mock data for preset selection
* Improved assertions for validation
- ImportExportSection.test.tsx (16 lines):
* Updated for new settings page integration
* Enhanced test coverage for error scenarios
* Better mock state management
- McpFormModal.test.tsx (60 lines):
* Extensive updates for form refactoring
* New test cases for multi-app selection
* Enhanced validation testing
* Better coverage of stdio/http server types
- ProviderList.test.tsx (11 lines):
* Updated for new card layout
* Enhanced drag-and-drop testing
- SettingsDialog.test.tsx (96 lines):
* Major updates for SettingsPage migration
* New test cases for auto-launch functionality
* Enhanced integration test coverage
* Better async operation testing
Hook Tests:
- useDirectorySettings.test.tsx (32 lines):
* Updated for refactored hook logic
* Enhanced test coverage for edge cases
- useDragSort.test.tsx (36 lines):
* Simplified test cases
* Better mock implementation
* Improved assertions
- useImportExport tests (16 lines total):
* Updated for new error handling
* Enhanced test coverage
- useMcpValidation.test.tsx (23 lines):
* Updated validation test cases
* Better coverage of error scenarios
- useProviderActions.test.tsx (48 lines):
* Extensive updates for hook refactoring
* New test cases for provider operations
* Enhanced mock data
- useSettings.test.tsx (12 lines):
* New test cases for auto-launch
* Enhanced settings state testing
* Better async operation coverage
Integration Tests:
- App.test.tsx (41 lines):
* Updated for new routing logic
* Enhanced navigation testing
* Better component integration coverage
- SettingsDialog.test.tsx (88 lines):
* Complete rewrite for SettingsPage
* New integration test scenarios
* Enhanced user workflow testing
Mock Infrastructure:
- handlers.ts (117 lines):
* Major updates for MSW handlers
* New handlers for auto-launch commands
* Enhanced error simulation
* Better request/response mocking
- state.ts (37 lines):
* Updated mock state structure
* New state for auto-launch
* Enhanced state reset functionality
- tauriMocks.ts (10 lines):
* Updated mock implementations
* Better type safety
- server.ts & testQueryClient.ts:
* Minor cleanup (2 lines removed)
Test Infrastructure Improvements:
- Better test isolation
- Enhanced mock data consistency
- Improved async operation testing
- Better error scenario coverage
- Enhanced integration test patterns
Coverage Improvements:
- Net increase of 195 lines of test code
- Better coverage of edge cases
- Enhanced error path testing
- Improved integration test scenarios
- Better mock infrastructure
All tests now pass with the refactored components while maintaining
comprehensive coverage of functionality and edge cases.
* style(ui): improve window dragging and provider card styles
* fix(skills): resolve third-party skills installation failure
- Add skills_path field to Skill struct
- Use skills_path to construct correct source path during installation
- Fix installation for repos with custom skill subdirectories
* feat(icon): add icon type system and intelligent inference logic
Introduce a new icon system for provider customization:
- Add IconMetadata and IconPreset interfaces in src/types/icon.ts
- Define structure for icon name, display name, category, keywords
- Support default color configuration per icon
- Implement smart icon inference in src/config/iconInference.ts
- Create iconMappings for 25+ AI providers and cloud platforms
- Include Claude, DeepSeek, Qwen, Kimi, Google, AWS, Azure, etc.
- inferIconForPreset(): match provider name to icon config
- addIconsToPresets(): batch apply icons to preset arrays
- Support fuzzy matching for flexible name recognition
This foundation enables automatic icon assignment when users add
providers, improving visual identification in the provider list.
* feat(ui): add icon picker, color picker and provider icon components
Implement comprehensive icon selection system for provider customization:
## New Components
### ProviderIcon (src/components/ProviderIcon.tsx)
- Render SVG icons by name with automatic fallback
- Display provider initials when icon not found
- Support custom sizing via size prop
- Use dangerouslySetInnerHTML for inline SVG rendering
### IconPicker (src/components/IconPicker.tsx)
- Grid-based icon selection with visual preview
- Real-time search filtering by name and keywords
- Integration with icon metadata for display names
- Responsive grid layout (6-10 columns based on screen)
### ColorPicker (src/components/ColorPicker.tsx)
- 12 preset colors for quick selection
- Native color input for custom color picking
- Hex input field for precise color entry
- Visual feedback for selected color state
## Icon Assets (src/icons/extracted/)
- 38 high-quality SVG icons for AI providers and platforms
- Includes: OpenAI, Claude, DeepSeek, Qwen, Kimi, Gemini, etc.
- Cloud platforms: AWS, Azure, Google Cloud, Cloudflare
- Auto-generated index.ts with getIcon/hasIcon helpers
- Metadata system with searchable keywords per icon
## Build Scripts
- scripts/extract-icons.js: Extract icons from simple-icons
- scripts/generate-icon-index.js: Generate TypeScript index file
* feat(provider): integrate icon system into provider UI components
Add icon customization support to provider management interface:
## Type System Updates
### Provider Interface (src/types.ts)
- Add optional `icon` field for icon name (e.g., "openai", "anthropic")
- Add optional `iconColor` field for hex color (e.g., "#00A67E")
### Form Schema (src/lib/schemas/provider.ts)
- Extend providerSchema with icon and iconColor optional fields
- Maintain backward compatibility with existing providers
## UI Components
### ProviderCard (src/components/providers/ProviderCard.tsx)
- Display ProviderIcon alongside provider name
- Add icon container with hover animation effect
- Adjust layout spacing for icon placement
- Update translate offsets for action buttons
### BasicFormFields (src/components/providers/forms/BasicFormFields.tsx)
- Add icon preview section showing current selection
- Implement fullscreen icon picker dialog
- Auto-apply default color from icon metadata on selection
- Display provider name and icon status in preview
### AddProviderDialog & EditProviderDialog
- Pass icon fields through form submission
- Preserve icon data during provider updates
This enables users to visually distinguish providers in the list
with custom icons, improving UX for multi-provider setups.
* feat(backend): add icon fields to Provider model and default mappings
Extend Rust backend to support provider icon customization:
## Provider Model (src-tauri/src/provider.rs)
- Add `icon: Option<String>` field for icon name
- Add `icon_color: Option<String>` field for hex color
- Use serde rename `iconColor` for frontend compatibility
- Apply skip_serializing_if for clean JSON output
- Update Provider::new() to initialize icon fields as None
## Provider Defaults (src-tauri/src/provider_defaults.rs) [NEW]
- Define ProviderIcon struct with name and color fields
- Create DEFAULT_PROVIDER_ICONS static HashMap with 23 providers:
- AI providers: OpenAI, Anthropic, Claude, Google, Gemini,
DeepSeek, Kimi, Moonshot, Zhipu, MiniMax, Baidu, Alibaba,
Tencent, Meta, Microsoft, Cohere, Perplexity, Mistral, HuggingFace
- Cloud platforms: AWS, Azure, Huawei, Cloudflare
- Implement infer_provider_icon() with exact and fuzzy matching
- Add unit tests for matching logic (exact, fuzzy, case-insensitive)
## Deep Link Support (src-tauri/src/deeplink.rs)
- Initialize icon fields when creating Provider from deep link import
## Module Registration (src-tauri/src/lib.rs)
- Register provider_defaults module
## Dependencies (Cargo.toml)
- Add once_cell for lazy static initialization
This backend support enables icon persistence and future features
like auto-icon inference during provider creation.
* chore(i18n): add translations for icon picker and provider icon
Add Chinese and English translations for icon customization feature:
## Icon Picker (iconPicker)
- search: "Search Icons" / "搜索图标"
- searchPlaceholder: "Enter icon name..." / "输入图标名称..."
- noResults: "No matching icons found" / "未找到匹配的图标"
- category.aiProvider: "AI Providers" / "AI 服务商"
- category.cloud: "Cloud Platforms" / "云平台"
- category.tool: "Dev Tools" / "开发工具"
- category.other: "Other" / "其他"
## Provider Icon (providerIcon)
- label: "Icon" / "图标"
- colorLabel: "Icon Color" / "图标颜色"
- selectIcon: "Select Icon" / "选择图标"
- preview: "Preview" / "预览"
These translations support the new icon picker UI components
and provider form icon selection interface.
* style(ui): refine header layout and AppSwitcher color scheme
Improve application header and component styling:
## App.tsx Header Layout
- Wrap title and settings button in flex container with gap
- Add vertical divider between title and settings icon
- Apply responsive padding (pl-1 sm:pl-2)
- Reformat JSX for better readability (prettier)
- Fix string template formatting in className
## AppSwitcher Color Update
- Change Claude tab gradient from orange/amber to teal/emerald/green
- Update shadow color to match new teal theme
- Change hover color from orange-500 to teal-500
- Align visual style with emerald/teal brand colors
## Dialog Component Cleanup
- Remove default close button (X icon) from DialogContent
- Allow parent components to control close button placement
- Remove unused lucide-react X import
## index.css Header Border
- Add top border (2px solid) to glass-header
- Apply to both light and dark mode variants
- Improve visual separation of header area
These changes enhance visual consistency and modernize the UI
appearance with a cohesive teal color scheme.
* chore(deps): add icon library and update preset configurations
Add dependencies and utility scripts for icon system:
## Dependencies (package.json)
- Add @lobehub/icons-static-svg@1.73.0
- High-quality SVG icon library for AI providers
- Source for extracted icons in src/icons/extracted/
- Update pnpm-lock.yaml accordingly
## Provider Preset Updates (src/config/claudeProviderPresets.ts)
- Add optional `icon` and `iconColor` fields to ProviderPreset interface
- Apply to Anthropic Official preset as example:
- icon: "anthropic"
- iconColor: "#D4915D"
- Future presets can include default icon configurations
## Utility Script (scripts/filter-icons.js) [NEW]
- Helper script for filtering and managing icon assets
- Supports icon discovery and validation workflow
- Complements extract-icons.js and generate-icon-index.js
This completes the icon system infrastructure, providing all
necessary tools and dependencies for icon customization.
* refactor(ui): simplify AppSwitcher styles and migrate to local SVG icons
- Replace complex gradient animations with clean, minimal tab design
- Migrate from @lobehub/icons CDN to local SVG assets for better reliability
- Fix clippy warning in error.rs (use inline format args)
- Improve code formatting in skill service and commands
- Reduce CSS complexity in AppSwitcher component (removed blur effects and gradients)
- Update BrandIcons to use imported local SVG files instead of dynamic image loading
This improves performance, reduces external dependencies, and provides a cleaner UI experience.
* style(ui): hide scrollbars across all browsers and optimize form layout
- Hide scrollbars globally with cross-browser support:
* WebKit browsers (Chrome, Safari, Edge): ::-webkit-scrollbar { display: none }
* Firefox: scrollbar-width: none
* IE 10+: -ms-overflow-style: none
- Remove custom scrollbar styling (width, colors, hover states)
- Reorganize BasicFormFields layout:
* Move icon picker to top center as a clickable preview (80x80)
* Change name and notes fields to horizontal grid layout (md:grid-cols-2)
* Remove icon preview section from bottom
* Improve visual hierarchy and space efficiency
This provides a cleaner, more modern UI with hidden scrollbars while maintaining full scroll functionality.
* refactor(layout): standardize max-width to 60rem and optimize padding structure
- Unify container max-width across components:
* Replace max-w-4xl with max-w-[60rem] in App.tsx provider list
* Replace max-w-5xl with max-w-[60rem] in PromptPanel
* Move padding from header element to inner container for consistent spacing
- Optimize padding hierarchy:
* Remove px-6 from header element, add to inner header container
* Remove px-6 from main element, keep it only in provider list container
* Consolidate PromptPanel padding: move px-6 from nested divs to outer container
* Remove redundant pl-1 sm:pl-2 from logo/title area
- Benefits:
* Consistent 60rem max-width provides better readability on wide screens
* Simplified padding structure reduces CSS complexity
* Cleaner responsive behavior with unified spacing rules
This creates a more maintainable and visually consistent layout system.
* refactor(ui): unify layout system with 60rem max-width and consistent spacing
- Standardize container max-width across all panels:
* Replace max-w-4xl and max-w-5xl with unified max-w-[60rem]
* Apply to SettingsPage, UnifiedMcpPanel, SkillsPage, and FullScreenPanel
* Ensures consistent reading width and visual balance on wide screens
- Optimize padding hierarchy and structure:
* Move px-6 from parent elements to content containers
* FullScreenPanel: Add max-w-[60rem] wrapper to header, content, and footer
* Add border separators (border-t/border-b) to header and footer sections
* Consolidate nested padding in MCP, Skills, and Prompts panels
* Remove redundant padding layers for cleaner CSS
- Simplify component styling:
* MCP list items: Replace card-based layout with modern group-based design
* Remove unnecessary wrapper divs and flatten DOM structure
* Update card hover effects with smooth transitions
* Simplify icon selection dialog (remove description text in BasicFormFields)
- Benefits:
* Consistent 60rem max-width provides optimal readability
* Unified spacing rules reduce maintenance complexity
* Cleaner component hierarchy improves performance
* Better responsive behavior across different screen sizes
* More cohesive visual design language throughout the app
This creates a maintainable, scalable design system foundation.
* feat(deeplink): add Claude model fields support and enhance import dialog
- Add Claude-specific model field support in deeplink import:
* Support model (ANTHROPIC_MODEL) - general default model
* Support haikuModel (ANTHROPIC_DEFAULT_HAIKU_MODEL)
* Support sonnetModel (ANTHROPIC_DEFAULT_SONNET_MODEL)
* Support opusModel (ANTHROPIC_DEFAULT_OPUS_MODEL)
* Backend: Update DeepLinkImportRequest struct to include optional model fields
* Frontend: Add TypeScript type definitions for new model parameters
- Enhance deeplink demo page (deplink.html):
* Add 5 new Claude configuration examples showcasing different model setups
* Add parameter documentation with required/optional tags
* Include basic config (no models), single model, complete 4-model, partial models, and third-party provider examples
* Improve visual design with param-list component and color-coded badges
* Add detailed descriptions for each configuration scenario
- Redesign DeepLinkImportDialog layout:
* Switch from 3-column to compact 2-column grid layout
* Reduce dialog width from 500px to 650px for better content display
* Add dedicated section for Claude model configurations with blue highlight box
* Use uppercase labels and smaller text for more information density
* Add truncation and tooltips for long URLs
* Improve visual hierarchy with spacing and grouping
* Increase z-index to 9999 to ensure dialog appears on top
- Minor UI refinements:
* Update App.tsx layout adjustments
* Optimize McpFormModal styling
* Refine ProviderCard and BasicFormFields components
This enables users to import Claude providers with precise model configurations via deeplink.
* feat(deeplink): add config file support for deeplink import
Support importing provider configuration from embedded or remote config files.
- Add base64 dependency for config content encoding
- Support config, configFormat, and configUrl parameters
- Make homepage/endpoint/apiKey optional when config is provided
- Add config parsing and merging logic
* feat(deeplink): enhance dialog with config file preview
Add config file parsing and preview in deep link import dialog.
- Support Base64 encoded config display
- Add config file source indicator (embedded/remote)
- Parse and display config fields by app type (Claude/Codex/Gemini)
- Mask sensitive values in config preview
- Improve dialog layout and content organization
* refactor(ui): unify dialog styles and improve layout consistency
Standardize dialog and panel components across the application.
- Update dialog background to use semantic color tokens
- Adjust FullScreenPanel max-width to 56rem for better alignment
- Add drag region and prevent body scroll in full-screen panels
- Optimize button sizes and spacing in panel headers
- Apply consistent styling to all dialog-based components
* i18n: add deeplink config preview translations
Add missing translation keys for config file preview feature.
- Add configSource, configEmbedded, configRemote labels
- Add configDetails and configUrl display strings
- Support both Chinese and English versions
* feat(deeplink): enhance test page with v3.8 config file examples
Improve deeplink test page with comprehensive config file import examples.
- Add version badge for v3.8 features
- Add copy-to-clipboard functionality for all deep links
- Add Claude config file import examples (embedded/remote)
- Add Codex config file import examples (auth.json + config.toml)
- Add Gemini config file import examples (.env format)
- Add config generator tool for easy testing
- Update UI with better styling and layout
* feat(settings): add autoSaveSettings for lightweight auto-save
Add optimized auto-save function for General tab settings.
- Add autoSaveSettings method for non-destructive auto-save
- Only trigger system APIs when values actually change
- Avoid unnecessary auto-launch and plugin config updates
- Update tests to cover new functionality
* refactor(settings): simplify settings page layout and auto-save
Reorganize settings page structure and integrate autoSaveSettings.
- Move save button inline within Advanced tab content
- Remove sticky footer for cleaner layout
- Use autoSaveSettings for General tab settings
- Simplify dialog close behavior
- Refactor ImportExportSection layout
* style(providers): optimize card layout and action button sizes
Improve provider card visual density and action buttons.
- Reduce icon button sizes for compact layout
- Adjust drag handle and icon sizes
- Tighten spacing between action buttons
- Update hover translate values for better alignment
* refactor(mcp): improve form modal layout with adaptive height editor
Restructure MCP form modal for better space utilization.
- Split form into upper form fields and lower JSON editor sections
- Add full-height mode support for JsonEditor component
- Use flex layout for editor to fill available space
- Update PromptFormPanel to use full-height editor
- Fix locale text formatting
* style: unify list item styles with semantic colors
Apply consistent styling to list items across components.
- Replace hardcoded colors with semantic tokens in MCP and Prompt list items
- Add glass effect container to EndpointSpeedTest panel
- Format code for better readability
* style: format template literals for better readability
Improve code formatting for conditional className expressions.
- Break long template literals across multiple lines
- Maintain consistent formatting in MCP form and endpoint test components
* feat(deeplink): add config merge command for preview
Expose config merging functionality to frontend for preview.
- Add merge_deeplink_config Tauri command
- Make parse_and_merge_config public for reuse
- Enable frontend to display complete config before import
* feat(deeplink): merge and display config in import dialog
Enhance import dialog to fetch and display complete config.
- Call mergeDeeplinkConfig API when config is present
- Add UTF-8 base64 decoding support for config content
- Add scrollable content area with custom scrollbar styling
- Show complete configuration before user confirms import
* i18n: add config merge error message
Add translation for config file merge error handling.
* style(deeplink): format test page HTML for better readability
Improve HTML formatting in deeplink test page.
- Format multiline attributes for better readability
- Add consistent indentation to nested elements
- Break long lines in buttons and links
* refactor(usage): improve footer layout with two-row design
Reorganize usage footer for better readability and space efficiency.
- Split into two rows: update time + refresh button (row 1), usage stats (row 2)
- Move refresh button to top row next to update time
- Remove card background for cleaner look
- Add fallback text when never updated
- Improve spacing and alignment
- Format template literals for consistency
|
||
|
|
9e8abf5f26 |
feat(frontend): implement unified MCP panel for v3.7.0
Complete Phase 3 (P0) frontend implementation for unified MCP management:
**New Files:**
- src/hooks/useMcp.ts: React Query hooks for unified MCP operations
- src/components/mcp/UnifiedMcpPanel.tsx: Unified MCP management panel
- src/components/ui/checkbox.tsx: Checkbox component from shadcn/ui
**Features:**
- Unified panel with three-column layout: server info + app checkboxes + actions
- Multi-app control: Claude/Codex/Gemini checkboxes for each server
- Real-time stats: Show enabled server counts per app
- Full CRUD operations: Add, edit, delete, sync all servers
**Integration:**
- Replace old app-specific McpPanel with UnifiedMcpPanel in App.tsx
- Update McpFormModal to support unified mode with apps field
- Add i18n support: mcp.unifiedPanel namespace (zh/en)
**Type Safety:**
- Ensure McpServer.apps field always initialized
- Fix all test files to include apps field
- TypeScript type check passes ✅
**Architecture:**
- Single source of truth: mcp.servers manages all MCP configs
- Per-server app control: apps.claude/codex/gemini boolean flags
- Backward compatible: McpFormModal supports both unified and legacy modes
Next: P1 tasks (import dialogs, sub-components, tests)
|
||
|
|
8a05e7bd3d |
feat(gemini): add Gemini provider integration (#202)
* feat(gemini): add Gemini provider integration - Add gemini_config.rs module for .env file parsing - Extend AppType enum to support Gemini - Implement GeminiConfigEditor and GeminiFormFields components - Add GeminiIcon with standardized 1024x1024 viewBox - Add Gemini provider presets configuration - Update i18n translations for Gemini support - Extend ProviderService and McpService for Gemini * fix(gemini): resolve TypeScript errors, add i18n support, and fix MCP logic **Critical Fixes:** - Fix TS2741 errors in tests/msw/state.ts by adding missing Gemini type definitions - Fix ProviderCard.extractApiUrl to support GOOGLE_GEMINI_BASE_URL display - Add missing apps.gemini i18n keys (zh/en) for proper app name display - Fix MCP service Gemini cross-app duplication logic to prevent self-copy **Technical Details:** - tests/msw/state.ts: Add gemini default providers, current ID, and MCP config - ProviderCard.tsx: Check both ANTHROPIC_BASE_URL and GOOGLE_GEMINI_BASE_URL - services/mcp.rs: Skip Gemini in sync_other_side logic with unreachable!() guards - Run pnpm format to auto-fix code style issues **Verification:** - ✅ pnpm typecheck passes - ✅ pnpm format completed * feat(gemini): enhance authentication and config parsing - Add strict and lenient .env parsing modes - Implement PackyCode partner authentication detection - Support Google OAuth official authentication - Auto-configure security.auth.selectedType for PackyCode - Add comprehensive test coverage for all auth types - Update i18n for OAuth hints and Gemini config --------- Co-authored-by: Jason <farion1231@gmail.com> |