diff --git a/media/style.css b/media/style.css index 5102a8b..4cd191d 100644 --- a/media/style.css +++ b/media/style.css @@ -2709,6 +2709,27 @@ html.pi-viewport-recovering #pi-web-app { background: var(--pi-bg); } +.settings-open-vscode { + display: block; + width: 100%; + margin-top: 10px; + padding: 6px 10px; + border: 1px solid var(--pi-line); + border-radius: 2px; + background: transparent; + color: var(--pi-muted); + font: inherit; + font-size: 0.85em; + text-align: left; + cursor: pointer; +} + +.settings-open-vscode:hover, +.settings-open-vscode:focus-visible { + border-color: var(--pi-lavender); + color: var(--pi-text); +} + .pi-dialog-btn, .pi-dialog-input, .pi-dialog-option { diff --git a/src/test/vscode-settings-entry.test.ts b/src/test/vscode-settings-entry.test.ts index ac30ea6..e29a94a 100644 --- a/src/test/vscode-settings-entry.test.ts +++ b/src/test/vscode-settings-entry.test.ts @@ -12,12 +12,14 @@ suite("VS Code settings entry", () => { assert.strictEqual(extensionSettingsQuery(" ", " "), "@ext:auchan.pion-code"); }); - test("gear opens native settings and the panel executes the filtered command", () => { + test("gear opens the quick settings panel with a full VS Code settings link", () => { const handlers = readFileSync( new URL("../../src/webview/handlers/index.ts", import.meta.url), "utf8", ); assert.match(handlers, /pi-sb-settings/); + assert.match(handlers, /toggleSettingsPanel\(\);/); + assert.match(handlers, /settings-open-vscode/); assert.match(handlers, /postMessage\(\{ type: "openVscodeSettings" \}\)/); const panel = readFileSync( @@ -27,6 +29,6 @@ suite("VS Code settings entry", () => { assert.match(panel, /case "openVscodeSettings"/); assert.match(panel, /extensionSettingsQuery\(pkg\.publisher, pkg\.name\)/); assert.match(panel, /"workbench\.action\.openSettings"/); - assert.match(panel, /Open Pi on Code settings in VS Code/); + assert.match(panel, /Open Pi settings/); }); }); diff --git a/src/webview-panel.ts b/src/webview-panel.ts index ba96d40..4ba905f 100644 --- a/src/webview-panel.ts +++ b/src/webview-panel.ts @@ -1077,7 +1077,7 @@ export class PiWebviewPanel {
capabilities: 0
0%
-
⚙
+
⚙
diff --git a/src/webview/handlers/index.ts b/src/webview/handlers/index.ts index 669d665..82163f5 100644 --- a/src/webview/handlers/index.ts +++ b/src/webview/handlers/index.ts @@ -2213,8 +2213,9 @@ export function sendPrompt(modeOverride?: "steer" | "queue"): void { let sbSettings = document.getElementById("pi-sb-settings"); if (sbSettings) { sbSettings.addEventListener("click", function () { - // Gear opens the native VS Code Settings filtered to this extension. - window.__vscode.postMessage({ type: "openVscodeSettings" }); + // Gear opens the in-chat quick settings panel first; the panel links to + // the full native VS Code settings filtered to this extension. + toggleSettingsPanel(); }); } @@ -2672,6 +2673,10 @@ export function renderSettingsPanel() { `; } + // Escalation path to every Pi on Code option in the native VS Code settings. + result += html` + `; + state.settingsOverlay.innerHTML = result; // Wire toggle clicks @@ -2689,6 +2694,14 @@ export function renderSettingsPanel() { } }); }); + + var openFull = state.settingsOverlay.querySelector(".settings-open-vscode"); + if (openFull) { + openFull.addEventListener("click", function () { + closeAllOverlays(); + window.__vscode.postMessage({ type: "openVscodeSettings" }); + }); + } } export function toggleSettingsPanel() {