-
Notifications
You must be signed in to change notification settings - Fork 51
🐛 Add insights link to application detail drawer #2586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds an "Insights" navigation link to the Application Details drawer and introduces Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant AppDetails as Application Details Drawer
participant Helper as insights/helpers
participant Router
participant Insights as Insights (Single-App)
User->>AppDetails: Click "Insights" link
AppDetails->>Helper: getInsightsSingleAppSelectedLocation(appId, currentLocation)
Note over Helper: Build LocationDescriptor\n- pathname: /insights/app/:id\n- search: ?insights:filters=... (if present)
Helper-->>AppDetails: LocationDescriptor
AppDetails->>Router: navigate(LocationDescriptor)
Router->>Insights: Render single-app insights (with preserved filters)
Insights-->>User: Display insights
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (1)
client/src/app/pages/insights/helpers.ts (1)
1-1: Prefer react-router’s To type over history’s LocationDescriptor.Keeps the helper aligned with Link’s “to” type and avoids coupling to history internals.
-import { Location, LocationDescriptor } from "history"; +import type { Location } from "history"; +import type { To } from "react-router-dom"; @@ -export const getInsightsSingleAppSelectedLocation = ( +export const getInsightsSingleAppSelectedLocation = ( applicationId: number, fromLocation?: Location -): LocationDescriptor => { +): To => {Ensure the consuming code compiles after this change.
Also applies to: 186-205
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
client/src/app/pages/applications/application-detail-drawer/tab-details-content.tsx(2 hunks)client/src/app/pages/insights/helpers.ts(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
client/src/app/pages/applications/application-detail-drawer/tab-details-content.tsx (1)
client/src/app/pages/insights/helpers.ts (1)
getInsightsSingleAppSelectedLocation(187-205)
client/src/app/pages/insights/helpers.ts (1)
client/src/app/Paths.ts (1)
Paths(84-84)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: unit-test
- GitHub Check: build-and-upload-for-global-ci
🔇 Additional comments (3)
client/src/app/pages/insights/helpers.ts (1)
186-205: Confirm the target route expects 'filters' (not 'insights:filters').This helper emits
?filters=.... If the single-app Insights view expects a namespaced key, update accordingly.client/src/app/pages/applications/application-detail-drawer/tab-details-content.tsx (2)
41-41: Import looks good.Import path is correct and localizes the helper clearly.
79-83: Order and labeling LGTM.Placing Insights between Issues and Dependencies matches the stated UX.
client/src/app/pages/applications/application-detail-drawer/tab-details-content.tsx
Show resolved
Hide resolved
b670c5c to
7596c08
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (2)
client/src/app/pages/insights/helpers.ts (2)
186-189: Clarify wording: explicitly call out “Insights filters.”Align comment with intent and existing terminology.
-// When linking to the insights page for a single application, we want to be able to preserve any -// filters on the all insights page that may be given. Linking from outside insights does not -// need to preserve any filters. +// When linking to the Insights page for a single application, preserve any Insights filters from the All Insights page if present. +// Links from outside Insights don't need to preserve filters.
193-206: Prefixsearchwith '?' and preserve empty filters explicitly.
- Ensure
searchbegins with?for consistency with history/Link.- Use
.has()to differentiate “missing” vs “present but empty” filters and preserve the latter.- const existingFiltersParam = - fromLocation && - new URLSearchParams(fromLocation.search).get( - `${TablePersistenceKeyPrefix.insights}:filters` - ); + const params = new URLSearchParams(fromLocation?.search ?? ""); + const hasExistingFilters = params.has( + `${TablePersistenceKeyPrefix.insights}:filters` + ); + const existingFiltersParam = + params.get(`${TablePersistenceKeyPrefix.insights}:filters`) ?? ""; @@ - search: existingFiltersParam - ? new URLSearchParams({ filters: existingFiltersParam }).toString() - : undefined, + search: hasExistingFilters + ? `?${new URLSearchParams({ filters: existingFiltersParam }).toString()}` + : undefined,
🧹 Nitpick comments (1)
client/src/app/pages/insights/helpers.ts (1)
1-1: Use type-only import for History types.These are used as types only; prefer
import typeto avoid potential runtime import.-import { Location, LocationDescriptor } from "history"; +import type { Location, LocationDescriptor } from "history";
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
client/src/app/pages/applications/application-detail-drawer/tab-details-content.tsx(2 hunks)client/src/app/pages/insights/helpers.ts(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- client/src/app/pages/applications/application-detail-drawer/tab-details-content.tsx
🧰 Additional context used
🧬 Code graph analysis (1)
client/src/app/pages/insights/helpers.ts (1)
client/src/app/Paths.ts (1)
Paths(84-84)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: unit-test
- GitHub Check: build-and-upload-for-global-ci
7596c08 to
a6c794f
Compare
Resolves: https://issues.redhat.com/browse/MTA-5899 When viewing an application's details in the detail drawer, we want to show a link to the insights page for that application. This follows the pattern for issues and dependencies. Signed-off-by: Scott J Dickerson <[email protected]>
Signed-off-by: Scott J Dickerson <[email protected]>
a6c794f to
b24a070
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
client/src/app/pages/insights/helpers.ts (1)
203-205: Prefix?inLocation.searchwhen present.Ensure
searchstarts with?soLink/history receive a proper query string. This mirrors a prior suggestion.- search: existingFiltersParam - ? new URLSearchParams({ filters: existingFiltersParam }).toString() - : undefined, + search: existingFiltersParam + ? `?${new URLSearchParams({ filters: existingFiltersParam }).toString()}` + : undefined,
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
client/src/app/pages/applications/application-detail-drawer/tab-details-content.tsx(2 hunks)client/src/app/pages/insights/helpers.ts(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- client/src/app/pages/applications/application-detail-drawer/tab-details-content.tsx
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: sjd78
PR: konveyor/tackle2-ui#2586
File: client/src/app/pages/applications/application-detail-drawer/tab-details-content.tsx:79-83
Timestamp: 2025-09-02T18:12:27.604Z
Learning: When navigating from application detail drawer to insights page in tackle2-ui, filters should not be preserved - users should start with a clean insights view rather than carrying over search filters from the previous page.
📚 Learning: 2025-09-02T18:12:27.604Z
Learnt from: sjd78
PR: konveyor/tackle2-ui#2586
File: client/src/app/pages/applications/application-detail-drawer/tab-details-content.tsx:79-83
Timestamp: 2025-09-02T18:12:27.604Z
Learning: When navigating from application detail drawer to insights page in tackle2-ui, filters should not be preserved - users should start with a clean insights view rather than carrying over search filters from the previous page.
Applied to files:
client/src/app/pages/insights/helpers.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: unit-test
- GitHub Check: build-and-upload-for-global-ci
🔇 Additional comments (1)
client/src/app/pages/insights/helpers.ts (1)
1-1: No change required:[email protected]is in use, soLocationDescriptorremains valid.
| </Link> | ||
| </ListItem> | ||
| <ListItem> | ||
| <Link to={getInsightsSingleAppSelectedLocation(application.id)}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the other links use ?. when retrieving the property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Various recent refactors had application drop | undefined | null in the type, so dropping the ?. to just . is ok and I probably didn't catch all the uses.
Resolves: https://issues.redhat.com/browse/MTA-5899 When viewing an application's details in the detail drawer, we want to show a link to the insights page for that application. This follows the pattern for issues and dependencies. ## Summary by CodeRabbit * **New Features** * Added an Insights link in the Application Details drawer (between Issues and Dependencies) to open insights for the selected application. * Preserves any existing Insights filters when navigating from application details, keeping user context intact. * Enables direct per-application access to insights for faster investigation and analysis. --------- Signed-off-by: Scott J Dickerson <[email protected]>
Resolves: https://issues.redhat.com/browse/MTA-5899
When viewing an application's details in the detail drawer, we want to show a link to the insights page for that application. This follows the pattern for issues and dependencies.
Screenshot:

Summary by CodeRabbit