From f3c103403c37dc75b02cc8f0a7672019491d80fa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 4 Dec 2025 06:59:13 +0000 Subject: [PATCH 1/4] Replace hardcoded PR/MR labels with dynamic forge-based labels (#11444) - Refactor: rename GENERATE_MESSAGES to generateMessages for reactive clarity - Update clipboard messages and context menu labels to use dynamic forge labels - Update modal titles and CTA labels to use dynamic forge unit names Co-authored-by: Byron <63622+Byron@users.noreply.github.com> --- .../src/components/BranchHeaderContextMenu.svelte | 12 ++++++++---- apps/desktop/src/components/BranchReview.svelte | 11 ++++++----- apps/desktop/src/components/BranchesView.svelte | 2 +- apps/desktop/src/components/BranchesViewPR.svelte | 2 +- .../src/components/CanPublishReviewPlugin.svelte | 3 ++- apps/desktop/src/components/PRBranchView.svelte | 3 ++- apps/desktop/src/components/PullRequestCard.svelte | 4 ++-- apps/desktop/src/components/ReviewCreation.svelte | 6 ++++-- .../src/components/editor/MessageEditor.svelte | 12 +++++++----- .../profileSettings/IntegrationsSettings.svelte | 10 +++++++--- 10 files changed, 40 insertions(+), 25 deletions(-) diff --git a/apps/desktop/src/components/BranchHeaderContextMenu.svelte b/apps/desktop/src/components/BranchHeaderContextMenu.svelte index 221f02dcfa..bf1436ec66 100644 --- a/apps/desktop/src/components/BranchHeaderContextMenu.svelte +++ b/apps/desktop/src/components/BranchHeaderContextMenu.svelte @@ -55,6 +55,8 @@ const aiService = inject(AI_SERVICE); const stackService = inject(STACK_SERVICE); const forge = inject(DEFAULT_FORGE_FACTORY); + const prService = $derived(forge.current.prService); + const prUnit = $derived(prService?.unit); const promptService = inject(PROMPT_SERVICE); const urlService = inject(URL_SERVICE); const clipboardService = inject(CLIPBOARD_SERVICE); @@ -303,11 +305,11 @@ {#snippet children(pr)} - + {#snippet submenu({ close: closeSubmenu })} { urlService.openExternalUrl(pr.htmlUrl); @@ -316,10 +318,12 @@ }} /> { - clipboardService.write(pr.htmlUrl, { message: 'PR link copied' }); + clipboardService.write(pr.htmlUrl, { + message: `${prUnit?.abbr ?? 'PR'} link copied` + }); closeSubmenu(); close(); }} diff --git a/apps/desktop/src/components/BranchReview.svelte b/apps/desktop/src/components/BranchReview.svelte index 3c4f79f9b5..1ba7d73a73 100644 --- a/apps/desktop/src/components/BranchReview.svelte +++ b/apps/desktop/src/components/BranchReview.svelte @@ -28,6 +28,7 @@ const forge = inject(DEFAULT_FORGE_FACTORY); const prService = $derived(forge.current.prService); const reviewUnit = $derived(prService?.unit.abbr); + const reviewUnitName = $derived(prService?.unit.name ?? 'Pull request'); const canPublishPR = $derived(!!canPublishReviewPlugin?.imports.canPublishPR); @@ -49,21 +50,21 @@ { modal?.show(); }} >

- It's strongly recommended to create pull requests starting with the branch at the base of the - stack. + It's strongly recommended to create {reviewUnitName.toLowerCase()}s starting with the branch + at the base of the stack.
- Do you still want to create this pull request? + Do you still want to create this {reviewUnitName.toLowerCase()}?

{#snippet controls(close)} - + {/snippet}
diff --git a/apps/desktop/src/components/BranchesView.svelte b/apps/desktop/src/components/BranchesView.svelte index 0515b2cdea..eeccb1bf21 100644 --- a/apps/desktop/src/components/BranchesView.svelte +++ b/apps/desktop/src/components/BranchesView.svelte @@ -334,7 +334,7 @@ icon="workbench" onclick={applyFromFork} > - Apply PR to workspace + Apply {prUnit?.abbr ?? 'PR'} to workspace {/if} diff --git a/apps/desktop/src/components/BranchesViewPR.svelte b/apps/desktop/src/components/BranchesViewPR.svelte index a5cb464310..0a90d9cb9a 100644 --- a/apps/desktop/src/components/BranchesViewPR.svelte +++ b/apps/desktop/src/components/BranchesViewPR.svelte @@ -110,7 +110,7 @@ await handleConfirmRemote(pr)} diff --git a/apps/desktop/src/components/CanPublishReviewPlugin.svelte b/apps/desktop/src/components/CanPublishReviewPlugin.svelte index ee11407eff..c384a59ee8 100644 --- a/apps/desktop/src/components/CanPublishReviewPlugin.svelte +++ b/apps/desktop/src/components/CanPublishReviewPlugin.svelte @@ -23,10 +23,11 @@ const prService = $derived(forge.current.prService); const prQuery = $derived(prNumber ? prService?.get(prNumber) : undefined); const pr = $derived(prQuery?.response); + const reviewUnitName = $derived(prService?.unit.name ?? 'Pull request'); const canPublishPR = $derived(forge.current.authenticated && !pr); - const ctaLabel = 'Create Pull Request…'; + const ctaLabel = $derived(`Create ${reviewUnitName}…`); export const imports = { get allowedToPublishPR() { diff --git a/apps/desktop/src/components/PRBranchView.svelte b/apps/desktop/src/components/PRBranchView.svelte index 19ab9bf370..7a66da23e9 100644 --- a/apps/desktop/src/components/PRBranchView.svelte +++ b/apps/desktop/src/components/PRBranchView.svelte @@ -17,6 +17,7 @@ const prService = $derived(forge.current.prService); const prQuery = $derived(prService?.get(prNumber, { forceRefetch: true })); const unitSymbol = $derived(prService?.unit.symbol ?? ''); + const unitAbbr = $derived(prService?.unit.abbr ?? 'PR'); @@ -24,7 +25,7 @@ {#snippet header()}

- PR {unitSymbol}{pr.number}: + {unitAbbr} {unitSymbol}{pr.number}: {pr.title}

{/snippet} diff --git a/apps/desktop/src/components/PullRequestCard.svelte b/apps/desktop/src/components/PullRequestCard.svelte index 88db72c397..0c5a9dea35 100644 --- a/apps/desktop/src/components/PullRequestCard.svelte +++ b/apps/desktop/src/components/PullRequestCard.svelte @@ -126,7 +126,7 @@ { - clipboardService.write(pr.htmlUrl, { message: 'PR link copied' }); + clipboardService.write(pr.htmlUrl, { message: `${abbr} link copied` }); contextMenuEl?.close(); }} /> @@ -179,7 +179,7 @@ icon="copy-small" tooltip="Copy {abbr} link" onclick={() => { - clipboardService.write(pr.htmlUrl, { message: 'PR link copied' }); + clipboardService.write(pr.htmlUrl, { message: `${abbr} link copied` }); }} />