Skip to content

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

fix(settings): limit inline import copy to empty state

vastsaf442ffe60dcb
diff --git a/apps/desktop/src/features/settings/import-workbench.tsx b/apps/desktop/src/features/settings/import-workbench.tsx
index d5e892512..a022f3b5b 100644
--- a/apps/desktop/src/features/settings/import-workbench.tsx
+++ b/apps/desktop/src/features/settings/import-workbench.tsx
@@ -1,6 +1,6 @@
import { useState, type ReactNode } from "react";
import { useTranslation } from "react-i18next";
-import { Button, Checkbox, cx } from "../../components/ui";
+import { Button, Checkbox, HelpIcon, cx } from "../../components/ui";
import { IconChevronLeft, IconDownload } from "../../components/icons";
import { SettingsMenuSelect } from "../../components/settings/SettingsMenuSelect";
@@ -90,15 +90,15 @@ export function ImportOption({
label: string;
value: string;
options: { id: string; label: string }[];
- /** Explains the choice directly below its label. */
+ /** Explains the choice from the label's help icon. */
hint?: string;
onChange: (id: string) => void;
}) {
return (
<label className="import-option">
- <span className="import-option-copy">
- <span className="import-option-label">{label}</span>
- {hint ? <span className="import-option-hint">{hint}</span> : null}
+ <span className="import-option-label">
+ {label}
+ {hint ? <HelpIcon label={hint} /> : null}
</span>
<SettingsMenuSelect
className="import-option-select"
diff --git a/apps/desktop/src/styles/sessions.css b/apps/desktop/src/styles/sessions.css
index 343ef5965..c6ed9b3f8 100644
--- a/apps/desktop/src/styles/sessions.css
+++ b/apps/desktop/src/styles/sessions.css
@@ -61,11 +61,8 @@
.import-toolbar-actions {
display: flex;
- min-width: 0;
- flex: 1 1 auto;
- flex-wrap: wrap;
+ flex: 0 0 auto;
align-items: center;
- justify-content: flex-end;
gap: 8px;
margin-left: auto;
}
@@ -84,30 +81,15 @@
.import-option {
display: inline-flex;
- min-width: min(100%, 240px);
- flex: 1 1 240px;
- align-items: center;
- gap: 10px;
-}
-
-.import-option-copy {
- display: flex;
min-width: 0;
- flex-direction: column;
- gap: 2px;
+ align-items: center;
+ gap: 7px;
}
.import-option-label {
color: var(--ds-text-muted);
font-size: var(--text-sm);
-}
-
-.import-option-hint {
- max-width: 360px;
- color: var(--ds-text-muted);
- font-size: var(--text-2xs);
- line-height: var(--leading-normal);
- overflow-wrap: anywhere;
+ white-space: nowrap;
}
.import-option-select .settings-menu-select-trigger {
diff --git a/apps/desktop/test/settings-help-tooltip.test.mjs b/apps/desktop/test/settings-help-tooltip.test.mjs
index 0a5488f64..ed7a9bacd 100644
--- a/apps/desktop/test/settings-help-tooltip.test.mjs
+++ b/apps/desktop/test/settings-help-tooltip.test.mjs
@@ -109,22 +109,21 @@ test("one settings row renderer owns the layout", () => {
);
});
-test("import explanations are visible in the expanded workbench", () => {
- // Scan scope is readable before starting a scan; skill mode copy stays beside
- // the choice it explains without adding another help-icon interaction.
+test("empty import states show scan scope inline while result options keep help", () => {
+ // Scan scope is readable before starting a scan. Result-specific mode
+ // guidance remains available from its existing help control.
assert.doesNotMatch(importWorkbench, /className="import-hint"/);
assert.match(importWorkbench, /hint\?: string;/);
assert.match(skillImport, /hint=\{t\("settings\.importAgentScanModeHint"\)\}/);
assert.doesNotMatch(modelImport, /codexCap|importCodexCapped/);
+ const idleStart = importWorkbench.indexOf("export function ImportIdle(");
+ const idleEnd = importWorkbench.indexOf("export function ImportResults(", idleStart);
+ const importIdle = importWorkbench.slice(idleStart, idleEnd);
assert.match(
- importWorkbench,
+ importIdle,
/<p className="import-idle-description">\{copy\}<\/p>/,
);
- assert.match(
- importWorkbench,
- /<span className="import-option-hint">\{hint\}<\/span>/,
- );
- assert.doesNotMatch(importWorkbench, /<HelpIcon/);
+ assert.doesNotMatch(importIdle, /<HelpIcon/);
+ assert.match(importWorkbench, /\{hint \? <HelpIcon label=\{hint\} \/> : null\}/);
assert.match(cssRule(".import-idle-description"), /color:\s*var\(--ds-text-muted\)/);
- assert.match(cssRule(".import-option-hint"), /overflow-wrap:\s*anywhere/);
});
diff --git a/apps/desktop/test/settings-import-page.test.mjs b/apps/desktop/test/settings-import-page.test.mjs
index 0dca60513..e1213e7a5 100644
--- a/apps/desktop/test/settings-import-page.test.mjs
+++ b/apps/desktop/test/settings-import-page.test.mjs
@@ -49,8 +49,7 @@ test("model, skills, and MCP imports are available from their own settings pages
assert.match(mcpImport, /level,\s*\.\.\./);
assert.match(mcpImport, /description=\{t\("settings\.importAgentMcpDesc"\)\}/);
assert.match(workbench, /className="import-idle-description"/);
- assert.match(workbench, /className="import-option-hint"/);
- assert.doesNotMatch(workbench, /<HelpIcon/);
+ assert.match(workbench, /<HelpIcon label=\{hint\} \/>/);
for (const [source, panelId] of [
[modelPage, "model-config-import-panel"],
diff --git a/docs/spec/04-ux/06-settings-ia.md b/docs/spec/04-ux/06-settings-ia.md
index 04b2037e8..9c4f90e65 100644
--- a/docs/spec/04-ux/06-settings-ia.md
+++ b/docs/spec/04-ux/06-settings-ia.md
@@ -737,8 +737,8 @@ system while preserving their different data ownership:
Models, Skills, and MCP respectively. Each page keeps an explicit scan and
selection panel; opening or closing the panel never starts a scan.
- When an import panel opens, show its scan-scope explanation directly above
- the Scan action. Skill copy/link mode guidance stays visible beside the
- selector; these explanations do not require a help icon.
+ the Scan action; it does not require a help icon. Result-specific guidance
+ remains attached to its existing control.
- Skills and MCP imports use the destination selected by the page's current
Global / Project filter. Project scans and writes carry the selected project
path, and the scan panel resets when that scope changes.
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index b60b22776..c86ccd27b 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -13228,8 +13228,7 @@ are withdrawn with ADR 0165.
1. Open Settings → Skills, select Project and a project, then expand Scan
other tools. Confirm its scan explanation is visible without a help icon
and that opening the panel does not scan. Scan, select a skill, choose its
- copy or link mode, confirm the mode explanation is visible beside the
- selector without a help icon, and import it.
+ copy or link mode, and import it.
2. Confirm the new skill belongs to the selected project. Change the project
and confirm the prior candidates and selection are cleared.
3. Open Settings → MCP, select Project and the same project, expand Scan
@@ -13243,8 +13242,8 @@ are withdrawn with ADR 0165.
- **Expected**: Skills and MCP scans start only after an explicit Scan action.
Project scans and writes carry the selected project path; scope changes clear
stale candidates. MCP disabled state is preserved and URL credentials never
- render in candidate metadata. The expanded scan descriptions and skill
- copy/link guidance are readable inline without a question-mark control.
+ render in candidate metadata. Scan explanations render inline; the skill
+ mode explanation remains on its existing help control.
- **Specs linked**: `04-ux/06-settings-ia.md`,
`04-ux/08-component-spec.md` §18.3 / §18.6 / §18.7, ADR 0319 / D645
- **Acceptance**: F (persistence), Security, Quality