Files
Kazuki YamadaandClaude Fable 5 558b9e4553 test(browser): Exercise findNavigationContainer directly in tests
intent(browser-tests): CodeRabbit review — tests duplicated the selector expression and could pass while the production selector logic broke
decision(browser-structure): extracted findNavigationContainer into utils/github-navigation.ts because every file under entrypoints/ becomes an extension entrypoint in wxt, so the helper cannot be exported from content.ts for tests
constraint(browser-tests): importing content.ts in vitest is not possible without wxt test shims — defineContentScript is a wxt auto-import global

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 00:23:01 +09:00

9 lines
429 B
TypeScript

// GitHub is rolling out a React-based repository header that replaces the
// legacy `ul.pagehead-actions` list with `ul[data-testid="repo-header-actions"]`.
// Keep the legacy selector as a fallback while the rollout is in progress.
export function findNavigationContainer(): Element | null {
return (
document.querySelector('ul[data-testid="repo-header-actions"]') ?? document.querySelector('ul.pagehead-actions')
);
}