Repository navigation
fix(conversation): keep map and marker focus, skip empty thread input - #145
Open
pratikbuilds wants to merge 1 commit into
Open
pratikbuilds wants to merge 1 commit into
pratikbuilds wants to merge 1 commit into
Conversation
Addresses findings 5, 6, 7 and 19 of corbitsdev#142. - 5: ConversationMap's Arrow/Home/End scroll only the rail to the next tick and focus it with preventScroll, so a clipped tick no longer scrolls the page or another ancestor. - 6: when the map hides with the focused tick's turn still present, focus now moves to the conversation log instead of falling to the body. - 7: ConversationEarlier clears its retry focus flag when the marker unmounts, so a later stall or load cannot pull focus to it. - 19: ConversationThread leaves out the input slot for boolean children, as `{show && <PromptInput />}` passes.
TheGreatAxios
requested changes
Oct 30, 2026
TheGreatAxios
left a comment
Contributor
There was a problem hiding this comment.
Review · Request changes
Summary
ConversationMap, ConversationEarlier, and ConversationThread fixes for #142 (items 5, 6, 7, and 19) pass bun run check, bun run dep-guard, and Playwright e2e/conversation-map.spec.ts. One should-fix in ConversationMap where hiding the map while a tick is previewed leaves preview state set and reopens a stale tooltip when the map returns.
Blockers
None.
Should-fix
src/ui/conversation-map.tsx:163(reviewer,designer) — Whenhidden(turns.length < 2) becomestruewhile a tick is focused (or pointer-previewed),<nav>unmounts without firingonBluroronPointerLeave. The layout effect callssetFocusedId(null)and moves focus toscrollContainer(), but never clearspreview. As a result,previewing(preview !== nullat line 178) staystrue(keeping the documentEscapelistener attached while hidden), and when a second turn arrives (turns.length >= 2) while focus remains on the conversation log,previewedstill matches the retained turn ID and immediately renders<div role="tooltip" data-slot="conversation-map-preview">. CallsetPreview(null)before(stop ?? scrollContainer())?.focus({ preventScroll: true }), and clearpreviewwhenhiddenor!turnIds.includes(preview.id).
Informational
src/ui/conversation-thread.tsx:120(designer) —children === undefined || children === null || typeof children === "boolean"catches{show && <PromptInput />}whenshowisfalse, but multiple conditional siblings ({a && <X />}{b && <Y />}->[false, false]) or an empty fragment still render<div data-slot="conversation-thread-input">.src/ui/conversation-map.tsx:163,src/ui/conversation-earlier.tsx:98(designer) — Focus recovery runs on prop transitions (turns.length < 2andhasEarlier === false); if a consumer conditionally unmounts the component directly while focused, only effect cleanups run (compareScrollToLatestinsrc/ui/conversation.tsx:1031).
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.
Summary
Focus fixes for the conversation map and the earlier-messages marker, plus a thread slot fix (findings 5, 6, 7 and 19).
preventScroll, so a clipped tick no longer scrolls the page or another ancestor.{show && <PromptInput />}passes, no longer render an empty input slot.Verification
bun run checkbun run test:e2e, with the new rail-scroll and hide-with-focus cases ine2e/conversation-map.spec.tsconversation-earliertest keepsstalledtrue while the history ends and returns, and fails withouthasEarlierin the effect's deps.Closes #142