Skip to content

🎨 Palette: Hide cursor during spinner animation#15

Open
badMade wants to merge 2 commits into
mainfrom
palette/hide-cursor-spinner-2176432711789245205
Open

🎨 Palette: Hide cursor during spinner animation#15
badMade wants to merge 2 commits into
mainfrom
palette/hide-cursor-spinner-2176432711789245205

Conversation

@badMade

@badMade badMade commented Apr 15, 2026

Copy link
Copy Markdown
Owner

💡 What: Added cursor hiding/showing logic to the Spinner component in the CLI renderer.
🎯 Why: While a CLI spinner animates, an active blinking cursor jumping around the screen can be visually distracting and is generally considered poor terminal UX.
📸 Before/After: The blinking terminal cursor no longer overlays the spinner animation.
Accessibility/Polish: Adds an implementation of Drop to the spinner to ensure the cursor is restored if the process exits unexpectedly, avoiding a corrupted terminal state.


PR created automatically by Jules for task 2176432711789245205 started by @badMade

When the TUI is showing the `Spinner` animation, the cursor is currently
still visible. This causes the cursor block to rapidly jump around the screen
as the terminal frame updates, which is visually distracting.

This updates the `Spinner` struct to hide the cursor via `crossterm::cursor::Hide`
during animation. The cursor is then safely restored via `Show` when the
spinner completes, fails, or drops out of scope (to prevent terminal corruption).

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request implements cursor visibility management for the Spinner component to improve the visual polish of the CLI. It introduces a cursor_hidden flag and ensures the cursor is hidden during animation and restored upon completion or failure, including a Drop implementation for safety. Feedback suggests refactoring the cursor restoration logic into a helper method to reduce duplication and addressing the inconsistency where the Drop implementation hardcodes stdout while other methods use a generic writer.

Comment thread rust/crates/rusty-claude-cli/src/render.rs
Comment thread rust/crates/rusty-claude-cli/src/render.rs Outdated
@badMade

badMade commented Apr 22, 2026

Copy link
Copy Markdown
Owner Author

@copilot code review

@badMade

badMade commented Apr 22, 2026

Copy link
Copy Markdown
Owner Author

@claude code review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds cursor visibility management to the CLI Spinner so the terminal cursor is hidden during spinner animation and restored afterward (including an attempted restore on drop), improving terminal UX while rendering animated progress.

Changes:

  • Track cursor visibility in Spinner and hide the cursor on first tick().
  • Show the cursor again in finish() / fail() and add a Drop impl to restore cursor visibility.
  • Add a palette note documenting the UX learning.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
rust/crates/rusty-claude-cli/src/render.rs Implements cursor hide/show logic for spinner rendering and adds Drop restore behavior.
.Jules/palette.md Documents the rationale and guidance for cursor visibility during terminal animations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rust/crates/rusty-claude-cli/src/render.rs Outdated
Comment thread rust/crates/rusty-claude-cli/src/render.rs
Comment thread .Jules/palette.md Outdated
Comment thread rust/crates/rusty-claude-cli/src/render.rs Outdated
@badMade

badMade commented Apr 23, 2026

Copy link
Copy Markdown
Owner Author

@codex Code Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2d5c7fe886

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rust/crates/rusty-claude-cli/src/render.rs Outdated
@badMade badMade marked this pull request as ready for review April 23, 2026 14:48
@badMade

badMade commented Apr 23, 2026

Copy link
Copy Markdown
Owner Author

@codex code review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2d5c7fe886

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rust/crates/rusty-claude-cli/src/render.rs Outdated

Copilot AI commented May 1, 2026

Copy link
Copy Markdown

@copilot code review

Addressed in 71214e1: removed the Drop-based stdout cursor restore path, tightened Spinner derives, added spinner cursor hide/show unit coverage, and updated the palette wording to avoid overclaiming cleanup guarantees. Screenshot (CLI output context): spinner tests passing in this commit’s CI run.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants