Skip to content

Commit 8b192b8

Browse files
authored
[Draft] [WIP] prefix takes away visual space I would prefer for the PR title (#7343)
Fixes #7338
1 parent 366e072 commit 8b192b8

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/github/markdownUtils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,9 @@ export async function issueMarkdown(
168168
year: 'numeric',
169169
})} \n`,
170170
);
171+
const titleWithDraft = (issue instanceof PullRequestModel && issue.isDraft) ? `\[DRAFT\] ${issue.title}` : issue.title;
171172
const title = marked
172-
.parse(issue.title, {
173+
.parse(titleWithDraft, {
173174
renderer: new PlainTextRenderer(),
174175
})
175176
.trim();

src/view/treeNodes/pullRequestNode.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import * as vscode from 'vscode';
77
import { Repository } from '../../api/api';
8+
import { COPILOT_ACCOUNTS } from '../../common/comment';
89
import { getCommentingRanges } from '../../common/commentingRanges';
910
import { InMemFileChange, SlimFileChange } from '../../common/file';
1011
import Logger from '../../common/logger';
@@ -302,7 +303,10 @@ export class PRNode extends TreeNode implements vscode.CommentingRangeProvider2
302303
const currentBranchIsForThisPR = this.pullRequestModel.equals(this._folderReposManager.activePullRequest);
303304

304305
const { title, number, author, isDraft, html_url } = this.pullRequestModel;
305-
const labelTitle = this.pullRequestModel.title.length > 50 ? `${this.pullRequestModel.title.substring(0, 50)}...` : this.pullRequestModel.title;
306+
let labelTitle = this.pullRequestModel.title.length > 50 ? `${this.pullRequestModel.title.substring(0, 50)}...` : this.pullRequestModel.title;
307+
if (COPILOT_ACCOUNTS[this.pullRequestModel.author.login]) {
308+
labelTitle = labelTitle.replace('[WIP]', '');
309+
}
306310
const login = author.specialDisplayName ?? author.login;
307311

308312
const hasNotification = this._notificationProvider.hasNotification(this.pullRequestModel);
@@ -318,7 +322,7 @@ export class PRNode extends TreeNode implements vscode.CommentingRangeProvider2
318322
labelPrefix += `#${formattedPRNumber}: `;
319323
}
320324

321-
const label = `${labelPrefix}${isDraft ? '[DRAFT] ' : ''}${labelTitle}`;
325+
const label = `${labelPrefix}${isDraft ? '| ' : ''}${labelTitle}`;
322326
const description = `by @${login}`;
323327
const command = {
324328
title: vscode.l10n.t('View Pull Request Description'),

0 commit comments

Comments
 (0)