From eb056442e2027ec6608d42dd4b4f57411e453c1e Mon Sep 17 00:00:00 2001 From: hugocasa Date: Tue, 24 Nov 2026 22:49:08 +0100 Subject: [PATCH] refactor: drop the review button beside the home header's change badges (#12600) * feat: one changes button for a workspace's drafts and fork drift Co-Authored-By: Claude Opus 5.5 * fix: name the changes and drafts buttons for screen readers Co-Authored-By: Claude Opus 5.5 * fix: keep the drafts count in the changes button's name when the comparison fails Co-Authored-By: Claude Opus 5.5 * refactor: drop the review button beside the fork badges and use the pencil badge for drafts Co-Authored-By: Claude Opus 5.5 * fix: name the compact drafts badge for screen readers Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- .../lib/components/ForkWorkspaceBanner.svelte | 67 ++++++++----------- .../components/WorkspaceDraftsBanner.svelte | 44 +++++------- 2 files changed, 46 insertions(+), 65 deletions(-) diff --git a/frontend/src/lib/components/ForkWorkspaceBanner.svelte b/frontend/src/lib/components/ForkWorkspaceBanner.svelte index f7c6b0b1c0..08ac12b1b7 100644 --- a/frontend/src/lib/components/ForkWorkspaceBanner.svelte +++ b/frontend/src/lib/components/ForkWorkspaceBanner.svelte @@ -148,8 +148,7 @@ } } - /** The compare page opened on one direction, for a badge that counts exactly that. The button - * beside them still chooses on the reader's behalf; a badge means the one thing it names. */ + /** The compare page opened on one direction, for a badge that counts exactly that. */ function compareDirHref(dir: 'deploy_to' | 'update'): string | undefined { if (!parentWorkspaceId || !$workspaceStore) return undefined return ( @@ -245,9 +244,13 @@ : total > 0 ? 'drift' : undefined} - + + {@const badged = + status === 'drafts' || + (status === 'drift' && + (changesAhead > 0 || changesBehind > 0 || conflicts > 0 || draftCount > 0))} {#key status} @@ -256,10 +259,6 @@ Checking for changes… {:else if error} Comparison failed - {:else if showDraftsOnly} - - {draftCount} draft{draftCount !== 1 ? 's' : ''} - {:else if total > 0} @@ -303,39 +302,29 @@ {conflicts}{compactCounts ? '' : ` conflict${conflicts !== 1 ? 's' : ''}`} {/if} - - {#if draftCount > 0} - - - {draftCount}{compactCounts ? '' : ` draft${draftCount !== 1 ? 's' : ''}`} - - {/if} + {/if} + + {#if (status === 'drafts' || status === 'drift') && draftCount > 0} + + + {draftCount}{compactCounts ? '' : ` draft${draftCount !== 1 ? 's' : ''}`} + {/if} {/key} - {#if showDraftsOnly} - - {:else} + {#if !badged} - {:else} - - - - {draftCount} draft{draftCount !== 1 ? 's' : ''} - - - - {/if} + + {@const label = `Review and deploy ${draftCount} draft${draftCount !== 1 ? 's' : ''}`} + + + + + {draftCount}{phone || !homeCountLabels() ? '' : ` draft${draftCount !== 1 ? 's' : ''}`} + + {/snippet}