diff --git a/src/extensionState.ts b/src/extensionState.ts index 4722bff657..ca99f08c3d 100644 --- a/src/extensionState.ts +++ b/src/extensionState.ts @@ -15,6 +15,8 @@ export const PREVIOUS_CREATE_METHOD = 'github.pullRequest.previousCreateMethod'; export const LAST_USED_EMAIL = 'github.pullRequest.lastUsedEmail'; export const BRANCHES_ASSOCIATED_WITH_PRS = 'github.pullRequest.branchesAssociatedWithPRs'; export const RECENTLY_USED_BRANCHES = 'github.pullRequest.recentlyUsedBranches'; +export const PULL_REQUEST_DESCRIPTION_COLLAPSED = 'github.pullRequest.descriptionCollapsed'; +export const ISSUE_DESCRIPTION_COLLAPSED = 'github.issue.descriptionCollapsed'; export interface RepoState { mentionableUsers?: IAccount[]; diff --git a/src/github/issueOverview.ts b/src/github/issueOverview.ts index f3a20928ea..c537a045dc 100644 --- a/src/github/issueOverview.ts +++ b/src/github/issueOverview.ts @@ -27,6 +27,7 @@ import { CommentEvent, EventType, ReviewStateValue, TimelineEvent } from '../com import { asPromise, formatError } from '../common/utils'; import { generateUuid } from '../common/uuid'; import { IRequestMessage, WebviewBase } from '../common/webview'; +import { ISSUE_DESCRIPTION_COLLAPSED } from '../extensionState'; export function panelKey(owner: string, repo: string, number: number): string { return `${owner}/${repo}#${number}`; @@ -50,6 +51,8 @@ export class IssueOverviewPanel extends W protected _scrollPosition = { x: 0, y: 0 }; private _identityUpdateSequence = 0; protected readonly previewLog = { label: 'Issue', id: IssueOverviewPanel.ID }; + /** Where whether descriptions are collapsed is remembered, separately for issues and pull requests. */ + protected readonly descriptionCollapsedKey: string = ISSUE_DESCRIPTION_COLLAPSED; protected get _folderRepositoryManager(): FolderRepositoryManager { if (this._localFolderRepositoryManager) { @@ -307,6 +310,19 @@ export class IssueOverviewPanel extends W return isInCodespaces(); } + /** Whether the description opens collapsed, which is how the last description of this kind was left. */ + protected isDescriptionCollapsed(): boolean { + return this._folderRepositoryManager.context.globalState.get(this.descriptionCollapsedKey, false); + } + + private async setDescriptionCollapsed(message: IRequestMessage): Promise { + try { + await this._folderRepositoryManager.context.globalState.update(this.descriptionCollapsedKey, message.args === true); + } finally { + await this._replyMessage(message, {}); + } + } + protected async getInitializeContext(currentUser: IAccount, issue: IssueModel, timelineEvents: TimelineEvent[], repositoryAccess: RepoAccessAndMergeMethods, viewerCanEdit: boolean, assignableUsers: IAccount[]): Promise { const hasWritePermission = repositoryAccess.hasWritePermission; const canEdit = hasWritePermission || viewerCanEdit; @@ -347,6 +363,7 @@ export class IssueOverviewPanel extends W canRequestCopilotReview: false, reactions: issue.item.reactions, isAuthor: issue.author.login === currentUser.login, + isDescriptionCollapsed: this.isDescriptionCollapsed(), }; return context; @@ -369,6 +386,7 @@ export class IssueOverviewPanel extends W state: issueModel.state, stateReason: issueModel.stateReason, isIssue: true, + isDescriptionCollapsed: this.isDescriptionCollapsed(), } satisfies IssuePreview, }); Logger.debug('Issue overview preview loaded from model', IssueOverviewPanel.ID); @@ -483,7 +501,7 @@ export class IssueOverviewPanel extends W } const preview = await this.getPreview(repository, identity.number); if (isLoading()) { - await this._postMessage({ command: 'pr.preview', pullrequest: preview }); + await this._postMessage({ command: 'pr.preview', pullrequest: { ...preview, isDescriptionCollapsed: this.isDescriptionCollapsed() } }); Logger.debug(`${this.previewLog.label} overview preview loaded in ${Date.now() - start}ms`, this.previewLog.id); } } catch (error) { @@ -605,6 +623,8 @@ export class IssueOverviewPanel extends W return this.uploadFiles(message); case 'pr.upload-pasted-files': return this.uploadPastedFiles(message); + case 'pr.set-description-collapsed': + return this.setDescriptionCollapsed(message); default: return this.MESSAGE_UNHANDLED; } diff --git a/src/github/pullRequestOverview.ts b/src/github/pullRequestOverview.ts index 19b4087736..b0594fc463 100644 --- a/src/github/pullRequestOverview.ts +++ b/src/github/pullRequestOverview.ts @@ -61,6 +61,7 @@ import { EventType, ReviewEvent, SessionLinkInfo, TimelineEvent } from '../commo import { toOpenIssueWebviewUri, toOpenPullRequestWebviewUri } from '../common/uri'; import { asPromise, formatError } from '../common/utils'; import { IRequestMessage, PULL_REQUEST_OVERVIEW_VIEW_TYPE } from '../common/webview'; +import { PULL_REQUEST_DESCRIPTION_COLLAPSED } from '../extensionState'; import { toCheckRunLogUri } from '../view/checkRunLogContentProvider'; import { getGitHubCommitFileSystemProvider } from '../view/githubFileContentProvider'; @@ -78,6 +79,7 @@ export class PullRequestOverviewPanel extends IssueOverviewPanel & { isIssue: true }; + | 'author' | 'createdAt' | 'state' | 'stateReason' | 'isDescriptionCollapsed'> & { isIssue: true }; /** Read-only content shown during a cold load; never persisted as a complete PR. */ export type PullRequestPreview = Pick & { isIssue?: false; stateReason?: undefined }; + | 'author' | 'createdAt' | 'state' | 'isDraft' | 'base' | 'head' | 'isDescriptionCollapsed'> & { isIssue?: false; stateReason?: undefined }; export type OverviewItemPreview = IssuePreview | PullRequestPreview; diff --git a/src/test/github/pullRequestOverview.test.ts b/src/test/github/pullRequestOverview.test.ts index 51cecbcc67..9098db52ac 100644 --- a/src/test/github/pullRequestOverview.test.ts +++ b/src/test/github/pullRequestOverview.test.ts @@ -180,7 +180,7 @@ describe('PullRequestOverview', function () { const opening = openPanel(new Promise(resolve => resolveModel = resolve)); try { await new Promise(resolve => setImmediate(resolve)); - assert.deepStrictEqual(messages.find(message => message.command === 'pr.preview')?.pullrequest, preview); + assert.deepStrictEqual(messages.find(message => message.command === 'pr.preview')?.pullrequest, { ...preview, isDescriptionCollapsed: false }); assert.strictEqual(messages.some(message => message.command === 'pr.initialize'), false); sinon.assert.notCalled(getAssignableUsers); } finally { @@ -221,7 +221,7 @@ describe('PullRequestOverview', function () { resolvePreview(preview); await new Promise(resolve => setImmediate(resolve)); - assert.deepStrictEqual(messages.filter(message => message.command === 'pr.preview').pop()?.pullrequest, preview); + assert.deepStrictEqual(messages.filter(message => message.command === 'pr.preview').pop()?.pullrequest, { ...preview, isDescriptionCollapsed: false }); assert.strictEqual(messages.some(message => message.command === 'pr.initialize'), false); } finally { resolveModel?.(model); @@ -1492,7 +1492,7 @@ describe('PullRequestOverview', function () { let issueModel: IssueModel; let webviewPanel: vscode.WebviewPanel; let messages: { command: string; pullrequest?: Partial }[]; - let onDidReceiveMessage: vscode.EventEmitter<{ command: string }>; + let onDidReceiveMessage: vscode.EventEmitter; let getPreview: SinonStub<[number], Promise>; let getRepository: SinonStub, ReturnType>; let getRepositoryAccess: SinonStub, ReturnType>; @@ -1571,6 +1571,7 @@ describe('PullRequestOverview', function () { state: issueModel.state, stateReason: issueModel.stateReason, isIssue: true, + isDescriptionCollapsed: false, }); assert.strictEqual(messages.some(message => message.command === 'pr.initialize'), false); sinon.assert.calledOnce(createPanel); @@ -1620,6 +1621,22 @@ describe('PullRequestOverview', function () { sinon.assert.notCalled(getPreview); }); + it('remembers whether descriptions are collapsed separately for issues and pull requests', async function () { + const pullRequestPanel = new TestPullRequestOverviewPanel(telemetry, pullRequestManager); + context.subscriptions.push(pullRequestPanel); + sinon.stub(pullRequestPanel, '_replyMessage').resolves(); + await pullRequestPanel._onDidReceiveMessage({ req: 'collapse-pull-request', command: 'pr.set-description-collapsed', args: true }); + const initialized = () => messages.filter(message => message.command === 'pr.initialize').pop()?.pullrequest; + + await openPanel(); + assert.strictEqual(initialized()?.isDescriptionCollapsed, false, 'collapsing a pull request description does not collapse issues'); + + onDidReceiveMessage.fire({ command: 'pr.set-description-collapsed', req: 'collapse-issue', args: true }); + await new Promise(resolve => setImmediate(resolve)); + await openPanel(); + assert.strictEqual(initialized()?.isDescriptionCollapsed, true); + }); + previewLoadingTests(() => ({ model: issueModel, preview, getPreview, getRepository, getRepositoryAccess, getAssignableUsers, openPanel, messages, webviewPanel })); }); @@ -1834,6 +1851,27 @@ describe('PullRequestOverview', function () { }); }); + describe('collapsed descriptions', function () { + const initialized = (webviewPostMessage: SinonStub) => webviewPostMessage.args.map(([message]: [PanelMessage]) => message.res) + .find(response => response?.command === 'pr.initialize')?.pullrequest; + + it('opens the next pull request with its description collapsed once one is collapsed', async function () { + const first = await createPanel(1000); + assert.strictEqual(initialized(first.webviewPostMessage)?.isDescriptionCollapsed, false); + const replied = new Promise(resolve => first.onDidPost(message => { + if (message.seq === 'collapse') { + resolve(); + } + })); + + first.received.fire({ command: 'pr.set-description-collapsed', req: 'collapse', args: true }); + await replied; + + const second = await createPanel(1001); + assert.strictEqual(initialized(second.webviewPostMessage)?.isDescriptionCollapsed, true); + }); + }); + describe('loadStack', function () { it('marks the stack loaded before posting linked stack details', async function () { const { panel, model, stackQuery, externalUri } = await createPanel(); diff --git a/webviews/common/context.tsx b/webviews/common/context.tsx index 1552eb5994..1ce2fed185 100644 --- a/webviews/common/context.tsx +++ b/webviews/common/context.tsx @@ -65,6 +65,12 @@ export class PRContext { public setDescription = (description: string) => this.postMessage({ command: 'pr.edit-description', args: { text: description } }); + /** Collapses or expands the description, and remembers it for the next pull request or issue that is opened. */ + public setDescriptionCollapsed = (collapsed: boolean) => { + this.updatePR({ isDescriptionCollapsed: collapsed }); + return this.postMessage({ command: 'pr.set-description-collapsed', args: collapsed }); + }; + public checkout = () => this.postMessage({ command: 'pr.checkout' }); public openChanges = (openToTheSide?: boolean) => this.postMessage({ command: 'pr.open-changes', args: { openToTheSide } }); @@ -610,7 +616,7 @@ export class PRContext { this.setPR(undefined); return; case 'pr.initialize': - return this.setPR(this.keepSubmittingReview(message.pullrequest)); + return this.setPR(this.keepDescriptionCollapsed(this.keepSubmittingReview(message.pullrequest))); case 'pr.update': return this.updatePR(message.pullrequest); case 'update-state': @@ -670,6 +676,18 @@ export class PRContext { return { ...pr, busy: true, lastReviewType: review.type, pendingReviewType: review.type }; } + /** + * Reloading a pull request keeps its description as it is, even when it was collapsed or expanded in another overview + * since. That is only for the next one that is opened. + */ + private keepDescriptionCollapsed(pr: PullRequest): PullRequest { + const shown = this.pr; + if (shown?.url !== pr.url || shown.isDescriptionCollapsed === undefined) { + return pr; + } + return { ...pr, isDescriptionCollapsed: shown.isDescriptionCollapsed }; + } + public static instance = new PRContext(); } diff --git a/webviews/components/comment.tsx b/webviews/components/comment.tsx index b0be33fa11..443534b9ae 100644 --- a/webviews/components/comment.tsx +++ b/webviews/components/comment.tsx @@ -6,7 +6,7 @@ import React, { useCallback, useContext, useEffect, useRef, useState } from 'react'; import { ContextDropdown } from './contextDropdown'; import { CopyButton } from './copyButton'; -import { cloudUploadIcon, editIcon, loadingIcon, quoteIcon, sparkleIcon, stopCircleIcon, trashIcon } from './icon'; +import { chevronDownIcon, cloudUploadIcon, editIcon, loadingIcon, quoteIcon, sparkleIcon, stopCircleIcon, trashIcon } from './icon'; import { nbsp, Spaced } from './space'; import { Timestamp } from './timestamp'; import { AuthorLink, Avatar } from './user'; @@ -81,6 +81,8 @@ function replaceEditPlaceholder( draftComment.current.dirty = true; } +const DESCRIPTION_CONTENT_ID = 'description-content'; + export function CommentView(commentProps: Props) { const { isPRDescription, children, comment, headerInEditMode } = commentProps; const { bodyHTML, body } = comment; @@ -92,9 +94,10 @@ export function CommentView(commentProps: Props) { const pullRequestReviewId = (comment as IComment).pullRequestReviewId; const [bodyMd, setBodyMd] = useStateProp(body); const [bodyHTMLState, setBodyHtml] = useStateProp(bodyHTML); - const { deleteComment, editComment, setDescription, pr } = useContext(PullRequestContext); + const { deleteComment, editComment, setDescription, setDescriptionCollapsed, updatePR, pr } = useContext(PullRequestContext); const currentDraft = pr?.pendingCommentDrafts && pr.pendingCommentDrafts[id]; const [inEditMode, setEditMode] = useState(!!currentDraft); + const [collapsed, setCollapsed] = useStateProp(!!isPRDescription && !!(comment as PullRequest).isDescriptionCollapsed); const [showActionBar, setShowActionBar] = useState(false); const [isDeleting, runDelete] = useBusyAction(); const commentUrl = (comment as Partial).htmlUrl || (comment as PullRequest).url; @@ -131,12 +134,35 @@ export function CommentView(commentProps: Props) { const ariaAnnouncement = ((comment as CommentEvent | ReviewEvent).event === EventType.Commented || (comment as CommentEvent | ReviewEvent).event === EventType.Reviewed) ? ariaAnnouncementForReview(comment as (CommentEvent | ReviewEvent)) : undefined; + const content = <> + + {children} + ; + return ( setShowActionBar(true)} onMouseLeave={() => setShowActionBar(false)} onFocus={() => setShowActionBar(true)} + collapsed={collapsed} + collapseToggle={isPRDescription + ? { + contentId: DESCRIPTION_CONTENT_ID, + label: 'description', + onToggle: () => { + setCollapsed(!collapsed); + void setDescriptionCollapsed(!collapsed); + }, + } + : undefined} > {ariaAnnouncement ?
: null} {/* Kept visible while deleting, so the progress still shows once the mouse leaves for the confirmation. */} @@ -152,7 +178,14 @@ export function CommentView(commentProps: Props) { navigator.clipboard.writeText(commentUrl)} /> ) : null} {canEdit ? ( - ) : null} @@ -167,24 +200,19 @@ export function CommentView(commentProps: Props) { ) : null}
- - {children} + {/* Kept in the DOM while collapsed, so the chevron always has a region to control. */} + {isPRDescription ? : content}
); } export const CommentPreview = (preview: OverviewItemPreview | PullRequest) => ( - - {preview.bodyHTML === undefined && preview.body - ?
{preview.body}
- : } + + {preview.isDescriptionCollapsed + ? null + : preview.bodyHTML === undefined && preview.body + ?
{preview.body}
+ : }
); @@ -194,6 +222,10 @@ type CommentBoxProps = { onFocus?: React.FocusEventHandler; onMouseEnter?: React.MouseEventHandler; onMouseLeave?: React.MouseEventHandler; + /** Hides everything below the header, which then has the bottom corners of the box. */ + collapsed?: boolean; + /** Adds a chevron at the end of the header that collapses the element with `contentId`, which `label` names. */ + collapseToggle?: { contentId: string; label: string; onToggle: () => void }; children?: React.ReactNode; }; @@ -216,7 +248,7 @@ const DESCRIPTORS = { const reviewDescriptor = (state: keyof typeof DESCRIPTORS) => DESCRIPTORS[state]; -function CommentBox({ for: comment, onFocus, onMouseEnter, onMouseLeave, children }: CommentBoxProps) { +function CommentBox({ for: comment, onFocus, onMouseEnter, onMouseLeave, collapsed, collapseToggle, children }: CommentBoxProps) { const asNotPullRequest = comment as Partial; const htmlUrl = asNotPullRequest.htmlUrl ?? (comment as PullRequest).url; const isDraft = (isIComment(comment) && comment.isDraft) ?? (isReviewEvent(comment) && (comment.state?.toLocaleUpperCase() === 'PENDING')); @@ -226,7 +258,7 @@ function CommentBox({ for: comment, onFocus, onMouseEnter, onMouseLeave, childre return (
-

0) ? '' : ' no-details'}`}> +

0) ? '' : ' no-details'}${collapsed ? ' collapsed' : ''}`}> @@ -248,6 +280,19 @@ function CommentBox({ for: comment, onFocus, onMouseEnter, onMouseLeave, childre ) : null} + {collapseToggle ? ( + + ) : null}

{children}
diff --git a/webviews/editorWebview/index.css b/webviews/editorWebview/index.css index abbea0dff9..a310062f95 100644 --- a/webviews/editorWebview/index.css +++ b/webviews/editorWebview/index.css @@ -466,6 +466,32 @@ body .comment-container .review-comment-header { margin-left: auto; } +.review-comment-header .comment-chevron { + margin-left: auto; + flex-shrink: 0; +} + +.review-comment-header .comment-chevron:hover, +.review-comment-header .comment-chevron:focus { + background-color: var(--vscode-toolbar-hoverBackground); +} + +.comment-chevron[aria-expanded="false"] .icon { + transform: rotate(-90deg); +} + +/* The ids override the border below headers that have content after them, which is only hidden. */ +#main #description .review-comment-header.collapsed { + border-bottom: none; + border-bottom-left-radius: 6px; + border-bottom-right-radius: 6px; +} + +/* Keeps the actions that show on hover beside the chevron instead of over it. */ +#description .action-bar { + right: 40px; +} + .review-comment-header .pending { color: inherit; font-style: italic; @@ -2120,6 +2146,10 @@ code { border: 1px solid var(--vscode-panel-border); } +.vscode-high-contrast #main #description .review-comment-header.collapsed { + border-bottom: 1px solid var(--vscode-panel-border); +} + .vscode-high-contrast .comment-container .comment-body, .vscode-high-contrast .review-comment-container .review-body { border: 1px solid var(--vscode-panel-border); diff --git a/webviews/editorWebview/test/app.test.tsx b/webviews/editorWebview/test/app.test.tsx index 471297de69..1f3d6ada35 100644 --- a/webviews/editorWebview/test/app.test.tsx +++ b/webviews/editorWebview/test/app.test.tsx @@ -163,9 +163,33 @@ describe('Root', function () { , ); out.container.querySelector('.overview-title h2 a')!.removeAttribute('data-vscode-context'); + // The preview has no controls, so it has no chevron to collapse the description. + out.container.querySelector('#description .comment-chevron')!.remove(); assert.deepStrictEqual(selectors.map(selector => out.container.querySelector(selector)!.outerHTML), previewMarkup); }); + it('shows the description collapsed in the preview when the last one was collapsed', function () { + const pr = new PullRequestBuilder().canEdit(false).isAuthor(false).isDescriptionCollapsed(true).build(); + const context = new PRContext(pr); + const out = render( + + + , + ); + const header = '#description .review-comment-header'; + const previewHeader = out.container.querySelector(header)!.outerHTML; + assert.strictEqual(out.container.querySelector('#description .comment-body'), null); + + out.rerender( + + + , + ); + out.container.querySelector('#description .comment-chevron')!.remove(); + assert.strictEqual(out.container.querySelector(header)!.outerHTML, previewHeader, 'the description does not move when it is loaded'); + assert(document.getElementById('description-content')?.hidden); + }); + it('uses a collapsed metadata placeholder in a narrow preview', function () { const media = window.matchMedia(singleColumnLayoutQuery); sinon.stub(window, 'matchMedia').returns({ ...media, matches: true, addEventListener() { }, removeEventListener() { } }); diff --git a/webviews/editorWebview/test/builder/pullRequest.ts b/webviews/editorWebview/test/builder/pullRequest.ts index ce92425d2b..1302b7be98 100644 --- a/webviews/editorWebview/test/builder/pullRequest.ts +++ b/webviews/editorWebview/test/builder/pullRequest.ts @@ -76,4 +76,5 @@ export const PullRequestBuilder = createBuilderClass()({ isAgentSessionsWorkspace: { default: false }, overviewTabs: { default: false }, reactions: { default: [] }, + isDescriptionCollapsed: { default: false }, }); diff --git a/webviews/editorWebview/test/overview.test.tsx b/webviews/editorWebview/test/overview.test.tsx index ed58b618e6..f42ec8b513 100644 --- a/webviews/editorWebview/test/overview.test.tsx +++ b/webviews/editorWebview/test/overview.test.tsx @@ -696,6 +696,83 @@ describe('Overview', function () { assert.strictEqual(content.hasAttribute('hidden'), false); }); + describe('description', function () { + function contextFor(pr: PullRequest) { + const context = new PRContext(pr); + context.setPR(pr); + return context; + } + + function renderDescription(context: PRContext) { + const postMessage = sinon.stub(context, 'postMessage').resolves(); + const out = render( + + {(current: PullRequest) => } + , + ); + const chevron = out.getByLabelText(/^(Collapse|Expand) description$/); + return { + out, + chevron, + content: document.getElementById(chevron.getAttribute('aria-controls')!)!, + remembered: () => postMessage.args.map(([message]) => message) + .filter(message => message.command === 'pr.set-description-collapsed').map(message => message.args), + }; + } + + it('collapses and expands from the chevron in its header, and remembers it for the next one', function () { + const { out, chevron, content, remembered } = renderDescription(contextFor(new PullRequestBuilder().build())); + assert(content.querySelector('.comment-body'), 'the chevron controls the description'); + assert.strictEqual(chevron.getAttribute('aria-expanded'), 'true'); + assert.strictEqual(content.hidden, false); + + fireEvent.click(chevron); + + assert.strictEqual(chevron.getAttribute('aria-expanded'), 'false'); + assert.strictEqual(chevron.getAttribute('aria-label'), 'Expand description'); + assert(content.hidden); + assert(out.container.querySelector('#description .review-comment-header .author-link'), 'the author is still shown'); + assert.deepStrictEqual(remembered(), [true]); + + fireEvent.click(chevron); + + assert.strictEqual(chevron.getAttribute('aria-expanded'), 'true'); + assert.strictEqual(content.hidden, false); + assert.deepStrictEqual(remembered(), [true, false]); + }); + + it('stays collapsed when the pull request or the webview is reloaded', function () { + const pr = new PullRequestBuilder().build(); + const context = contextFor(pr); + const { out, chevron, content } = renderDescription(context); + fireEvent.click(chevron); + + // Another overview can have expanded its description since, which only the next one that is opened follows. + act(() => { + context.handleMessage({ command: 'pr.initialize', pullrequest: { ...pr, isDescriptionCollapsed: false } }); + }); + assert(content.hidden); + + out.unmount(); + const reloaded = renderDescription(new PRContext()); + assert.strictEqual(reloaded.chevron.getAttribute('aria-expanded'), 'false'); + assert(reloaded.content.hidden); + }); + + it('opens collapsed when the last one was collapsed, and expands to edit without changing that', function () { + const { out, chevron, content, remembered } = renderDescription(contextFor(new PullRequestBuilder().isDescriptionCollapsed(true).build())); + assert.strictEqual(chevron.getAttribute('aria-expanded'), 'false'); + assert(content.hidden); + + fireEvent.click(out.container.querySelector('#description button[title="Edit comment"]')!); + fireEvent.click(out.container.querySelector('#description .form-actions .secondary')!); + + assert.strictEqual(out.getByLabelText('Collapse description').getAttribute('aria-expanded'), 'true'); + assert.strictEqual(document.getElementById('description-content')?.hidden, false); + assert.deepStrictEqual(remembered(), [], 'the next one still opens collapsed'); + }); + }); + it('does not offer Update stack when the host rejects eligibility or stack details are unavailable', function () { const entry = { position: 1, number: 1234, title: 'First', head: 'D1', url: 'https://example.com/1234', state: GithubItemStateEnum.Open, isDraft: false, mergeable: PullRequestMergeability.Mergeable }; const stack = { position: 1, size: 1, base: 'main', pullRequests: [entry] };