Skip to content

Commit f11ac8e

Browse files
committed
Updates conflict detection to merge target status
1 parent d6fc0fc commit f11ac8e

File tree

12 files changed

+466
-255
lines changed

12 files changed

+466
-255
lines changed

images/icons/merge-target.svg

Lines changed: 1 addition & 0 deletions
Loading

images/icons/template/mapping.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,6 @@
5858
"tags-view-filled": 61757,
5959
"worktrees-view-filled": 61758,
6060
"launchpad-view": 61759,
61-
"launchpad-view-filled": 61760
61+
"launchpad-view-filled": 61760,
62+
"merge-target": 61761
6263
}

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9823,6 +9823,13 @@
98239823
"fontPath": "dist/glicons.woff2",
98249824
"fontCharacter": "\\f140"
98259825
}
9826+
},
9827+
"gitlens-merge-target": {
9828+
"description": "merge-target icon",
9829+
"default": {
9830+
"fontPath": "dist/glicons.woff2",
9831+
"fontCharacter": "\\f141"
9832+
}
98269833
}
98279834
},
98289835
"menus": {

src/webviews/apps/plus/home/components/branch-card.ts

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import '../../../shared/components/rich/issue-icon';
1919
import '../../../shared/components/rich/pr-icon';
2020
import '../../../shared/components/actions/action-item';
2121
import '../../../shared/components/actions/action-nav';
22-
import './merge-conflict-warning';
22+
import './merge-target-status';
2323

2424
export const branchCardStyles = css`
2525
.branch-item {
@@ -136,6 +136,11 @@ export const branchCardStyles = css`
136136
.branch-item__section.mb-1 {
137137
margin-block: 0.4rem;
138138
}
139+
140+
.branch-item__merge-target {
141+
position: absolute;
142+
bottom: 0.4rem;
143+
}
139144
`;
140145

141146
type NothingType = typeof nothing;
@@ -318,7 +323,7 @@ export abstract class GlBranchCardBase extends GlElement {
318323
const tracking = this.renderTracking();
319324
const avatars = this.renderAvatars();
320325
const indicator = this.branch.opened ? undefined : this.renderBranchIndicator?.();
321-
const conflict = this.renderPotentialMergeConflicts();
326+
const mergeTargetStatus = this.renderMergeTargetStatus();
322327
const timestamp = this.renderTimestamp();
323328

324329
return html`
@@ -334,7 +339,6 @@ export abstract class GlBranchCardBase extends GlElement {
334339
<code-icon icon=${this.branch.worktree ? 'gl-worktrees-view' : 'git-branch'}></code-icon>
335340
</span>
336341
<span class="branch-item__name">${this.branch.name}</span>
337-
${conflict}
338342
</p>
339343
</div>
340344
<div class="branch-item__section branch-item__section--details" slot="context">
@@ -346,7 +350,7 @@ export abstract class GlBranchCardBase extends GlElement {
346350
</p>`,
347351
)}
348352
</div>
349-
${actionsSection ?? nothing}
353+
${actionsSection ?? nothing}${mergeTargetStatus}
350354
</gl-work-item>
351355
`;
352356
}
@@ -368,20 +372,21 @@ export abstract class GlBranchCardBase extends GlElement {
368372
</gl-work-item>
369373
`;
370374
}
375+
371376
// ${this.branch.pr.launchpad != null
372377
// ? html`<p>
373378
// <span class="branch-item__category">${this.branch.pr.launchpad.category}</span>
374379
// </p>`
375380
// : nothing}
376381

377-
protected renderPotentialMergeConflicts() {
378-
if (!this.branch.target?.potentialMergeConflicts) return nothing;
382+
protected renderMergeTargetStatus() {
383+
if (!this.branch.mergeTarget) return nothing;
379384

380-
return html`
381-
<gl-merge-conflict-warning
382-
.conflict=${this.branch.target.potentialMergeConflicts}
383-
></gl-merge-conflict-warning>
384-
`;
385+
return html`<gl-merge-target-status
386+
class="branch-item__merge-target"
387+
.branch=${this.branch.name}
388+
.target=${this.branch.mergeTarget}
389+
></gl-merge-target-status>`;
385390
}
386391

387392
protected renderIssuesItem() {

src/webviews/apps/plus/home/components/merge-conflict-warning.ts

Lines changed: 0 additions & 194 deletions
This file was deleted.

0 commit comments

Comments
 (0)