fix(chat): address PR review issues for checkpoint navigation

- Revert out-of-scope esbuild.mjs retry logic (separate concern)
- Add "checkpoint-nav" to ScrollFollowDisengageSource union type
- Guard onJumpToPreviousCheckpoint render behind prop check in CheckpointMenu
- Replace arbitrary Tailwind values (mr-[6px]/ml-[6px]) with standard mr-1.5/ml-1.5
This commit is contained in:
Roo Code 2026-04-20 17:36:37 +00:00
parent 00630edd51
commit 7be8c0f4db
3 changed files with 21 additions and 14 deletions

View file

@ -1426,7 +1426,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
const nextCheckpointIndex = checkpointIndices[nextCursor]
checkpointJumpCursorRef.current = nextCursor
enterUserBrowsingHistory("keyboard-nav-up")
enterUserBrowsingHistory("checkpoint-nav")
virtuosoRef.current?.scrollToIndex({
index: nextCheckpointIndex,
align: "center",
@ -1687,7 +1687,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
<StandardTooltip content={t("chat:scrollToBottom")}>
<Button
variant="secondary"
className={hasLatestCheckpoint ? "flex-1 mr-[6px]" : "flex-[2]"}
className={hasLatestCheckpoint ? "flex-1 mr-1.5" : "flex-[2]"}
onClick={handleScrollToBottomAndResetCheckpointCursor}>
<span className="codicon codicon-chevron-down"></span>
</Button>
@ -1696,7 +1696,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
<StandardTooltip content={t("chat:scrollToLatestCheckpoint")}>
<Button
variant="secondary"
className="flex-1 ml-[6px]"
className="flex-1 ml-1.5"
onClick={handleScrollToLatestCheckpoint}
aria-label={t("chat:scrollToLatestCheckpoint")}>
<span className="codicon codicon-history"></span>

View file

@ -172,16 +172,18 @@ export const CheckpointMenu = ({
</div>
</PopoverContent>
</Popover>
<StandardTooltip content={t("chat:scrollToLatestCheckpoint")}>
<Button
variant="ghost"
size="icon"
onClick={onJumpToPreviousCheckpoint}
data-testid="jump-previous-checkpoint-btn"
aria-label={t("chat:scrollToLatestCheckpoint")}>
<span className="codicon codicon-chevron-up" />
</Button>
</StandardTooltip>
{onJumpToPreviousCheckpoint && (
<StandardTooltip content={t("chat:scrollToLatestCheckpoint")}>
<Button
variant="ghost"
size="icon"
onClick={onJumpToPreviousCheckpoint}
data-testid="jump-previous-checkpoint-btn"
aria-label={t("chat:scrollToLatestCheckpoint")}>
<span className="codicon codicon-chevron-up" />
</Button>
</StandardTooltip>
)}
<Popover open={moreOpen} onOpenChange={(open) => setMoreOpen(open)} data-testid="more-popover">
<StandardTooltip content={t("chat:task.seeMore")}>
<PopoverTrigger asChild>

View file

@ -25,7 +25,12 @@ const HYDRATION_RETRY_WINDOW_MS = 160
export type ScrollPhase = "HYDRATING_PINNED_TO_BOTTOM" | "ANCHORED_FOLLOWING" | "USER_BROWSING_HISTORY"
export type ScrollFollowDisengageSource = "wheel-up" | "row-expansion" | "keyboard-nav-up" | "pointer-scroll-up"
export type ScrollFollowDisengageSource =
| "wheel-up"
| "row-expansion"
| "keyboard-nav-up"
| "pointer-scroll-up"
| "checkpoint-nav"
// ---------------------------------------------------------------------------
// Helpers