Repository navigation
feat(dashboard): Adapt queued messages to the available space - #2678
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This comment has been minimized.
This comment has been minimized.
BYK
approved these changes
Nov 4, 2026
thomasjiangcy
added a commit
that referenced
this pull request
Nov 5, 2026
…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]>
betegon
force-pushed
the
bt/conversation-queued-messages
branch
from
November 5, 2026 13:07
aaa55e2 to
7f87f66
Compare
Contributor
|
24 screenshot changes — 24 changed · 0 added · 0 removed Review screenshots in Frameshift Show 12 more changed screenshots6 more changed screenshots in Frameshift. |
thomasjiangcy
approved these changes
Nov 5, 2026
betegon
added a commit
that referenced
this pull request
Nov 5, 2026
Refs #2673 Depends on #2678 Make the conversation list, Brief, Details, and transcript use a consistent type scale and spacing. Selected conversations gain emphasis, panel headings become easier to distinguish from metadata, and mobile messages and loading rows share an inset. The chat header retains its current title weight. The reply composer uses less vertical space on short desktop windows and remeasures drafts when the layout density changes. ## Before and after Captured from this PR's base and head with the same mock data, theme, and viewport. **Desktop** | Before | After | | --- | --- | |  |  | **Mobile** | Before | After | | --- | --- | |  |  | ## Validation Verified the mock dashboard with `JUNIOR_DASHBOARD_MOCK_CONVERSATIONS=true pnpm dev` on desktop and mobile. The 31 conversation E2E tests, 364 dashboard tests, dashboard TypeScript and lint, dashboard style checks, and file length checks pass.
This branch was successfully deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refs #2673
Depends on #2677
The queued message list uses a single disclosure when the viewport is short, leaving more room for the transcript. Tall desktop views still show a preview, and messages that need attention remain visible.
Before and after
Captured with the same mock data and viewport from this PR's base and head.
Queued messages on a short desktop window
Validation
Verified in Chromium: the short and tall queue states and the composer queue flow. The dashboard tests pass on the complete stack.