Skip to content

Commit 86aa087

Browse files
Copilotalexr00
andcommitted
Use ID instead of title attribute for edit button selector
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 1ce8868 commit 86aa087

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

webviews/common/constants.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@
77
* ID for the main comment textarea element in the PR description page.
88
*/
99
export const COMMENT_TEXTAREA_ID = 'comment-textarea';
10+
11+
/**
12+
* ID for the edit title button in the PR/Issue header.
13+
*/
14+
export const EDIT_TITLE_BUTTON_ID = 'edit-title-button';

webviews/components/header.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { copilotEventToStatus, CopilotPRStatus, mostRecentCopilotEvent } from '.
1111
import { CopilotStartedEvent, TimelineEvent } from '../../src/common/timelineEvent';
1212
import { GithubItemStateEnum, StateReason } from '../../src/github/interface';
1313
import { CodingAgentContext, OverviewContext, PullRequest } from '../../src/github/views';
14+
import { EDIT_TITLE_BUTTON_ID } from '../common/constants';
1415
import PullRequestContext from '../common/context';
1516
import { useStateProp } from '../common/hooks';
1617

@@ -129,7 +130,7 @@ function Title({ title, titleHTML, number, url, inEditMode, setEditMode, setCurr
129130
</a>
130131
</h2>
131132
{canEdit ?
132-
<button title="Rename" onClick={() => setEditMode(true)} className="icon-button">
133+
<button id={EDIT_TITLE_BUTTON_ID} title="Rename" onClick={() => setEditMode(true)} className="icon-button">
133134
{editIcon}
134135
</button>
135136
: null}

webviews/editorWebview/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ textarea:focus,
8181
}
8282

8383
/* Hide edit button when stuck */
84-
.title.stuck .overview-title button[title="Rename"] {
84+
.title.stuck #edit-title-button {
8585
display: none;
8686
}
8787

0 commit comments

Comments
 (0)