fix(workspace-cleanup): drop filter chips for the safety fields this PR removes

The cleanup dialog crashed on every open. My merge of #15300 brought in the
applied-filter chips, which read `safety.tiers` and `safety.selectableOnly` --
the exact fields this PR deletes. Electron QA caught it; the chip derivation runs
on open, so it threw before anything rendered.

Removed the two chip branches, their formatter entries, and the now-dead 'tier'
chip-kind label. The test that swept every chip keeps its breadth by using
`safety.dismissed`, which survives.

Worth noting what did not catch this: typecheck flagged only the test file, not
the source, because the QA agent had already patched the source locally without
committing. A merge that compiles can still remove a field a caller reads at
runtime, and only opening the dialog proved it.
This commit is contained in:
Brennan Benson
2026-08-24 13:30:53 -07:00
parent bcc67040c4
commit 32e4f3babd
3 changed files with 3 additions and 21 deletions
@@ -121,9 +121,7 @@ function buildAppliedFilterFormatters(): Parameters<typeof listAppliedWorkspaceC
: translate('components.workspace.cleanup.browse.chip.none', 'None')
}),
completelyEmpty: () =>
translate('components.workspace.cleanup.browse.chip.completelyEmpty', 'Nothing to lose'),
selectableOnly: () =>
translate('components.workspace.cleanup.browse.chip.selectableOnly', 'Deletable only')
translate('components.workspace.cleanup.browse.chip.completelyEmpty', 'Nothing to lose')
}
}
@@ -153,8 +151,6 @@ function getChipKindLabel(kind: string): string {
return translate('components.workspace.cleanup.browse.chip.kind.repo', 'Repo')
case 'blocker':
return translate('components.workspace.cleanup.browse.chip.kind.blocker', 'Blocker')
case 'tier':
return translate('components.workspace.cleanup.browse.chip.kind.tier', 'Safety')
case 'dismissed':
return translate('components.workspace.cleanup.browse.chip.kind.dismissed', 'Ignored')
case 'archived':
@@ -16,8 +16,7 @@ const FORMAT = {
branchQuery: (v: string) => `Branch ~ ${v}`,
pathPrefix: (v: string) => `Path ~ ${v}`,
presence: (kind: string, mode: string) => `${kind}:${mode}`,
completelyEmpty: () => 'Nothing to lose',
selectableOnly: () => 'Deletable only'
completelyEmpty: () => 'Nothing to lose'
}
const list = (f: ReturnType<typeof createDefaultWorkspaceCleanupFilterState>) =>
@@ -131,7 +130,7 @@ describe('listAppliedWorkspaceCleanupFilters', () => {
filters.status.matchStatusless = false
filters.git.branchQuery = 'release'
filters.location.pathPrefix = '/repos'
filters.safety.selectableOnly = true
filters.safety.dismissed = 'only'
let next = filters
for (const applied of list(filters)) {
@@ -35,7 +35,6 @@ type Formatters = {
pathPrefix: (value: string) => string
presence: (kind: string, mode: string) => string
completelyEmpty: () => string
selectableOnly: () => string
}
/**
@@ -232,24 +231,12 @@ export function listAppliedWorkspaceCleanupFilters(
safety: { ...f.safety, blockers: [] }
}))
}
if (safety.tiers.length > 0) {
add('safety.tiers', format.list('tier', safety.tiers.length), (f) => ({
...f,
safety: { ...f.safety, tiers: [] }
}))
}
if (safety.dismissed !== 'any') {
add('safety.dismissed', format.triState('dismissed', safety.dismissed), (f) => ({
...f,
safety: { ...f.safety, dismissed: 'any' }
}))
}
if (safety.selectableOnly) {
add('safety.selectableOnly', format.selectableOnly(), (f) => ({
...f,
safety: { ...f.safety, selectableOnly: false }
}))
}
return applied
}