Skip to content

Commit 7055c7a

Browse files
committed
💄
1 parent 3997a58 commit 7055c7a

File tree

8 files changed

+23
-7
lines changed

8 files changed

+23
-7
lines changed
Lines changed: 1 addition & 0 deletions
Loading

‎src/common/settingKeys.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export const NEVER_IGNORE_DEFAULT_BRANCH = 'neverIgnoreDefaultBranch';
1818
export const OVERRIDE_DEFAULT_BRANCH = 'overrideDefaultBranch';
1919
export const PULL_BRANCH = 'pullBranch';
2020
export const PULL_REQUEST_DESCRIPTION = 'pullRequestDescription';
21-
export const CREATE_FROM_TEMPLATE = 'createFromTemplate';
2221
export const NOTIFICATION_SETTING = 'notifications';
2322
export type NotificationVariants = 'off' | 'pullRequests';
2423
export const POST_CREATE = 'postCreate';

‎src/github/createPRViewProvider.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { PullRequestModel } from './pullRequestModel';
1717
import { getDefaultMergeMethod } from './pullRequestOverview';
1818
import { getAssigneesQuickPickItems, getLabelOptions, getMilestoneFromQuickPick, getProjectFromQuickPick, reviewersQuickPick } from './quickPicks';
1919
import { getIssueNumberLabelFromParsed, ISSUE_EXPRESSION, ISSUE_OR_URL_EXPRESSION, parseIssueExpressionOutput, variableSubstitution } from './utils';
20-
import { DisplayLabel, PreReviewState } from './views';
20+
import { ChangeTemplateReply, DisplayLabel, PreReviewState } from './views';
2121
import { RemoteInfo } from '../../common/types';
2222
import { ChooseBaseRemoteAndBranchResult, ChooseCompareRemoteAndBranchResult, ChooseRemoteAndBranchArgs, CreateParamsNew, CreatePullRequestNew, TitleAndDescriptionArgs } from '../../common/views';
2323
import type { Branch, Ref } from '../api/api';
@@ -794,7 +794,10 @@ export class CreatePullRequestViewProvider extends BaseCreatePullRequestViewProv
794794
);
795795

796796
if (selectedTemplate) {
797-
return this._replyMessage(message, { description: selectedTemplate.template });
797+
const reply: ChangeTemplateReply = {
798+
description: selectedTemplate.template
799+
};
800+
return this._replyMessage(message, reply);
798801
}
799802
return this._replyMessage(message, undefined);
800803
}

‎src/github/views.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ export enum PreReviewState {
158158
ReviewedWithoutComments
159159
}
160160

161+
export interface ChangeTemplateReply {
162+
description: string;
163+
}
164+
161165
export interface CancelCodingAgentReply {
162166
events: TimelineEvent[];
163167
}

‎webviews/common/common.css‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ body img.avatar {
176176
.section .icon-button:hover,
177177
.section .icon-button:focus {
178178
background-color: var(--vscode-toolbar-hoverBackground);
179+
cursor: pointer;
179180
}
180181

181182
.icon-button:focus,

‎webviews/components/icon.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export const gitPullRequestIcon = <Icon src={require('../../resources/icons/codi
3434
export const issuescon = <Icon src={require('../../resources/icons/codicons/issues.svg')} />;
3535
export const loadingIcon = <Icon className='loading' src={require('../../resources/icons/codicons/loading.svg')} />;
3636
export const milestoneIcon = <Icon src={require('../../resources/icons/codicons/milestone.svg')} />;
37+
export const notebookTemplate = <Icon src={require('../../resources/icons/codicons/notebook-template.svg')} />;
3738
export const passIcon = <Icon src={require('../../resources/icons/codicons/pass.svg')} />;
3839
export const projectIcon = <Icon src={require('../../resources/icons/codicons/github-project.svg')} />;
3940
export const quoteIcon = <Icon src={require('../../resources/icons/codicons/quote.svg')} />;

‎webviews/createPullRequestViewNew/app.tsx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ import { render } from 'react-dom';
88
import { RemoteInfo } from '../../common/types';
99
import { CreateParamsNew } from '../../common/views';
1010
import { isITeam, MergeMethod } from '../../src/github/interface';
11+
import { ChangeTemplateReply } from '../../src/github/views';
1112
import PullRequestContextNew from '../common/createContextNew';
1213
import { ErrorBoundary } from '../common/errorBoundary';
1314
import { LabelCreate } from '../common/label';
1415
import { ContextDropdown } from '../components/contextDropdown';
15-
import { accountIcon, editIcon, feedbackIcon, gitCompareIcon, milestoneIcon, prMergeIcon, projectIcon, sparkleIcon, stopCircleIcon, tagIcon } from '../components/icon';
16+
import { accountIcon, feedbackIcon, gitCompareIcon, milestoneIcon, notebookTemplate, prMergeIcon, projectIcon, sparkleIcon, stopCircleIcon, tagIcon } from '../components/icon';
1617
import { Avatar } from '../components/user';
1718

1819
type CreateMethod = 'create-draft' | 'create' | 'create-automerge-squash' | 'create-automerge-rebase' | 'create-automerge-merge';
@@ -179,7 +180,7 @@ export function main() {
179180
}
180181

181182
async function changeTemplate() {
182-
const result = await ctx.postMessage({ command: 'pr.changeTemplate' });
183+
const result: ChangeTemplateReply = await ctx.postMessage({ command: 'pr.changeTemplate' });
183184
if (result && result.description) {
184185
ctx.updateState({ pendingDescription: result.description });
185186
}
@@ -332,10 +333,10 @@ export function main() {
332333
: null}
333334
</div>
334335

335-
<div className='group-title'>
336+
<div className='description-title'>
336337
<label htmlFor='description' className='input-title'>Description</label>
337338
{ctx.createParams.usingTemplate ?
338-
<a title='Change template' className={`title-action icon-button${isBusy || !ctx.initialized ? ' disabled' : ''}`} onClick={() => changeTemplate()} tabIndex={0}>{editIcon}</a> : null}
339+
<a title='Change template' className={`title-action icon-button${isBusy || !ctx.initialized ? ' disabled' : ''}`} onClick={() => changeTemplate()} tabIndex={0}>{notebookTemplate}</a> : null}
339340
</div>
340341
<div className='group-description'>
341342
<textarea

‎webviews/createPullRequestViewNew/index.css‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ button.input-box {
9898
text-overflow: ellipsis;
9999
}
100100

101+
.description-title {
102+
display: flex;
103+
justify-content: space-between;
104+
align-items: center;
105+
}
106+
101107
.group-title {
102108
position: relative;
103109
display: flex;

0 commit comments

Comments
 (0)