Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
chore: prepare clean upstream sync for PR validation
Liu Zhiyud1ff524349b3
diff --git a/apps/desktop/src/styles/composer-menus.css b/apps/desktop/src/styles/composer-menus.cssindex 0486049c9..a4a44777a 100644--- a/apps/desktop/src/styles/composer-menus.css+++ b/apps/desktop/src/styles/composer-menus.css@@ -79,15 +79,11 @@width: min(240px, calc(100vw - 24px));max-height: min(520px, calc(100vh - 92px));overflow-y: auto;- padding: 5px;- border-radius: var(--radius-xl);- background: color-mix(in oklab, var(--ds-bg-elevated-opaque) 82%, transparent);- backdrop-filter: saturate(1.6) blur(40px);- -webkit-backdrop-filter: saturate(1.6) blur(40px);- box-shadow:- 0 0 0 0.5px var(--ds-elevation-stroke),- var(--ds-shadow-dialog);- border: none;+ padding: 6px;+ border-radius: var(--radius-lg);+ background: var(--ds-bg-elevated-opaque);+ box-shadow: var(--ds-shadow-dialog);+ border: 1px solid var(--ds-border-subtle);color: var(--ds-text-primary);opacity: 0;pointer-events: none;@@ -103,7 +99,7 @@.composer-model-thinking-menu {z-index: 60;- width: min(280px, calc(100vw - 24px));+ width: min(300px, calc(100vw - 24px));}.composer-model-thinking-menu.is-open {@@ -112,19 +108,13 @@}.composer-model-thinking-chip {- max-width: min(280px, calc(100vw - 24px));+ max-width: min(300px, calc(100vw - 24px));min-width: 0;- height: 26px !important;- padding: 0 8px !important;+ padding: 0 9px !important;gap: 4px !important;- border-radius: var(--radius-full) !important;color: var(--ds-text-secondary) !important;- font-size: var(--text-sm);- line-height: var(--leading-none);+ line-height: var(--leading-compact);overflow: hidden;- transition:- background var(--motion-duration-fast) var(--motion-ease-out),- color var(--motion-duration-fast) var(--motion-ease-out);}.composer-model-thinking-chip:hover {@@ -180,11 +170,11 @@display: flex;width: 100%;min-width: 0;- min-height: 30px;+ min-height: 34px;align-items: center;- gap: 7px;- border-radius: var(--radius-sm);- padding: 0 8px;+ gap: 8px;+ border-radius: var(--radius-md);+ padding: 0 10px;color: var(--ds-text-primary);font-size: var(--text-sm-plus);line-height: var(--leading-compact);@@ -217,7 +207,7 @@min-width: 0;margin-left: auto;overflow: hidden;- color: var(--ds-text-muted);+ color: var(--ds-accent);font-size: var(--text-sm);text-overflow: ellipsis;white-space: nowrap;@@ -229,22 +219,20 @@/* Menu groups are separated by a breath of space, not a rule (D297). */.composer-menu-separator {- height: 1px;- margin: 2px 8px;- background: var(--ds-border-subtle);+ height: 6px;}.composer-model-thinking-menu .composer-model-search {- margin: 3px 3px 5px;+ margin: 4px 4px 6px;}.composer-model-thinking-menu .composer-plus-item {- min-height: 28px;- padding: 5px 8px;+ min-height: 34px;+ padding: 7px 10px;}.composer-thinking-heading {- padding: 3px 8px 5px;+ padding: 4px 10px 7px;color: var(--ds-text-muted);font-size: var(--text-xs-plus);line-height: var(--leading-compact);@@ -252,11 +240,9 @@.composer-thinking-list {display: flex;- max-height: 280px;+ max-height: 264px;flex-direction: column;overflow-y: auto;- scrollbar-width: thin;- scrollbar-color: var(--ds-border-default) transparent;}/* Reasoning slider (issue #417): the menu root carries the slider directly@@ -464,12 +450,12 @@@keyframes composer-menu-in {from {opacity: 0;- transform: translateY(6px) scale(0.97);+ transform: translateY(4px);}to {opacity: 1;- transform: translateY(0) scale(1);+ transform: translateY(0);}}@@ -486,22 +472,6 @@}}-/* Light mode: the glassmorphism layer needs an opaque white base because- 82% white-on-white is invisible. Use a solid background with a subtle- border and a stronger shadow instead of backdrop-filter translucency. */-:root[data-theme="light"] .composer-model-menu {- background: var(--ds-bg-elevated-opaque);- backdrop-filter: none;- -webkit-backdrop-filter: none;- box-shadow: var(--ds-shadow-model-menu-light);-}--:root[data-theme="light"] .composer-model-group-label {- background: var(--ds-bg-elevated-opaque);- backdrop-filter: none;- -webkit-backdrop-filter: none;-}-.composer-model-heading {display: flex;flex-direction: column;@@ -512,22 +482,18 @@/* Provider→models groups: the list scrolls on its own so the search field andprovider headings stay reachable with many discovered models. */.composer-model-list {- max-height: 280px;+ max-height: 264px;overflow-y: auto;- scrollbar-width: thin;- scrollbar-color: var(--ds-border-default) transparent;}.composer-model-group-label {position: sticky;top: 0;z-index: 1;- padding: 6px 8px 2px;- background: color-mix(in oklab, var(--ds-bg-elevated-opaque) 82%, transparent);- backdrop-filter: saturate(1.6) blur(40px);- -webkit-backdrop-filter: saturate(1.6) blur(40px);- color: var(--ds-text-muted);- font-size: var(--text-xs-plus);+ padding: 7px 10px 3px;+ background: var(--ds-bg-elevated-opaque);+ color: var(--ds-text-secondary);+ font-size: var(--text-md);font-weight: var(--font-weight-strong);letter-spacing: var(--tracking-wide);text-transform: uppercase;@@ -542,7 +508,7 @@a clear parent → child hierarchy without changing the option's label. Thesmaller normal-weight text keeps the provider heading as the visual anchor. */.composer-model-group .composer-model-option {- padding-left: 8px;+ padding-left: 22px;font-size: var(--text-sm);font-weight: var(--font-weight-normal);}@@ -555,7 +521,7 @@flex: 1;flex-direction: column;align-items: flex-start;- gap: 2px;+ gap: 4px;}.composer-model-full-id {@@ -578,7 +544,7 @@}.composer-model-option-badge {- border-radius: var(--radius-3xs);+ border-radius: var(--radius-sm);background: var(--ds-tile-deep);padding: 0 4px;color: var(--ds-text-faint);@@ -601,7 +567,6 @@.composer-plus-item.active {background: var(--ds-bg-active);- border-radius: var(--radius-sm);}.composer-plus-item.active span:last-child {@@ -625,11 +590,11 @@.composer-model-search {display: flex;align-items: center;- gap: 6px;- height: 28px;- margin: 4px 3px 5px;- padding: 0 8px;- border-radius: var(--radius-sm);+ gap: 7px;+ height: 30px;+ margin: 6px 4px;+ padding: 0 9px;+ border-radius: var(--radius-md);background: var(--ds-bg-inset);color: var(--ds-text-muted);}@@ -654,7 +619,7 @@}.composer-model-empty {- padding: 12px 8px;+ padding: 16px 10px;color: var(--ds-text-muted);font-size: var(--text-sm);text-align: center;diff --git a/apps/desktop/src/styles/tokens.css b/apps/desktop/src/styles/tokens.cssindex e3f004e5d..c25ddbc58 100644--- a/apps/desktop/src/styles/tokens.css+++ b/apps/desktop/src/styles/tokens.css@@ -281,11 +281,6 @@--ds-info: #5d5d5d;--ds-purple: #7c3aed;--ds-shadow-dialog: 0 16px 48px rgba(0, 0, 0, 0.12);- /* Preserve the opaque light model menu's existing stroke and lift. */- --ds-shadow-model-menu-light:- 0 0 0 0.5px color-mix(in oklab, #1a1c1f 10%, transparent),- 0 8px 32px rgba(0, 0, 0, 0.1),- 0 2px 8px rgba(0, 0, 0, 0.06);--ds-elevation-stroke: 0 0 0 0.5px color-mix(in oklab, #1a1c1f 12%, transparent);/* Codex elevation-prominent exact (same dark/light formula). */--ds-shadow-composer: 0 3px 7.5px #0000000a, 0 0 20px #0000000d;diff --git a/apps/desktop/test/composer-menu-style-tokens.test.mjs b/apps/desktop/test/composer-menu-style-tokens.test.mjsdeleted file mode 100644index 92d434727..000000000--- a/apps/desktop/test/composer-menu-style-tokens.test.mjs+++ /dev/null@@ -1,40 +0,0 @@-import assert from "node:assert/strict";-import { readFileSync } from "node:fs";-import test from "node:test";--const menus = readFileSync(new URL("../src/styles/composer-menus.css", import.meta.url), "utf8");-const tokens = readFileSync(new URL("../src/styles/tokens.css", import.meta.url), "utf8");--function rule(source, selector) {- const escaped = selector.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");- const match = source.match(new RegExp(`(?:^|\\n)${escaped}\\s*\\{([^}]*)\\}`));- assert.ok(match, `missing CSS rule: ${selector}`);- return match[1];-}--function declaration(body, property) {- const match = body.match(new RegExp(`(?:^|[;\\n])\\s*${property}:\\s*([^;]+);`));- assert.ok(match, `missing CSS declaration: ${property}`);- return match[1].trim().replace(/\s+/g, " ");-}--test("composer model chip uses the existing single-line height token", () => {- assert.equal(- declaration(rule(menus, ".composer-model-thinking-chip"), "line-height"),- "var(--leading-none)",- );- assert.equal(declaration(rule(tokens, "@theme"), "--leading-none"), "1");-});--test("light model menu token preserves its opaque surface and original shadow", () => {- const menu = rule(menus, ':root[data-theme="light"] .composer-model-menu');- assert.equal(declaration(menu, "background"), "var(--ds-bg-elevated-opaque)");- assert.equal(declaration(menu, "backdrop-filter"), "none");- assert.equal(declaration(menu, "-webkit-backdrop-filter"), "none");- assert.equal(declaration(menu, "box-shadow"), "var(--ds-shadow-model-menu-light)");- assert.equal(- declaration(rule(tokens, ':root[data-theme="light"]'), "--ds-shadow-model-menu-light"),- "0 0 0 0.5px color-mix(in oklab, #1a1c1f 10%, transparent), " +- "0 8px 32px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06)",- );-});