Repository navigation
fix(chat): keep the first-send loader inside the chat panel - #7995
Merged
Merged
Conversation
Sending the first message from a destination mints a thread, and two suspensions above the chat panel's boundary blanked the whole layout: ActiveTaskProvider suspended on the initial message page, and useTaskMetadata fetched a row the local store already had. The provider now exposes `ready` and the chat panel suspends on it; autosend waits for the first page. useTaskMetadata seeds its query from a non-partial local row.
decocms Bot
pushed a commit
that referenced
this pull request
Oct 15, 2026
PR: #7995 fix(chat): keep the first-send loader inside the chat panel Bump type: patch - decocms (apps/api/package.json): 4.488.11 -> 4.488.12 - @decocms/native (apps/native/package.json): 4.488.11 -> 4.488.12 Deploy-Scope: web
3 of 4 tasks
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.
What is this contribution about?
Sending the first message from a destination (open Studio, open the chat, send) replaced the whole area right of the sidebar with the panel loader for about 350ms, then put the layout back. Only the chat panel should load.
The send mints a thread and adds
?thread=to the URL. Two things then suspended above the chat panel's ownMainPanelBoundary:ActiveTaskProvidercalleduse(conn.ready). Its comment said the side panel's boundary caught this, but the provider wraps the wholeChatLayout, so the suspension reached the route-level boundary and blanked both panels.useTaskMetadataalways ran its suspense query, even when the thread row was already in the local store (the local row wins anyway). A thread created a moment ago has no cached query, so the topbar, the tab bar and the main panel content suspended on aCOLLECTION_THREADS_GETthey didn't need.Changes:
ChatStreamContextValuegets areadypromise.ActiveTaskProviderno longer suspends and passesconn.ready; the threadless and native terminal providers pass an already-settled one.ChatSidePanelsuspends onreadyinside its own boundary.useTaskMetadataseeds its query with the local row throughinitialData(partial/watchrows are skipped, as inuseEnsureTask).Trade-off: a main-panel affordance that sends a message (for example the visual editor prompt) can now render during the roughly 300ms before the chat history loads. Before, nothing rendered in that window.
How did you verify your code works?
bun run verify: 10960 pass, 0 fail.tsc --noEmitonapps/webis clean.MutationObserverthat logs every[data-testid=panel-loading]element with its position and width, then ran open chat → type → Enter:main: after the send, a loader 1491px wide (the full area right of the sidebar) for about 350ms.useTaskMetadatachange.Screenshots/Demonstration
No screenshots: the defect is a flash of about 350ms, and a still image shows nothing. The observer measurements above are the evidence.
How to Test
Review Checklist
Summary by cubic
Fixes the first-send loading state so only the chat panel shows a spinner, instead of the whole area right of the sidebar flashing a loader for roughly 350ms.
ActiveTaskProvider(which wraps the entire chat layout) into the chat panel's own boundary via a newreadypromise on the chat stream context.useTaskMetadatanow seeds its query from a non-partial local row, avoiding a needless suspension on a thread that was just created locally.Trade-off: a main-panel affordance that sends a message (for example the visual editor prompt) can now render during the ~300ms before chat history loads; previously nothing rendered in that window.
Written for commit cb291e2. Summary will update on new commits.