Skip to content

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

fix(settings): show import guidance inline

vastsa3e53da440649
diff --git a/apps/desktop/src/features/settings/import-workbench.tsx b/apps/desktop/src/features/settings/import-workbench.tsx
index f33b21dfa..d5e892512 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, HelpIcon, cx } from "../../components/ui";
+import { Button, Checkbox, 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, reached from the label's help icon. */
+ /** Explains the choice directly below its label. */
hint?: string;
onChange: (id: string) => void;
}) {
return (
<label className="import-option">
- <span className="import-option-label">
- {label}
- {hint ? <HelpIcon label={hint} /> : null}
+ <span className="import-option-copy">
+ <span className="import-option-label">{label}</span>
+ {hint ? <span className="import-option-hint">{hint}</span> : null}
</span>
<SettingsMenuSelect
className="import-option-select"
@@ -223,8 +223,7 @@ export function ImportRow({
/**
* Pre-scan state: what the scan will look at, and the action that starts it.
- * Empty states carry no filler, so a kind without a description shows only the
- * glyph and the action.
+ * Keep the explanation visible so users do not have to discover it in a tooltip.
*/
export function ImportIdle({
description,
@@ -238,19 +237,17 @@ export function ImportIdle({
scanning: boolean;
}) {
const { t } = useTranslation();
- const help = [description, note].filter(Boolean).join(" · ");
+ const copy = [description, note].filter(Boolean).join(" · ");
return (
<div className="settings-panel import-panel">
<div className="import-idle">
<span className="import-idle-glyph" aria-hidden>
<IconDownload size={20} />
</span>
- <div className="import-idle-actions">
- <Button variant="secondary" disabled={scanning} onClick={onScan}>
- {scanning ? t("settings.importScanning") : t("settings.importScan")}
- </Button>
- {help ? <HelpIcon label={help} /> : null}
- </div>
+ {copy ? <p className="import-idle-description">{copy}</p> : null}
+ <Button variant="secondary" disabled={scanning} onClick={onScan}>
+ {scanning ? t("settings.importScanning") : t("settings.importScan")}
+ </Button>
</div>
</div>
);
diff --git a/apps/desktop/src/styles/sessions.css b/apps/desktop/src/styles/sessions.css
index a5ee63928..343ef5965 100644
--- a/apps/desktop/src/styles/sessions.css
+++ b/apps/desktop/src/styles/sessions.css
@@ -61,8 +61,11 @@
.import-toolbar-actions {
display: flex;
- flex: 0 0 auto;
+ min-width: 0;
+ flex: 1 1 auto;
+ flex-wrap: wrap;
align-items: center;
+ justify-content: flex-end;
gap: 8px;
margin-left: auto;
}
@@ -81,15 +84,30 @@
.import-option {
display: inline-flex;
- min-width: 0;
+ min-width: min(100%, 240px);
+ flex: 1 1 240px;
align-items: center;
- gap: 7px;
+ gap: 10px;
+}
+
+.import-option-copy {
+ display: flex;
+ min-width: 0;
+ flex-direction: column;
+ gap: 2px;
}
.import-option-label {
color: var(--ds-text-muted);
font-size: var(--text-sm);
- white-space: nowrap;
+}
+
+.import-option-hint {
+ max-width: 360px;
+ color: var(--ds-text-muted);
+ font-size: var(--text-2xs);
+ line-height: var(--leading-normal);
+ overflow-wrap: anywhere;
}
.import-option-select .settings-menu-select-trigger {
@@ -281,11 +299,12 @@
color: var(--ds-text-faint);
}
-/* The idle action, with the help icon that says what a scan will cover. */
-.import-idle-actions {
- display: inline-flex;
- align-items: center;
- gap: 4px;
+.import-idle-description {
+ max-width: 680px;
+ margin: 0;
+ color: var(--ds-text-muted);
+ font-size: var(--text-sm);
+ line-height: var(--leading-normal);
}
/* A scan that found nothing keeps its action in the toolbar above. */
diff --git a/apps/desktop/test/settings-help-tooltip.test.mjs b/apps/desktop/test/settings-help-tooltip.test.mjs
index c3adc67b6..0a5488f64 100644
--- a/apps/desktop/test/settings-help-tooltip.test.mjs
+++ b/apps/desktop/test/settings-help-tooltip.test.mjs
@@ -109,13 +109,22 @@ test("one settings row renderer owns the layout", () => {
);
});
-test("an import hint is reachable from the control it explains", () => {
- // The standalone hint line is gone; skill mode keeps its help text beside
- // the option, while the retired session-only cap note leaves Settings too.
+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.
assert.doesNotMatch(importWorkbench, /className="import-hint"/);
assert.match(importWorkbench, /hint\?: string;/);
assert.match(skillImport, /hint=\{t\("settings\.importAgentScanModeHint"\)\}/);
assert.doesNotMatch(modelImport, /codexCap|importCodexCapped/);
- assert.match(importWorkbench, /\{help \? <HelpIcon label=\{help\} \/> : null\}/);
- assert.match(importWorkbench, /<HelpIcon label=\{hint\} \/>/);
+ assert.match(
+ importWorkbench,
+ /<p className="import-idle-description">\{copy\}<\/p>/,
+ );
+ assert.match(
+ importWorkbench,
+ /<span className="import-option-hint">\{hint\}<\/span>/,
+ );
+ assert.doesNotMatch(importWorkbench, /<HelpIcon/);
+ 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 a8d425e85..0dca60513 100644
--- a/apps/desktop/test/settings-import-page.test.mjs
+++ b/apps/desktop/test/settings-import-page.test.mjs
@@ -33,18 +33,24 @@ test("model, skills, and MCP imports are available from their own settings pages
assert.match(modelPage, /ImportToggleButton/);
assert.match(modelPage, /<ModelConfigImportPanel \/>/);
assert.match(modelImport, /api\.scanImportModelConfigs\(\)/);
+ assert.match(modelImport, /description=\{t\("settings\.importModelsScanDesc"\)\}/);
assert.match(skillsPage, /ImportToggleButton/);
assert.match(skillsPage, /<AgentSkillImportPanel/);
assert.match(skillsPage, /level=\{targetLevel\}/);
assert.match(skillImport, /api\.scanExternalSkills\(/);
assert.match(skillImport, /level,\s*\.\.\./);
+ assert.match(skillImport, /description=\{t\("settings\.importAgentSkillsDesc"\)\}/);
assert.match(mcpPage, /ImportToggleButton/);
assert.match(mcpPage, /<AgentMcpImportPanel/);
assert.match(mcpPage, /level=\{targetLevel\}/);
assert.match(mcpImport, /api\.scanExternalMcp\(/);
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/);
for (const [source, panelId] of [
[modelPage, "model-config-import-panel"],
diff --git a/apps/desktop/test/settings-inline-import-user-path.test.mjs b/apps/desktop/test/settings-inline-import-user-path.test.mjs
index 5c3340a8a..f6a69d606 100644
--- a/apps/desktop/test/settings-inline-import-user-path.test.mjs
+++ b/apps/desktop/test/settings-inline-import-user-path.test.mjs
@@ -182,6 +182,16 @@ window.settingsInlineMcpImportProbe = async () => {
if (panel.hidden || toggle.getAttribute("aria-expanded") !== "true") {
throw new Error("Inline MCP workbench did not expand");
}
+ const scanDescription = requireNode(
+ panel.querySelector(".import-idle-description"),
+ "Expanded MCP workbench does not show its scan description",
+ );
+ if (!scanDescription.textContent.trim()) {
+ throw new Error("Expanded MCP scan description is empty");
+ }
+ if (panel.querySelector(".import-idle .ui-help-icon")) {
+ throw new Error("Expanded MCP workbench still hides its description behind a help icon");
+ }
const scanCountBeforeExplicitClick = calls.filter(
(call) => call.channel === IPC.invoke.mcpImportScan,
).length;
diff --git a/docs/spec/04-ux/06-settings-ia.md b/docs/spec/04-ux/06-settings-ia.md
index 2e0133177..04b2037e8 100644
--- a/docs/spec/04-ux/06-settings-ia.md
+++ b/docs/spec/04-ux/06-settings-ia.md
@@ -736,6 +736,9 @@ system while preserving their different data ownership:
- Model configuration, external skills, and external MCP scans live inside
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.
- 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 03d2d54a8..b60b22776 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -13191,7 +13191,8 @@ are withdrawn with ADR 0165.
PI-Desktop may already have an equivalent provider.
- **Steps**:
1. Open Settings → Models and expand **Import from other tools**. Confirm
- the inline workbench is idle until Scan is activated.
+ its scan explanation appears as inline text without a help icon, and the
+ workbench remains idle until Scan is activated.
2. Scan model configuration. Confirm source groups start expanded, rows
show name, model count, host, and an API key / No API key badge, and no
secret value appears in the UI or scan IPC payload.
@@ -13207,7 +13208,8 @@ are withdrawn with ADR 0165.
- **Expected**: Explicit scan only (D007). Stored API keys land in the host
secret store. Only equivalent providers (normalized URL + API style + same
credential) skip; different credentials at one endpoint remain separate.
- No protocol or schema version bump.
+ The expanded importer shows its scan explanation directly without a
+ question-mark control. No protocol or schema version bump.
- **Specs linked**: `04-ux/06-settings-ia.md`,
`04-ux/08-component-spec.md` §18.5, `03-runtime/01-ipc-protocol.md`,
`03-runtime/11-provider-model-system.md`, ADR 0179, D342
@@ -13224,12 +13226,16 @@ are withdrawn with ADR 0165.
includes userinfo and query credentials.
- **Steps**:
1. Open Settings → Skills, select Project and a project, then expand Scan
- other tools. Confirm opening the panel does not scan. Scan, select a skill,
- choose its copy or link mode, and import it.
+ 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.
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
- other tools, scan, select the disabled MCP candidate, and import it.
+ other tools. Confirm its scan explanation is visible without a help icon
+ and that opening the panel does not scan. Scan, select the disabled MCP
+ candidate, and import it.
4. Confirm the server belongs to that project, remains disabled, and the
candidate row shows only the URL host without userinfo, path, or query.
5. Change project scope and confirm the prior MCP candidates and selection
@@ -13237,7 +13243,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.
+ render in candidate metadata. The expanded scan descriptions and skill
+ copy/link guidance are readable inline without a question-mark 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