GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||
GeezerVison is showing github.com — [codex] Upgrade Legend List chat scrolling by juliusmarminge · Pull Request #3545 · pingdotgg/t3code Conversation
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| extraData={listAppearanceData} | ||
| renderItem={renderItem} | ||
| keyExtractor={(entry) => `${entry.type}:${entry.id}`} | ||
| keyExtractor={(entry) => entry.id} |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium threads/ThreadFeed.tsx:1451
keyExtractor returns entry.id directly, so queued messages and their delivered copies share the same list key. When both entries exist in props.feed during the send handoff, KeyboardAwareLegendList receives duplicate keys, causing it to reuse the wrong row or drop one message. Consider including the entry type in the key (e.g., \${entry.type}:${entry.id}``) to ensure uniqueness.
In file @apps/mobile/src/features/threads/ThreadFeed.tsx around line 1451:
`keyExtractor` returns `entry.id` directly, so queued messages and their delivered copies share the same list key. When both entries exist in `props.feed` during the send handoff, `KeyboardAwareLegendList` receives duplicate keys, causing it to reuse the wrong row or drop one message. Consider including the entry type in the key (e.g., `\`\${entry.type}:\${entry.id}\``) to ensure uniqueness.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
Bugbot Autofix prepared fixes for both issues found in the latest run.
buildThreadFeed to filter out queued messages whose messageId already exists in confirmed loadedMessages, preventing two list items from sharing the same key during the promotion window.composerOverlayRef from a plain useRef to a state-based callback ref (useState + setter as ref), making the useLayoutEffect depend on the element itself so the ResizeObserver re-attaches whenever the overlay mounts after the initial empty-thread render.Or push these changes by commenting:
@cursor push 4dbf9bfa67
diff --git a/apps/mobile/src/lib/threadActivity.ts b/apps/mobile/src/lib/threadActivity.ts --- a/apps/mobile/src/lib/threadActivity.ts +++ b/apps/mobile/src/lib/threadActivity.ts @@ -1265,6 +1265,10 @@ const oldestLoadedMessageCreatedAt = options?.loadedMessages !== undefined ? (loadedMessages[0]?.createdAt ?? null) : null; const workLogEntries = deriveWorkLogEntries(thread.activities); + const confirmedMessageIds = + queuedMessages.length > 0 + ? new Set(loadedMessages.map((message) => message.id)) + : (undefined as never); const entries = Arr.sortWith( [ ...loadedMessages.map<RawThreadFeedEntry>((message) => ({ @@ -1273,13 +1277,15 @@ createdAt: message.createdAt, message, })), - ...queuedMessages.map<RawThreadFeedEntry>((queuedMessage) => ({ - type: "queued-message", - id: queuedMessage.messageId, - createdAt: queuedMessage.createdAt, - queuedMessage, - sending: queuedMessage.messageId === dispatchingQueuedMessageId, - })), + ...queuedMessages + .filter((qm) => !confirmedMessageIds.has(qm.messageId)) + .map<RawThreadFeedEntry>((queuedMessage) => ({ + type: "queued-message", + id: queuedMessage.messageId, + createdAt: queuedMessage.createdAt, + queuedMessage, + sending: queuedMessage.messageId === dispatchingQueuedMessageId, + })), ...workLogEntries .filter((entry) => { if (options?.loadedMessages === undefined) { diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -1148,7 +1148,7 @@ LastInvokedScriptByProjectSchema, ); const legendListRef = useRef<LegendListRef | null>(null); - const composerOverlayRef = useRef<HTMLDivElement | null>(null); + const [composerOverlayEl, setComposerOverlayEl] = useState<HTMLDivElement | null>(null); const [composerOverlayHeight, setComposerOverlayHeight] = useState(0); const isAtEndRef = useRef(true); const attachmentPreviewHandoffByMessageIdRef = useRef<Record<string, string[]>>({}); @@ -1157,11 +1157,10 @@ const terminalUiOpenByThreadRef = useRef<Record<string, boolean>>({}); useLayoutEffect(() => { - const composerOverlay = composerOverlayRef.current; - if (!composerOverlay) return; + if (!composerOverlayEl) return; const updateHeight = () => { - const nextHeight = Math.ceil(composerOverlay.getBoundingClientRect().height); + const nextHeight = Math.ceil(composerOverlayEl.getBoundingClientRect().height); setComposerOverlayHeight((currentHeight) => currentHeight === nextHeight ? currentHeight : nextHeight, ); @@ -1171,9 +1170,9 @@ if (typeof ResizeObserver === "undefined") return; const observer = new ResizeObserver(updateHeight); - observer.observe(composerOverlay); + observer.observe(composerOverlayEl); return () => observer.disconnect(); - }, []); + }, [composerOverlayEl]); const terminalUiState = useTerminalUiStateStore((state) => selectThreadTerminalUiState(state.terminalUiStateByThreadKey, routeThreadRef), @@ -4805,7 +4804,7 @@ {/* Input bar */} <div - ref={composerOverlayRef} + ref={setComposerOverlayEl} data-chat-composer-overlay="true" className={cn( "pointer-events-none absolute inset-x-0 bottom-0 z-20 pl-[calc(env(safe-area-inset-left)+0.75rem)] pr-[calc(env(safe-area-inset-right)+0.75rem)] pt-1.5 sm:pl-[calc(env(safe-area-inset-left)+1.25rem)] sm:pr-[calc(env(safe-area-inset-right)+1.25rem)] sm:pt-2",
You can send follow-ups to the cloud agent here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
ApprovabilityVerdict: Needs human review 3 blocking correctness issues found. This PR substantially refactors chat scrolling behavior across mobile and web platforms with new anchoring logic. Multiple unresolved review comments identify medium-severity bugs (duplicate keys, scroll yanking, blocked touches) that warrant human review before merging. You can customize Macroscope's approvability policy. Learn more. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
- Remove queued-message entries from thread feeds - Anchor scroll behavior to confirmed messages and active thread keys - Clean up composer overlay measurement and thread send state
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
Bugbot Autofix prepared fixes for both issues found in the latest run.
lastScrolledAnchorMessageIdRef to null in the .catch() handler so that subsequent effect runs can retry the scroll when scrollMessageToEnd fails.queuedSendStartedAt from the first queued outbox message's createdAt and passed it to deriveActiveWorkStartedAt instead of null, restoring parity with the web client.Or push these changes by commenting:
@cursor push 670582d839
diff --git a/apps/mobile/src/features/threads/ThreadDetailScreen.tsx b/apps/mobile/src/features/threads/ThreadDetailScreen.tsx --- a/apps/mobile/src/features/threads/ThreadDetailScreen.tsx +++ b/apps/mobile/src/features/threads/ThreadDetailScreen.tsx @@ -292,6 +292,7 @@ } lastScrolledAnchorMessageIdRef.current = anchorMessageId; void scrollMessageToEnd({ animated: true, closeKeyboard: false }).catch(() => { + lastScrolledAnchorMessageIdRef.current = null; freeze.set(false); }); }); diff --git a/apps/mobile/src/state/use-thread-composer-state.ts b/apps/mobile/src/state/use-thread-composer-state.ts --- a/apps/mobile/src/state/use-thread-composer-state.ts +++ b/apps/mobile/src/state/use-thread-composer-state.ts @@ -115,6 +115,7 @@ }; }, [selectedThreadDetail, selectedThreadShell]); + const queuedSendStartedAt = selectedThreadQueuedMessages[0]?.createdAt ?? null; const activeWorkStartedAt = useMemo(() => { const selectedThread = selectedThreadDetail ?? selectedThreadShell; if (!selectedThread) { @@ -124,9 +125,14 @@ return deriveActiveWorkStartedAt( selectedThread.latestTurn, selectedThreadSessionActivity, - null, + queuedSendStartedAt, ); - }, [selectedThreadDetail, selectedThreadSessionActivity, selectedThreadShell]); + }, [ + queuedSendStartedAt, + selectedThreadDetail, + selectedThreadSessionActivity, + selectedThreadShell, + ]); const activeThreadBusy = !!selectedThread &&
You can send follow-ups to the cloud agent here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
- Clear stale anchor state when scroll-to-end fails - Remove end alignment from the mobile thread feed
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium
| const listAppearanceData = useMemo( |
listAppearanceData omits unsettledTurnId, but renderFeedEntry uses it to compute showAssistantMeta for terminal assistant messages. When a turn completes and latestTurn changes without new feed items, LegendList caches visible rows; the assistant message stays stuck in its in-progress presentation (missing copy/timestamp controls) until the row recycles. Consider adding unsettledTurnId to extraData so the row re-renders when the turn state changes.
In file @apps/mobile/src/features/threads/ThreadFeed.tsx around line 1173:
`listAppearanceData` omits `unsettledTurnId`, but `renderFeedEntry` uses it to compute `showAssistantMeta` for terminal assistant messages. When a turn completes and `latestTurn` changes without new feed items, `LegendList` caches visible rows; the assistant message stays stuck in its in-progress presentation (missing copy/timestamp controls) until the row recycles. Consider adding `unsettledTurnId` to `extraData` so the row re-renders when the turn state changes.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium
| import { type EnvironmentConnectionPhase } from "@t3tools/client-runtime/connection"; |
handleSendMessage sets anchorMessageId to the returned queued messageId, and the effect at lines 278–305 keeps scrolling to that anchor until the message appears in selectedThreadFeed. Since props.onSendMessage only enqueues the message and returns immediately, if delivery is delayed (offline, slow connection), the user can scroll elsewhere, then get yanked back to the bottom minutes later when the queued message is finally confirmed. Consider clearing the anchor immediately when the send is only queued, or anchoring to a locally rendered optimistic message instead of persisting until remote confirmation.
In file @apps/mobile/src/features/threads/ThreadDetailScreen.tsx around line 1:
`handleSendMessage` sets `anchorMessageId` to the returned queued `messageId`, and the effect at lines 278–305 keeps scrolling to that anchor until the message appears in `selectedThreadFeed`. Since `props.onSendMessage` only enqueues the message and returns immediately, if delivery is delayed (offline, slow connection), the user can scroll elsewhere, then get yanked back to the bottom minutes later when the queued message is finally confirmed. Consider clearing the anchor immediately when the send is only queued, or anchoring to a locally rendered optimistic message instead of persisting until remote confirmation.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
- add configurable chat list anchor offset for composer chrome - restyle the web composer with shared glass/inset chrome - update mobile thread feed anchoring to match measured content
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue. You can view the agent here.
Reviewed by Cursor Bugbot for commit 11e34a5. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| /> | ||
| </div> | ||
| )} | ||
| </div> |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Medium Severity
Bottom safe-area padding was moved from the pointer-events-none composer overlay root onto chat-composer-lower-chrome, which still uses default pointer events and a semi-transparent background. That full-width band sits above the message list and absorbs taps and scroll drags that previously reached the timeline.
Reviewed by Cursor Bugbot for commit 11e34a5. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Bugbot Autofix determined this is a false positive.
The lower-chrome div inherits pointer-events: none from its parent overlay element because CSS pointer-events is an inherited property, so it correctly passes through all touches to the timeline beneath.
You can send follow-ups to the cloud agent here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
<!--⚠️ READ BEFORE OPENING⚠️ We are not actively accepting contributions right now. You can still open a PR, but please do so knowing there is a high chance we may close it without merging it, or never review it. - Small, focused PRs are strongly preferred. Bug fixes are most likely to be merged. - New features will most likely just annoy us. - 1,000+ line PRs with a bunch of new features will probably get you banned from the repo. --> ## What Changed <!-- Describe the change clearly and keep scope tight. --> ## Why <!-- Explain the problem being solved and why this approach is the right one. --> ## UI Changes <!-- If this PR changes UI, include clear before/after screenshots. If the change involves motion or interaction, include a short video. Delete this section if not applicable. --> ## Checklist - [ ] This PR is small and focused - [ ] I explained what changed and why - [ ] I included before/after screenshots for any UI changes - [ ] I included a video for animation/interaction changes <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Chat and thread views now keep replies anchored around newly sent messages, improving scroll positioning after sending. * Composer height is now measured more accurately, so message lists and “scroll to bottom” controls stay aligned with the input area. * Branch, model, and chat lists now handle keyboard navigation and item types more smoothly. * **Bug Fixes** * Improved thread and chat scrolling behavior when switching conversations or sending messages. * Updated several app dependencies for stability and compatibility. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Julius Marminge <[email protected]>
The branch predated main's #3545 bump and pinned 1.21.6; keep main's version rather than silently downgrading it. Co-Authored-By: Claude Fable 5 <[email protected]>
- Validate T3CODE_IOS_PERSONAL_TEAM_BUNDLE_ID as a reverse-DNS identifier - Expose extra.iosPersonalTeamBuild so runtime capability gating works - Gate native APNs token acquisition on supportsAgentAwarenessPush() so Personal Team builds never call getDevicePushTokenAsync without the aps-environment entitlement - Document why appleSignIn gating on the Clerk plugin is load-bearing - Restore react-native-keyboard-controller 1.21.7 (main bumped it in #3545; 1.21.6 here was a stale pin) Co-Authored-By: Claude Fable 5 <[email protected]>
- Validate T3CODE_IOS_PERSONAL_TEAM_BUNDLE_ID as a reverse-DNS identifier - Expose extra.iosPersonalTeamBuild so runtime capability gating works - Gate native APNs token acquisition on supportsAgentAwarenessPush() so Personal Team builds never call getDevicePushTokenAsync without the aps-environment entitlement - Document why appleSignIn gating on the Clerk plugin is load-bearing - Restore react-native-keyboard-controller 1.21.7 (main bumped it in #3545; 1.21.6 here was a stale pin) Co-Authored-By: Claude Fable 5 <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.