jump-to-conversation-close-event - Restore on issues#9477
Open
lloyd-c137 wants to merge 3 commits into
Open
Conversation
…github#9455) GitHub updated its Issues page UI to use React components with CSS module classes. The old selector targeting `[data-timeline-event-id]:has([data-testid=state-reason-link])` no longer matches the new DOM structure. Changes: - selectors.ts: Added `a[class^=ClosedEvent-module__closerLink]` selector for the new Issues React view - jump-to-conversation-close-event.tsx: Handle when the close event element IS the anchor link directly (new UI) vs a wrapper element (old UI)
Author
|
I have tested this on the test URLs listed in the issue. The feature now works on both the new React Issues UI (#9455) and the old timeline view (sandbox PRs/Issues). Happy to make adjustments if the maintainers have feedback on the approach. |
fregante
reviewed
May 16, 2026
| // `lastCloseEvent` is a wrapper element in old views, but a direct `<a>` link in the new React Issues UI | ||
| const eventAnchor = lastCloseEvent?.tagName === 'A' | ||
| ? lastCloseEvent as HTMLAnchorElement | ||
| : $('a[href*="#event-"]', lastCloseEvent); |
Member
There was a problem hiding this comment.
This shouldn't be necessary. a.closest('a') will already match itself
jump-to-conversation-close-event on new React Issues UIjump-to-conversation-close-event - Restore on issues
Author
|
Good point - As for the video, I do not have a screen recording tool on this machine, but the test URLs in the original issue (closed issues on the sandbox repo) can verify the fix:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #9455.
GitHub rolled out a new React-based Issues page UI that uses CSS module class names. The old selector
[data-timeline-event-id]:has([data-testid="state-reason-link"])no longer matches any element.The new Issues UI renders close events as a
<ClosedEvent>React component with a closing link that has a CSS module class starting withClosedEvent-module__closerLink(confirmable via the existingsame-page-links.tsxselector).Changes
source/github-helpers/selectors.tsa[class^="ClosedEvent-module__closerLink"]toconversationCloseEventto detect the close event in the new Issues React viewsource/features/jump-to-conversation-close-event.tsx<a>tag (new React UI), use it directly aseventAnchorTest URLs (new UI)
jump-to-conversation-close-eventbroken on new issues #9455Test URLs (old UI — still works)
Validation
npx tsc --noEmit✅npx eslint source/features/jump-to-conversation-close-event.tsx✅ (0 errors)npm run build:bundle✅