Skip to content

feat(conversations): Show saved query name in breadcrumbs#118988

Merged
constantinius merged 3 commits into
masterfrom
constantinius/feat/explore/TET-2552-saved-query-breadcrumb
Jul 6, 2026
Merged

feat(conversations): Show saved query name in breadcrumbs#118988
constantinius merged 3 commits into
masterfrom
constantinius/feat/explore/TET-2552-saved-query-breadcrumb

Conversation

@constantinius

@constantinius constantinius commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

When a saved conversation query is loaded, show a breadcrumb with Conversations > <query name> instead of the plain title. Clicking Conversations navigates back to the landing page. Matches the pattern used in logs, traces, and metrics.

Stacked on #118921.

Contributes to TET-2552

Screenshot 2026-07-03 at 12 13 34

Replace the custom SaveConversationQueryModal with the shared
openSaveQueryModal so the dialog is identical to logs/traces.

Add conversations-specific analytics: widen the modal's source
type to 'conversations' so it fires conversations.save_query_modal
instead of misattributing to traces.

Persist the agent filter: the save button reads the agent URL param
and includes it in the POST. The URL builder restores it using
comma-separated format for nuqs compatibility.

Depends on #118982 being merged and deployed (backend serializer
support for the agent field).

Contributes to TET-2552
When a saved conversation query is loaded (id and title URL params
present), show a breadcrumb with 'Conversations > <query name>'
instead of the plain 'AI Conversations' title. Clicking
'Conversations' navigates back to the landing page.

Matches the pattern used in logs, traces, and metrics.

Contributes to TET-2552
@linear-code

linear-code Bot commented Jul 3, 2026

Copy link
Copy Markdown

TET-2552

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 3, 2026
@constantinius constantinius marked this pull request as ready for review July 3, 2026 10:14
@constantinius constantinius requested a review from a team as a code owner July 3, 2026 10:14
@constantinius constantinius force-pushed the constantinius/ref/explore/TET-2552-reuse-save-query-modal branch from b4d8902 to 8a86580 Compare July 6, 2026 07:32
@constantinius constantinius requested review from a team as code owners July 6, 2026 07:32
Base automatically changed from constantinius/ref/explore/TET-2552-reuse-save-query-modal to master July 6, 2026 07:38
Comment on lines +172 to +174
const savedQueryId = decodeScalar(location.query.id);

if (defined(savedQueryId) && defined(savedQueryTitle) && savedQueryTitle.length > 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The breadcrumb for a saved conversation query is rendered based on URL parameters (savedQueryId, savedQueryTitle) without validating that the query actually exists on the server.
Severity: LOW

Suggested Fix

To align with the pattern used in logs and traces, the component should use the useGetSavedQuery(savedQueryId) hook. The breadcrumb should only be rendered if the hook returns a valid savedQuery object from the API, and the breadcrumb title should be sourced from savedQuery.name instead of the URL parameter.

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/explore/conversations/layout.tsx#L172-L174

Potential issue: The code in `ConversationsLandingTitle` renders a breadcrumb based on
`savedQueryId` and `savedQueryTitle` from the URL query parameters. However, it only
checks for the presence of these parameters (`defined(savedQueryId)`) and not their
validity. This allows for the creation of URLs with arbitrary `id` and `title` values,
which will render a fake breadcrumb for a non-existent saved query. This behavior is
inconsistent with parallel implementations for logs and traces, which validate the ID
against the server using `useGetSavedQuery` before rendering the breadcrumb. While not a
security risk, it's incorrect UI behavior.

Did we get this right? 👍 / 👎 to inform future reviews.

@constantinius constantinius disabled auto-merge July 6, 2026 07:45
@constantinius constantinius merged commit f350a9b into master Jul 6, 2026
72 checks passed
@constantinius constantinius deleted the constantinius/feat/explore/TET-2552-saved-query-breadcrumb branch July 6, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants