From 7ac27c1ef240729fc38d5fa506b96bf60be74e25 Mon Sep 17 00:00:00 2001 From: Guilhem Date: Tue, 21 Jul 2026 19:04:15 +0200 Subject: [PATCH] fix(frontend): limit compare & deploy rows to the active direction (#10234) Co-authored-by: Claude Fable 5 --- .../lib/components/CompareWorkspaces.svelte | 37 +++++++------------ 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/frontend/src/lib/components/CompareWorkspaces.svelte b/frontend/src/lib/components/CompareWorkspaces.svelte index ac4fcfad99..fbebaf573a 100644 --- a/frontend/src/lib/components/CompareWorkspaces.svelte +++ b/frontend/src/lib/components/CompareWorkspaces.svelte @@ -910,22 +910,18 @@ // Trigger and schedule rows now flow through `comparison.diffs` like every // other deployable kind — the backend's `compareWorkspaces` populates them // from `workspace_diff`, with runtime fields ignored by `compare_two_*`. - let deployableItems = $derived.by(() => { - return (comparison?.diffs ?? []) - .filter((diff) => { - const key = getItemKey(diff) - const isSelectable = selectableDiffs.includes(diff) - const isDeployedAndIrrelevant = - deploymentStatus[key]?.status === 'deployed' && !isSelectable - return !isDeployedAndIrrelevant - }) - .map((diff) => ({ - key: getItemKey(diff), - path: diff.path, - kind: diff.kind as Kind, - diff - })) - }) + // Rows are limited to the active direction (conflicts are ahead AND behind, + // so they show in both): an opposite-direction-only row would render as an + // unexplained disabled line. The other direction stays visible through the + // toggle badge counts and the behind/hidden alerts. + let deployableItems = $derived( + selectableDiffs.map((diff) => ({ + key: getItemKey(diff), + path: diff.path, + kind: diff.kind as Kind, + diff + })) + ) let ciTestResults = $state>({}) @@ -1050,10 +1046,9 @@
selectableDiffs.some((d) => getItemKey(d) === item.key)} {allSelected} onToggleItem={(item) => toggleKey(item.key)} onSelectAll={selectAll} @@ -1110,9 +1105,6 @@
{/if}
- - {comparison.summary.total_diffs} total items - {selectableDiffs.length} {mergeIntoParent ? 'deployable' : 'updateable'} @@ -1278,7 +1270,6 @@ {diff.path} {:else} - {@const isSelectable = selectableDiffs.includes(diff)} {@const oldSummary = mergeIntoParent ? summaryCache[key]?.parent : summaryCache[key]?.current} @@ -1294,7 +1285,7 @@ {editUrl} {oldSummary} {newSummary} - renamed={oldSummary != newSummary && isSelectable && existsInBothWorkspaces} + renamed={oldSummary != newSummary && existsInBothWorkspaces} /> {/if} {/snippet}