Files
orca/src/main/window
Kelvin Amoaba f6f5eb6aa3 feat(settings): add a Workspace Cleanup settings page with rules, run now and activity (#42039)
* feat(settings): add Workspace Cleanup settings page

Adds a Settings > Workspace Cleanup page for the host that owns the repos:
status with Clean up now, the rule switches, the ignored-files protection
and an Activity list of past runs. Turning on a delete rule that matches
workspaces right now asks first; Keep pins a workspace.

The page refreshes when the host's runner finishes a run: desktop main now
forwards workspaceCleanupRunFinished to its window, and remote hosts' event
is no longer dropped by the client event allowlist.

* feat(settings): confirm any cleanup rule change that would delete workspaces now

Lowering the inactive days or turning off the ignored-files protection makes
the runner delete within seconds too, so those changes get the same confirm
as turning a rule on.

* fix(settings): serialize cleanup rule changes and guard the confirm

One rule change at a time, built from the host's rules as they are when it
is saved; Esc or the close button can no longer abandon a confirm that is
already saving. Local save failures surface, a host whose rules cannot be
read says so with a retry, and the page follows project rules that keep
the runner on.

* fix(settings): keep cleanup changes bound to fresh rules and this page

A change re-reads the host's rules when it is confirmed, a change still
previewing when the page closes is dropped, Keep locks while saving, and
each preview is kept with the rules it evaluated. The page is hidden in a
paired browser, whose settings are not the host's.

* refactor(settings): reuse existing helpers in the Workspace Cleanup page

One row key helper, useMountedRef, SettingsSwitchRow and the shared
runtime target builder; only the preview of rules about to be saved is
kept as the page's matches, and the report waits for the rules.

* chore(i18n): protect the cleanup confirm's copy

* fix(settings): re-check the cleanup confirm when the rules moved meanwhile

If another client changed the rules while the confirm was open, preview
again and list any workspace the dialog had not shown before saving.

* fix(settings): preview again on every cleanup confirm

A workspace can age past a rule while the confirm is open, so the confirm
always checks again and lists anything new before saving.

* fix(settings): drop a confirmed cleanup change if the page closed while pinning

* feat(workspace-cleanup): keep PR number and ignored file names on cleanup rows

Run and preview rows now carry the merged PR number and up to 3 ignored
file names the evidence already read, so the page can say 'Merged · #4182'
and 'Ignored files · .env'. No new Git reads; older saved runs lack them.

* fix(settings): say when a run's saved receipt lists fewer kept workspaces

* fix(workspace-cleanup): import at-risk local files from its new home

* perf(workspace-cleanup): share in-flight previews and stop re-scanning confirmed rules

The host shares one evaluation between previews of the same rules, so
reopened pages and several clients no longer stack full scans. The page
keeps a would-be rules preview out of its matches until those rules are
saved, then adopts it, and reuses its own preview for the current rules.
2026-11-13 22:18:59 +00:00
..