Repository navigation
ref(dashboard): Simplify the conversation header and menus - #2676
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
BYK
left a comment
There was a problem hiding this comment.
I want to see the total spend at all times
|
58 screenshot changes — 58 changed · 0 added · 0 removed Review screenshots in Frameshift Show 12 more changed screenshots40 more changed screenshots in Frameshift. |
…#2717) Dashboard telemetry can't currently answer "which route is slow". Server segments get their names only from the outer Hono app: `GET /api/conversations/*`, `GET /api/plugins/*`, and `GET /*` for egress. Browser `pageload`/`navigation` spans are all named `Pageload`/`Navigation`. Polls that run after a navigation span ends show up as orphan segments. The navigation span's duration is also not the time it takes to see the transcript. **Server route names** - `routeNameMiddleware()` (`chat/sentry-route-name.ts`) is registered first in the dashboard app. It takes the pattern of the first matched non-middleware route from Hono `matchedRoutes`, names the request span with it, and stores it in `app.http.route`. - `scrubPrivateSentrySpan` calls `promoteHttpRouteName`. On sent `http.server` segments, this function writes the inner pattern back to the name, `http.route`, and `sentry.segment.name`. It has to do this because the outer app renames the span after the inner app returns. - Sandbox egress is named `/api/internal/sandbox-egress/:token/*`. Plugin routes are named `/api/plugins/<plugin>/*`, because plugin apps are plain fetch handlers and expose no patterns. - Named the anonymous middleware: `sandboxEgress`, `dashboardVersionHeader`, and `requireUserCustomizationExperiment`. **Browser** - `<TracedRoutes>` replaces `<Routes>` and keeps the route table in one place. It calls `matchRoutes` and names the active pageload/navigation span with `updateSpanName` and `sentry.segment.name.source: route`. It does this in a layout effect, so spans that the page ends in its first effects also get the route segment name. - `shouldCreateSpanForRequest: () => Boolean(getActiveSpan())`: after the route span ends, requests send no spans. - A `ui.render` span named `Conversation transcript shown` covers the time from the route span start to the first transcript commit. It carries `app.dashboard.load` = `pageload|navigation`. - `app.dashboard.navigation.pre_fetch_ms` (navigation entry `fetchStart`) is set on `pageload` spans. - TELEMETRY.md: the "Dashboard" section now has three query recipes. **Why not `enableReportPageLoaded`** `enableReportPageLoaded` would stop idle auto-finish on every pageload, so pages that never call `reportPageLoaded()` would wait for `finalTimeout`. It also covers only pageloads, and most conversation opens are client navigations. A child span measures both kinds of load and leaves idle ending unchanged. **Verification** - `tests/component/http/route-name-telemetry.test.ts` runs real Sentry init with a capturing transport and real nested Hono apps. With the promotion removed, it fails with the coarse names seen in prod. - An envelope sink plus Playwright against the dashboard e2e harness showed: - pageload and navigation named `/conversations/:conversationId` and `/automations` with source `route` - every child span's `sentry.segment.name` set to the route - transcript spans 69–262 ms against 0.9–1 s route spans - no orphan `http.client` segments over 25 s of polling - non-conversation navigations still end by `idleTimeout` - `pre_fetch_ms` does not show up in e2e, because the harness's `page.clock.install()` makes `performance.getEntriesByType("navigation")` return `[]`. I checked this in a separate script. Without the fake clock the entry is there. - Not verified locally: whether Relay derives `transaction` from the renamed streamed segment. The SDK sends the renamed `name` and `sentry.segment.name`. Check this in prod after deploy. - `pnpm typecheck`, `pnpm lint`, the egress integration tests, the payload filter tests, and `pnpm test:e2e:dashboard` (87/87) all pass. Dashboard unit tests pass except `dashboard-output.test.ts`: its Nitro build fails locally with a `@sentry/[email protected]` missing-export error, a dependency resolution problem in this sandbox. **Overlap** - #2657, #2676, and #2677 also edit `ConversationPage.tsx`. This PR adds only one import and one effect there. - The privacy work (egress token/query scrubbing, `httpBodies`) edits `sentry-payload-filter.ts` and `instrumentation.ts` separately. This PR adds one line to each. <!-- junior-request-attribution:start --> via @thomasjiangcy. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A0b0c4156706860efb734f45c70a1e0e3 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A0b0c4156706860efb734f45c70a1e0e3) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A0b0c4156706860efb734f45c70a1e0e3/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
…2716) When a conversation opens with no cached copy, the transcript waits for two requests in a row: `/pending-messages`, then `/api/conversations/:id`. #1932 added this order on purpose. Workers commit input before they acknowledge it, so reading the mailbox first means a message that moves into history between the two reads still appears in one of them. In prod traces, the detail request started only after the mailbox request returned: - [`3cffecfa…`](https://sentry.sentry.io/explore/traces/trace/3cffecfa6ae6460f8677a8fc57ea128e/) (navigation): mailbox 47→383ms, then detail from 385ms. - [`0d26d374…`](https://sentry.sentry.io/explore/traces/trace/0d26d3741d5d477793c326ccfbed4f4b/) (pageload): mailbox 713→856ms, then detail from 861ms. - [`19019d5f…`](https://sentry.sentry.io/explore/traces/trace/19019d5f769341a2916e865e93267baa/) and [`40a68dfc…`](https://sentry.sentry.io/explore/traces/trace/40a68dfc3ed248dca589f837bd109bb8/): the mailbox took 0.86s and 1.8s in the browser, and the detail waited for it. Change: - `GET /api/conversations/:id?mailbox=true` reads the mailbox first and then history, in one request. It returns the `/pending-messages` report as `mailbox`. A request with `mailbox=true` never returns 304. - The client uses it only for a first read with no cached copy. Polls and cached reopens keep the two reads, so the detail can still return 304 (#2655). - The mock reporting API and its hash-based 304 middleware support the flag. A shared e2e helper, `withRequestedMailbox`, adds the mailbox to mocked detail reports. Expected impact (inference): opening a conversation saves one round trip plus the server's mailbox read, about 150–350ms in typical traces and up to about 1.8s in the slow ones. Polling cost does not change. Checks: `pnpm typecheck` (junior, junior-dashboard), oxlint, prettier, `file-length:check`, junior `pending-messages` and `detail` integration tests, dashboard vitest, and the whole dashboard Playwright suite (87 passed). `tests/dashboard-output.test.ts` fails in my sandbox on `main` too, during its Nitro build, so it is not related to this change. Overlaps: #2657, #2676, #2677, #2678, and #2428 change the conversation page UI. This PR changes only `queries.ts` data loading and the detail route, so I expect few conflicts. #2657 (catch up on unread activity) may touch the same detail options. This branch is based on `main`. #2712 (Neon pool size) is independent, and it fixes most of the server-side wait in the slow traces. <!-- junior-request-attribution:start --> via @thomasjiangcy. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A34a570431e2cdbd57aba2d8c15a0c1ac --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A34a570431e2cdbd57aba2d8c15a0c1ac) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A34a570431e2cdbd57aba2d8c15a0c1ac/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Thomas Jiang <[email protected]>
|
@BYK i just put the spending data back to its place. still don't like that when you are using a wide enough screen, you get the old sidebar as a top bar (where the spending is showed). I would 100% prefer to just expand the sidebar from icons to icons plus text, and then show the usage in the footer. |
BYK
left a comment
There was a problem hiding this comment.
still don't like that when you are using a wide enough screen, you get the old sidebar as a top bar (where the spending is showed). I would 100% prefer to just expand the sidebar from icons to icons plus text, and then show the usage in the footer.
We need to find the right balance for this. My gate was height: if we have enough height, top bar is more useful as there's a plethora of sidebars: conversations is a side bar, then the nav bar is a side bar, details is another, and I have vertical tabs as a sidebar it just gets very tiring and confusing.
Refs #2673 Depends on #2676 The Details panel puts items that need a response above the Brief. Long Briefs show four lines and expand in place. Usage starts as a compact summary and expands to the cost and token breakdown. The panel reserves scrollbar space so expanding Usage keeps the Brief at the same width. The panel's close button replaces the redundant header toggle while Details is open. ## Before and after Captured with the same mock data and viewport from this PR's base and head. **Conversation Details** | Before | After | | --- | --- | |  |  | **Expanded Brief and Usage**  ## Validation Verified in Chromium: opening and closing Details, keyboard focus, and expanding Usage. The matched screenshots use the same long Brief.
In the Event log view, the "📜 Event log ×" control sat among the header actions and read like a closable tab or filter chip. The title bar now shows the view as a breadcrumb: `Conversation title › Event log`. The Conversation title is muted and leads back to the Conversation, with a "Back to conversation" tooltip. The right side keeps only cost and `⋯`. Entry to the Event log stays in the `⋯` menu. Mobile is unchanged. | Before | After | | --- | --- | |  |  | Follow-up to #2603. Rebased onto the header from #2676. <!-- junior-request-attribution:start --> via @thomasjiangcy. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:local%3Aweb%3A458cffdd85966209c5ea788d --> -- [View Session in Sentry](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A458cffdd85966209c5ea788d/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Thomas Jiang <[email protected]>
Refs #2673
Depends on #2675
The chat header puts the title first and shows Slack context and a GitHub repository link when there is one distinct linked repository. Linked work retains every PR and issue. A spinner indicates active work, and the estimated cost remains beside search.
Share, copy, the event log, and the existing Pin and Archive actions are grouped in the conversation menu. The desktop top bar shows personal spend beside the avatar with the profile menu closed. The menu also shows spend alongside the account actions.
Before and after
Captured with the same mock data and viewport from this PR's base and head.
Chat header and conversation menu
Profile menu
Validation
Verified in Chromium: conversation menus on desktop and mobile, the profile menu, and pin/unpin. TypeScript, lint, and the dashboard tests pass on the complete stack.