Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Jan 29, 2026

Summary

image image image

Show the initial checkpoint (workspace state at task start) as a fixed UI element at the top of the chat, with visual states for pending/ready/failed.

This replaces the previous approach from PR #10908 (now closed) and provides better UX:

  • Pending state: Greyed out with spinner while checkpoint is initializing
  • Ready state: Full color "Initial State" label with restore/diff menu options
  • Failed state: Warning styling with error indication

Changes

Backend (src/core/checkpoints/index.ts)

  • Added sendInitialCheckpointState() helper function
  • Emits state transitions (pendingready or failed) instead of messages
  • Handles all error paths (timeout, git not installed, etc.)

Types (packages/types/src/vscode-extension-host.ts)

  • Added initialCheckpointState: 'pending' | 'ready' | 'failed' | null to ExtensionMessage/ExtensionState
  • Added initialCheckpointHash: string | null for the commit hash when ready

Webview

  • New InitialCheckpoint component with three visual states
  • CheckpointMenu now supports isInitial prop to hide irrelevant options ("View Diff" vs previous, "View All Changes")
  • State managed via ExtensionStateContext
  • Rendered in ChatView below TaskHeader

Tests

  • 10 new tests for InitialCheckpoint component
  • Existing checkpoint tests updated

Why this approach?

The checkpoint initialization is async and can take time. Instead of showing the checkpoint in the wrong position (middle of chat) when it finishes, we:

  1. Show a pending state immediately at a fixed position
  2. Update to ready/failed when initialization completes
  3. Provide clear visual feedback on the async process

Screenshots

[Screenshots would go here showing pending/ready/failed states]

Related


Important

Introduces InitialCheckpoint UI component to display initial checkpoint state with distinct visual feedback for pending, ready, and failed states in a chat application.

  • Behavior:
    • Adds InitialCheckpoint component to display initial checkpoint state in ChatView.
    • Handles pending, ready, and failed states with distinct UI feedback.
    • Integrates with ExtensionStateContext to manage state.
  • Backend:
    • Adds sendInitialCheckpointState() in index.ts to emit state transitions.
    • Handles errors like timeout and missing git.
  • Types:
    • Updates ExtensionMessage and ExtensionState in vscode-extension-host.ts to include initialCheckpointState and initialCheckpointHash.
  • Webview:
    • Updates ChatView.tsx to render InitialCheckpoint below TaskHeader.
    • Modifies CheckpointMenu to support isInitial prop.
  • Tests:
    • Adds tests for InitialCheckpoint and CheckpointSaved components.
    • Updates existing tests to accommodate new functionality.

This description was created by Ellipsis for 7ee88cc. You can customize this summary. It will automatically update as commits are pushed.

Show the initial checkpoint (workspace state at task start) as a fixed UI element
at the top of the chat, with visual states for pending/ready/failed.

This replaces the previous approach of a header button and provides better UX:
- Pending state: greyed out with spinner while initializing
- Ready state: full color with restore/diff menu options
- Failed state: warning styling with error indication

Changes:
- Add initialCheckpointState and initialCheckpointHash to extension state
- New InitialCheckpoint component with three visual states
- CheckpointMenu now supports isInitial prop to hide irrelevant options
- Backend emits state transitions instead of messages
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. UI/UX UI/UX related or focused labels Jan 29, 2026
@roomote
Copy link
Contributor

roomote bot commented Jan 29, 2026

Oroocle Clock   See task on Roo Cloud

Re-review complete. No new issues found; two of the previously flagged issues look resolved in the latest commit.

  • Fix initial checkpoint restore/preview: currently InitialCheckpoint passes ts={0} into CheckpointMenu, but restore logic looks up messages by ts so restore becomes a no-op.
  • Remove inline gradient styles in InitialCheckpoint (prefer Tailwind/CSS vars).
  • Initial checkpoint restore handler appears to import checkpointRestoreToBase from ../checkpoints, but that module/export does not exist (runtime restore will fail).
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

data-testid="initial-checkpoint-menu-container"
className={cn("h-4 -mt-2", menuVisible ? "block" : "hidden")}>
<CheckpointMenu
ts={0} // Initial checkpoint doesn't have a ts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In InitialCheckpoint, CheckpointMenu is passed ts={0}, but the backend restore handler looks up the target message by timestamp and returns early if it cannot find a matching message. Since no chat message will ever have ts=0, initial checkpoint preview/restore will be a no-op. Consider making restore preview independent of ts, special-casing initial restore to rewind to task start, or passing a real ts for the restore point.

Fix it with Roo Code or mention @roomote and request a fix.

Comment on lines +104 to +113
</div>
<span
className={cn("block w-full h-[2px] mt-[2px] text-xs")}
style={{
backgroundImage: isPending
? "linear-gradient(90deg, rgba(128, 128, 128, .4), rgba(128, 128, 128, .4) 80%, rgba(128, 128, 128, 0) 99%)"
: isFailed
? "linear-gradient(90deg, rgba(239, 68, 68, .4), rgba(239, 68, 68, .4) 80%, rgba(239, 68, 68, 0) 99%)"
: "linear-gradient(90deg, rgba(0, 188, 255, .65), rgba(0, 188, 255, .65) 80%, rgba(0, 188, 255, 0) 99%)",
}}></span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InitialCheckpoint uses an inline style for the gradient. This project prefers Tailwind + VSCode CSS vars for new markup; inline styles here will be harder to theme and keep consistent. Consider extracting the gradient into a class (or using existing utility patterns) so theme changes can be handled in CSS.

Fix it with Roo Code or mention @roomote and request a fix.

The initial checkpoint has no message in clineMessages (ts=0 doesn't exist),
so checkpointRestore was returning early without doing anything.

Now when isInitial=true is passed in the restore payload, the handler
calls checkpointRestoreToBase() instead which properly restores to the
baseHash without needing to find a message.
// For initial checkpoint, use checkpointRestoreToBase instead of checkpointRestore
// because there's no message with ts to find in clineMessages
if (result.data.isInitial) {
const { checkpointRestoreToBase } = await import("../checkpoints")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the initial-checkpoint path, this uses a dynamic import from "../checkpoints", but the only checkpoints module here appears to be src/core/checkpoints/index.ts (and it does not export checkpointRestoreToBase). As written, the restore action will throw at runtime (module or export not found) and the initial restore will fail.

Fix it with Roo Code or mention @roomote and request a fix.

This function was in the old PR #10908 but was not included when we
created the new branch from origin/main. It's needed for restoring
to the initial checkpoint state.
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jan 30, 2026
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jan 30, 2026
@hannesrudolph hannesrudolph reopened this Jan 30, 2026
@github-project-automation github-project-automation bot moved this from Done to Triage in Roo Code Roadmap Jan 30, 2026
@github-project-automation github-project-automation bot moved this from Done to New in Roo Code Roadmap Jan 30, 2026
@roomote
Copy link
Contributor

roomote bot commented Jan 30, 2026

Oroocle Clock   Follow along on Roo Cloud

Re-review complete. One remaining issue flagged.

  • Remove inline gradient styles in InitialCheckpoint (prefer Tailwind/CSS vars).

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

</div>
<span
className={cn("block w-full h-[2px] mt-[2px] text-xs")}
style={{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InitialCheckpoint uses an inline style to set the gradient background. This makes the element harder to theme (VS Code theme vars) and goes against the project preference for Tailwind/CSS vars for new markup; consider moving these gradients into CSS (eg a small class per state) and toggling via className instead.

Fix it with Roo Code or mention @roomote and request a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files. UI/UX UI/UX related or focused

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

2 participants