refactor: drop dead selection code and comments that outlived their state

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Guilhem Lemouel
2026-09-08 16:44:22 +02:00
co-authored by Claude Opus 5
parent 4c4738c970
commit 639fb7f19d
4 changed files with 8 additions and 19 deletions
@@ -14,10 +14,11 @@
type Kind = 'script' | 'resource' | 'schedule' | 'variable' | 'flow' | 'app'
/** Where a draft-only item's draft row actually lives. It is parked at a
* generated path while the drawer edits the name the user sees, so the two
* can't be the same string. Empty for a deployed item, which is addressed by
* `initialPath` throughout. */
/** Where a draft-only item's draft row actually lives, which is what the move
* endpoint addresses; `initialPath` is the name the user sees and edits. The
* two are often equal — a row is only reported under a separate display path
* when the two differ — so this is not a "storage vs display" discriminator,
* only the address. Empty for a deployed item, addressed by `initialPath`. */
let storagePath = $state('')
let rawApp = $state(false)
let draftOnly = $derived(storagePath !== '')
@@ -167,9 +168,8 @@
<div class="flex flex-wrap gap-x-3 gap-y-1 mt-1">
{#each attachedSummary as { label, count } (label)}
<span class="text-xs"
><span class="font-mono font-semibold">{count}</span> {label}{count === 1
? ''
: 's'}</span
><span class="font-mono font-semibold">{count}</span>
{label}{count === 1 ? '' : 's'}</span
>
{/each}
</div>
@@ -84,9 +84,6 @@
function actionTitle(action: BulkAction): string {
const n = targets(action).length
// Reachable by unticking the last row without leaving selection mode: there is
// nothing to block, so no reason to report.
if (items.length === 0) return `Select items to ${ACTION_LABEL[action].toLowerCase()}`
if (n === 0) return `Cannot ${ACTION_LABEL[action].toLowerCase()}: ${blockedSummary(action)}`
if (n < items.length) return `${ACTION_LABEL[action]} ${n} of the ${items.length} selected`
return `${ACTION_LABEL[action]} ${n} item${plural(n)}`
+1 -5
View File
@@ -56,12 +56,8 @@
homeSelection.register(b)
return () => homeSelection.unregister(b.key)
})
// Gated on `available`, not just on having an item: it is what excludes
// operators and the read-only embedded lists. Without it they would get a
// checkbox and a Select entry that tick rows while `active` stays false
// forever, so the bar that clears the selection never appears.
let rowSelection: RowSelection | undefined = $derived(
bulkItem && homeSelection?.available
bulkItem && homeSelection
? {
key: bulkItem.key,
selected: homeSelection.has(bulkItem.key),
@@ -89,10 +89,6 @@ export class HomeSelection {
return this.available && this.selected.size > 0
}
get size(): number {
return this.selected.size
}
get items(): BulkItem[] {
return [...this.selected.values()]
}