Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

fix(composer): resolve IME pull request landing blockers

LiYao9a27a8409eca
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 04a92254d..f81dc0e37 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -86,16 +86,8 @@ jobs:
name: Build ${{ matrix.name }}
needs: verify
env:
- # Signing is opt-in on a fork. A tag push must not force signing: this
- # repository owns no Apple Developer secrets, and the assertion in
- # "Require macOS signing and notarization secrets" additionally pins
- # APPLE_TEAM_ID to the upstream maintainer's team, so no locally obtained
- # certificate can satisfy it. An unsigned tag build still publishes every
- # installer; only the Developer ID seal and the notarization ticket are
- # absent. Set the repository variable MACOS_SIGN_RELEASE=true to restore
- # upstream's sign-always behaviour once this repository owns a
- # Developer ID certificate.
- MACOS_SIGN_RELEASE: ${{ (github.event_name == 'workflow_dispatch' && inputs.sign_macos == true) || vars.MACOS_SIGN_RELEASE == 'true' }}
+ # Tag pushes always sign. workflow_dispatch signs unless explicitly disabled.
+ MACOS_SIGN_RELEASE: ${{ github.event_name != 'workflow_dispatch' || inputs.sign_macos == true }}
strategy:
fail-fast: false
matrix:
diff --git a/apps/desktop/test/ci-workflow.test.mjs b/apps/desktop/test/ci-workflow.test.mjs
index adbe18b1f..b1124653f 100644
--- a/apps/desktop/test/ci-workflow.test.mjs
+++ b/apps/desktop/test/ci-workflow.test.mjs
@@ -208,26 +208,16 @@ test("release matrix packages both native macOS architectures", () => {
assert.match(releaseWorkflowSource, /Merge macOS updater metadata[\s\S]*?ruby/);
});
-test("macOS release signing is opt-in and workflow_dispatch still honours sign_macos", () => {
+test("macOS release signing is required on tag pushes", () => {
assert.match(
releaseWorkflowSource,
/workflow_dispatch:\s+inputs:\s+sign_macos:[\s\S]*?default:\s*true[\s\S]*?type:\s*boolean/,
);
- // A tag push must not force signing: a fork owns no Apple Developer
- // secrets, and the guard below pins APPLE_TEAM_ID to the upstream
- // maintainer's team, so no locally obtained certificate can satisfy it.
- // Signing is opted into with the repository variable, and the manual
- // dispatch lane keeps its own sign_macos input.
assert.ok(
releaseWorkflowSource.includes(
- "MACOS_SIGN_RELEASE: ${{ (github.event_name == 'workflow_dispatch' && inputs.sign_macos == true) || vars.MACOS_SIGN_RELEASE == 'true' }}",
+ "MACOS_SIGN_RELEASE: ${{ github.event_name != 'workflow_dispatch' || inputs.sign_macos == true }}",
),
);
- assert.doesNotMatch(
- releaseWorkflowSource,
- /MACOS_SIGN_RELEASE: \$\{\{ github\.event_name != 'workflow_dispatch'/,
- "a tag push no longer forces macOS signing",
- );
const unsignedBlock = releaseWorkflowSource.match(
/- name: Package unsigned macOS installer[\s\S]*?(?=\n - name:)/,
diff --git a/scripts/e2e-composer-ime-stack.mjs b/scripts/e2e-composer-ime-stack.mjs
index ff92ef745..771f58032 100644
--- a/scripts/e2e-composer-ime-stack.mjs
+++ b/scripts/e2e-composer-ime-stack.mjs
@@ -36,6 +36,17 @@ try {
"react-dom": join(root, "apps/desktop/node_modules/react-dom"),
},
nodePaths: [join(root, "apps/desktop/node_modules")],
+ plugins: [{
+ name: "local-url-assets",
+ setup(build) {
+ build.onResolve({ filter: /\?url$/ }, ({ path, resolveDir }) => ({
+ path: join(resolveDir, path.slice(0, -4)), namespace: "local-url-asset",
+ }));
+ build.onLoad({ filter: /.*/, namespace: "local-url-asset" }, async ({ path }) => ({
+ contents: await readFile(path), loader: "file",
+ }));
+ },
+ }],
});
const renderer = join(root, "apps/desktop/out/renderer");
const appHtml = await readFile(join(renderer, "index.html"), "utf8");
diff --git a/scripts/e2e-composer-paste.mjs b/scripts/e2e-composer-paste.mjs
index 40dfe59fe..54f8d5c77 100644
--- a/scripts/e2e-composer-paste.mjs
+++ b/scripts/e2e-composer-paste.mjs
@@ -35,6 +35,17 @@ try {
"react-dom": join(root, "apps/desktop/node_modules/react-dom"),
},
nodePaths: [join(root, "apps/desktop/node_modules")],
+ plugins: [{
+ name: "local-url-assets",
+ setup(build) {
+ build.onResolve({ filter: /\?url$/ }, ({ path, resolveDir }) => ({
+ path: join(resolveDir, path.slice(0, -4)), namespace: "local-url-asset",
+ }));
+ build.onLoad({ filter: /.*/, namespace: "local-url-asset" }, async ({ path }) => ({
+ contents: await readFile(path), loader: "file",
+ }));
+ },
+ }],
});
await build({
entryPoints: {
diff --git a/scripts/e2e/composer-ime-stack.tsx b/scripts/e2e/composer-ime-stack.tsx
index 9afba268c..def2371ea 100644
--- a/scripts/e2e/composer-ime-stack.tsx
+++ b/scripts/e2e/composer-ime-stack.tsx
@@ -80,6 +80,7 @@ function Fixture() {
inputRef={draft.ref}
value={draft.value}
placeholderText=""
+ placeholderKey="fixture"
inputBlocked={false}
pasting={false}
enterToSend={false}
@@ -89,6 +90,7 @@ function Fixture() {
onAcceptCompletion={completions.acceptCompletion}
onSubmit={noop}
onInsertNewline={noop}
+ onHistoryNavigate={() => false}
onInput={(source, caret) => completions.handleInput(source, caret)}
onCompositionStart={() => draft.setComposing(true)}
onCompositionEnd={() => draft.setComposing(false)}
diff --git a/scripts/e2e/composer-paste.tsx b/scripts/e2e/composer-paste.tsx
index bcfd1cc42..e5cbe0f7d 100644
--- a/scripts/e2e/composer-paste.tsx
+++ b/scripts/e2e/composer-paste.tsx
@@ -123,6 +123,7 @@ function Fixture({ sessionId, t, workspacePath }: { sessionId: string; t: TFunct
onInput={(source, caret) => { inputHistory.exitBrowsing(); draft.handleInput(source, caret); }}
onCompositionStart={noop}
onCompositionEnd={noop}
+ onSettledInput={() => draft.setComposing(false)}
onFocus={noop}
onBlur={noop}
/>