ref(issue-details): replace useRouter with specific hooks in useGroupDetailsRoute#110122
Merged
evanpurkhiser merged 5 commits intomasterfrom Mar 27, 2026
Merged
Conversation
Comment on lines
+37
to
41
| params: Record<string, string | undefined>; | ||
| routes: PlainRoute[]; | ||
| }): { | ||
| baseUrl: string; | ||
| currentTab: Tab; |
Contributor
There was a problem hiding this comment.
Bug: The getCurrentTab function always defaults to the 'Details' tab because route objects are missing the handle.path property, causing currentRoute.path to be an empty string.
Severity: HIGH
Suggested Fix
Update the route definitions for the issue detail tabs to include a handle object with a path property that mirrors the existing path value. For example, a route with path: TabPaths[Tab.ACTIVITY] should also have handle: { path: TabPaths[Tab.ACTIVITY] }. This will ensure useRoutes() correctly populates the path property on the route object, allowing getCurrentTab() to identify the active tab.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: static/app/views/issueDetails/useGroupDetailsRoute.tsx#L37-L41
Potential issue: The `useRoutes()` hook creates route objects where the `path` is
derived from `match.handle?.path ?? ''`. However, the route definitions for the issue
details tabs do not include a `handle` object with a `path` property. Consequently, when
`getCurrentTab()` runs, the `currentRoute.path` is always an empty string. The logic to
find the active tab, `Object.values(Tab).find(tab => currentRoute?.path ===
TabPaths[tab])`, will always fail to find a match, causing it to fall back to the
default `Tab.DETAILS`. This prevents the UI from correctly highlighting the active tab
on the issue details page.
Did we get this right? 👍 / 👎 to inform future reviews.
scttcper
approved these changes
Mar 16, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Part of the React Router 6 cleanup — replaces
useRouter()with specific hooks (useNavigate,useLocation,useParams, etc.)