Skip to content

pr-first-commit-title - Restore feature#9030

Merged
SunsetTechuila merged 2 commits into
mainfrom
pr-first-commit-title-fix
Mar 8, 2026
Merged

pr-first-commit-title - Restore feature#9030
SunsetTechuila merged 2 commits into
mainfrom
pr-first-commit-title-fix

Conversation

@SunsetTechuila
Copy link
Copy Markdown
Member

@SunsetTechuila SunsetTechuila commented Mar 3, 2026

@SunsetTechuila SunsetTechuila force-pushed the pr-first-commit-title-fix branch from 77313a3 to a66f310 Compare March 3, 2026 09:44
@SunsetTechuila SunsetTechuila marked this pull request as ready for review March 3, 2026 09:44

function getFirstCommit(firstCommit: HTMLElement): {title: string; body: string | undefined} {
const body = $optional('.Details-content--hidden pre', firstCommit)
const body = $optional('.Details-content--hidden pre', firstCommit.parentElement!)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes body being omitted

?.textContent
.trim() ?? undefined;

const title = parseRenderedText(firstCommit.firstElementChild!, ({nodeName}) =>
Copy link
Copy Markdown
Member Author

@SunsetTechuila SunsetTechuila Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes parts of the name being omitted if it starts with a reference: https://github.com/refined-github/sandbox/compare/rendered-commit-title?expand=1

const sessionResumeId = $optional('meta[name="session-resume-id"]')?.content;
return Boolean(sessionResumeId && sessionStorage.getItem(`session-resume:${sessionResumeId}`));
return Boolean(
sessionStorage.getItem(`copilot-generate-pull-title:${location.pathname}`)
Copy link
Copy Markdown
Member Author

@SunsetTechuila SunsetTechuila Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That prefix is used even if Copilot is disabled

Copy link
Copy Markdown
Member

@fregante fregante Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these comments would work best as inline comments, for example when they describe or explain some code (not so much when they explain changes)

@SunsetTechuila SunsetTechuila merged commit 2aba472 into main Mar 8, 2026
8 checks passed
@SunsetTechuila SunsetTechuila deleted the pr-first-commit-title-fix branch March 8, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants