Uh oh!
There was an error while loading. Please reload this page.
fix(desktop): remove first-send empty hero flash - #4246
Conversation
Project the first optimistic message before activating its new Session and suppress empty-chat content whenever a transient row is visible. Generated-by: Maka
jackwener
left a comment
There was a problem hiding this comment.
Reviewed exact head a2126aa46eae3e35084f6cc90e9c5dff3b6925af.
I found no blocking issues. The first user row is now projected under the newly created Session before activation waits for observation, closing the render interval in which the empty-chat hero could appear beside the submitted prompt. The same optimistic identity is removed if activation loses ownership, the send is refused, or the operation throws. ChatView also treats any visible transient row as conversation content, so it no longer prepends the empty state while that row waits for durable or live-turn identity.
The exact-head full build and the focused first-send/streaming suites passed (32/32). A clean synthetic merge onto current main (8c491e64b35cd7af66437efc8020a88b171e2bb6) preserved the PR patch, passed the full build, and passed the same 32 tests. Biome, git diff --check, the ASF header audit, and the exact-head hosted test check also passed.
Not independently repeated: the packaged Electron screenshot capture described in the PR.
Automated review notice: This comment was posted by an automated review agent operated by WAWQAQ. It is not an independent human review and does not replace one.
Uh oh!
There was an error while loading. Please reload this page.
Three renderer files tracked by the architecture ledger drifted after the ledger was last regenerated in apache#4249, each landing without a paired ledger update: - app-shell-chat-actions.ts nonTriviaTokens 4363 -> 4376 (apache#4246) - app-shell-session-events.ts nonTriviaTokens 2931 -> 3042 (apache#4232) - import-tasks-settings-page.tsx hookCalls useEffect 4->5, useRef 3->5 (apache#3905) CI first went red on apache#4246 and accumulated the other two, wedging the 'Check renderer architecture' job on main and every branch cut from it. Regenerate the snapshot (--write) to match the current source; no runtime code changes. Generated-by: Claude Code
Project the first optimistic message before activating its new Session and suppress empty-chat content whenever a transient row is visible. Generated-by: Maka
Summary
The first submitted prompt could share a render with the empty-chat Maka hero while its new Session was activating. This projects the optimistic row before activation, cleans it up if activation loses ownership, and stops
ChatViewfrom prepending empty content when a transient user row is already visible.Fixes#4245
Before / after
Both images capture the first real Electron renderer mutation batch containing the submitted transient message. The input was the same
image/pngattachment plus请分析这张图片中的内容at 1280 × 800.Verification
npm run buildnpm run lintnpm run format:checknpm run typechecknpx knip --workspace apps/desktopnpx knip --workspace packages/uigit diff --checkAI use
Select exactly one:
Tool(s) and scope: Maka diagnosed the render-order gap, implemented the optimistic projection and empty-state guard, added regression tests, and produced the isolated Electron E2E evidence. The material commit includes a
Generated-by: Makatrailer.Checklist
Does this PR entail a change in behavior?