Skip to content

[CFX-6271] Logo animation on a first run #445

Open
cdevent wants to merge 3 commits into
mainfrom
cdevent/animation-firstrun
Open

[CFX-6271] Logo animation on a first run #445
cdevent wants to merge 3 commits into
mainfrom
cdevent/animation-firstrun

Conversation

@cdevent

@cdevent cdevent commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

RATIONALE

Refactored first run logo with an animation

image
Screen.Recording.2026-04-21.at.10.47.04.mov

CHANGES

PR Automation

Comment-Commands: Trigger CI by commenting on the PR:

  • /trigger-smoke-test or /trigger-test-smoke - Run smoke tests
  • /trigger-install-test or /trigger-test-install - Run installation tests

Labels: Apply labels to trigger workflows:

  • run-smoke-tests or go - Run smoke tests on demand (only works for non-forked PRs)

Important

For Forked PRs: The run-smoke-tests label won't work. A required Smoke Tests check will block merge until a maintainer acts:

  • A maintainer uses /approve-smoke-tests to run smoke tests (results will set the check)
  • A maintainer uses /skip-smoke-tests to bypass the check without running tests

Please comment requesting a maintainer review if you need smoke tests to run.


Note

Medium Risk
Runs new TUI code on the hot path for every command’s first execution and writes new global state, which could affect terminal behavior or scripted usage if detection/state persistence misbehaves.

Overview
Adds a first-run welcome experience by running a Bubble Tea animated DataRobot logo before executing any command (via PersistentPreRunE in cmd/root.go), but only when stdout is an interactive terminal.

Persists a new global state flag (first_animation_shown in ~/.config/datarobot/state.yaml) to ensure the animation only shows once, and introduces a new tui spring-based animation model (plus tests) backed by the new github.com/charmbracelet/harmonica dependency.

Reviewed by Cursor Bugbot for commit 3678ca8. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added the go Pull requests that update go code label Apr 21, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

license-eye has checked 176 files.

Valid Invalid Ignored Fixed
167 2 7 0
Click to see the invalid file list
  • tui/logo_animation_test.go
  • tui/logo_animation.go
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

Comment thread tui/logo_animation.go
Comment thread tui/logo_animation_test.go

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit fe1870a. Configure here.

Comment thread tui/logo_animation.go

@ajalon1 ajalon1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I really want to see this in the CLI! Some better error checking to make sure we don't break things though.

Comment thread tui/logo_animation.go
Comment thread cmd/root.go
Comment on lines +268 to +272
// Only show animation when stdout is a terminal (not piped or redirected)
fi, err := os.Stdout.Stat()
if err != nil || (fi.Mode()&os.ModeCharDevice) == 0 {
return
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Will this handle smoke tests?

Comment thread internal/state/global.go
// PluginUpdateChecks maps plugin name → last check timestamp (UTC).
PluginUpdateChecks map[string]time.Time `yaml:"plugin_update_checks,omitempty"`
// FirstAnimationShown tracks whether the welcome animation has been displayed.
FirstAnimationShown bool `yaml:"first_animation_shown,omitempty"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I might change this property to something like "welcome_animation_shown" since that's pretty much what it is. IDK what other animations we intend to have. :D

Comment thread cmd/root.go

m := tui.NewLogoAnimationModel()

_, _ = tui.Run(m, tea.WithAltScreen())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What happens if the animation model crashes for some reason? :D

Comment thread cmd/root.go
func showFirstRunAnimation() {
if !state.IsFirstRun() {
return
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think we had ever checked the state file before at this point, in PersistentPreRunE. I hope this doesn't add too much of a delay.

Comment thread internal/state/global.go
Comment on lines +97 to +99
if err != nil {
return false
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is nice; we don't want any issues in loadGlobalState() to break the CLI, just move on.

Maybe log.Debug here.

Comment thread internal/state/global.go
Comment on lines +106 to +109
gs, err := loadGlobalState()
if err != nil {
return
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is nice; we don't want any issues in loadGlobalState() to break the CLI, just move on.

Maybe log.Debug here.

Comment thread tui/logo_animation.go

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is cool.

Comment thread go.mod
github.com/charmbracelet/bubbles v1.0.0
github.com/charmbracelet/bubbletea v1.3.10
github.com/charmbracelet/glamour v1.0.0
github.com/charmbracelet/harmonica v0.2.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Charmbracelet team has the funniest package names.

@ajalon1 ajalon1 changed the title [YOLO] Logo animation on a first run [CFX-6271] Logo animation on a first run May 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Smoke tests triggered! Running on Linux and Windows...

@github-actions

Copy link
Copy Markdown
Contributor

Some smoke tests failed.

✅ Linux: success
❌ Windows: failure

View run details

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

Labels

go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants