perf: audit S1–S3 terminal discovery, form pills, trust list skip
Merged
TO
3mo ago+693+693+012345678901234567890123456789-146-146-012345678901234567890123456789
Summary
- S1: Replace serial
where.exeterminal discovery with in-processPathExecutableLookup(PATH + System32/WindowsPowerShellknown locations); keep settings OR for WT/IT and gated WSL. - S2: Store presentation-ordered pills in
WorkspaceEditStateand reuse them in form template/data JSON so rebuilds do not rescanGetPills. - S3: Gate home-row
GetStoredWorkspaceonWorkspaceTrustFeatures.Enabled(same short-circuit as Run) so trust-off first paint skips per-row clone/lookup.
Stacked on #117 (cursor/home-form-trust-ux) because S3 depends on the trust kill switch.
Test plan
-
dotnet test QuickShell.Core.Tests/QuickShell.Core.Tests.csproj -c Release -p:Platform=x64 --filter "FullyQualifiedName~PathExecutableLookup|FullyQualifiedName~TerminalCatalogDiscovery|FullyQualifiedName~SuggestionPillPresentation|FullyQualifiedName~ShortcutFormTemplateJson|FullyQualifiedName~ShortcutListItems|FullyQualifiedName~WorkspaceTrust" - Cold open CmdPal / Quick Shell: first catalog touch should not spawn
where.exefor wt/pwsh/cmd - Edit a workspace form: suggestion pills still match pill click indices after scan completes
- With trust disabled (ship default): home list subtitles have no
Untrusted ·prefix - With trust enabled in tests/override: untrusted rows show
Untrusted ·again
Made with Cursor
Summary by cubic
Speeds up startup and form rendering by replacing where.exe lookups, reusing precomputed form pills, and skipping trust work when the trust UI is off. Adds a shared trust kill switch across Core, Run, and QuickShell.Raycast, plus UX, stability, CodeQL fixes, and a safeguard to keep loaded workspaces if trust‑coercion persistence fails.
-
Refactors
- Terminal discovery: replace
where.exewith in-processPathExecutableLookup(PATH + System32/WindowsPowerShell); use it in terminal, agent CLI, and companion app resolution; keep WT/IT and gated WSL. - Form pills: precompute in
WorkspaceEditState; reuse pills in view and data JSON to avoid a second scan; render only visible slots (4/row); cache templates by visible count; raise WPF chip panel height to 160. - Trust features: add
WorkspaceTrustFeatureskill switch backed byshared/workspace-trust-features.json(synced intoQuickShell.Raycastvia pre-scripts); when disabled, skipGetStoredWorkspace, hide trust UI/commands, allow external actions; addcreateIngressSecurityinQuickShell.Raycastso imported/restored items default safely while enforcement is off.
- Terminal discovery: replace
-
Bug Fixes
- Home favorites: avoid same-thread deadlocks by queuing reload; restore pinned move commands on the home menu.
- Workspace form: keep “Open in terminal” rows from being demoted, render a read-only-style command field with Clear, honor Cancel/Discard without merging inputs, and tighten companion arguments layout.
- Trust kill switch: make trust‑coercion persistence best‑effort so I/O or mutex failures don’t clear the in‑memory layout.
- Address additional CodeQL findings.