promptward

Plan 012: Remove the no-op WebGPU toggle from settings and the side panel

Executor instructions: Follow this plan step by step. Run every verification command and confirm the expected result before moving to the next step. If anything in the “STOP conditions” section occurs, stop and report — do not improvise. When done, update the status row for this plan in plans/README.md — unless a reviewer dispatched you and told you they maintain the index.

Drift check (run first): grep -rn "webGpuEnabled\|webgpu" src/ --include="*.ts" -i Expected matches at planning time: src/shared/messages.ts:28, src/shared/settings.ts:7, src/sidepanel.ts (the toggle row and its change handler). If webGpuEnabled is READ anywhere else (e.g. the worker now selects a device with it), the feature was wired — STOP; this plan is obsolete and should be marked REJECTED.

Status

Why this matters

The side panel ships a “WebGPU” toggle whose label admits it does nothing (“Reserved opt-in; WASM remains the default backend”). The stored webGpuEnabled setting is written by the toggle and read by no runtime code — the worker hardcodes device: "wasm". A visible control that has no effect erodes trust in a privacy tool (“what else in here is fake?”) and adds a settings field every future change must carry. Remove it; if WebGPU is ever actually wired (a real direction option — the upstream Rampart package ships WebGPU benchmarks), the toggle returns together with the code that honors it.

Current state

Commands you will need

Purpose Command Expected on success
Typecheck npx tsc -p tsconfig.json --noEmit exit 0
Tests npm test all pass
Build npm run build exit 0

Scope

In scope:

Out of scope:

Git workflow

Steps

Step 1: Remove the field from the type and defaults

Delete webGpuEnabled: boolean; from PromptWardSettings in src/shared/messages.ts and webGpuEnabled: false from DEFAULT_SETTINGS in src/shared/settings.ts.

Verify: npx tsc -p tsconfig.json --noEmit → FAILS, pointing at exactly the sidepanel usages (this confirms the full usage list before you touch UI code). If it points anywhere else, that’s an unlisted reader — STOP.

Step 2: Remove the UI row and handler

In src/sidepanel.ts, delete the WebGPU <label class="row">... block from the template and the #webgpu change-handler block in bind().

Verify: npx tsc -p tsconfig.json --noEmit → exit 0. Verify: grep -rin "webgpu" src/ → no matches.

Step 3: Full verification

Verify: npm test → all pass. Verify: npm run build → exit 0.

Test plan

No new tests — the removal is proven by the typecheck sweep in step 1 and the green suite. tests/settings.test.ts continues to pass unmodified.

Done criteria

STOP conditions

Maintenance notes