Skip to content

feat(frontend): rocket-launch animation on Run button click#5067

Closed
chenlica wants to merge 9 commits into
apache:mainfrom
chenlica:feat/rocket-launch-animation
Closed

feat(frontend): rocket-launch animation on Run button click#5067
chenlica wants to merge 9 commits into
apache:mainfrom
chenlica:feat/rocket-launch-animation

Conversation

@chenlica
Copy link
Copy Markdown
Contributor

@chenlica chenlica commented May 15, 2026

What changes were proposed in this PR?

Adds a small fun visual flourish to the workflow editor: when the user clicks
the Run button in the top toolbar, a 🚀 emoji is spawned at the button's
position, traces three counterclockwise loops to the left of the button, and
then accelerates straight up off the top of the viewport.

Details:

  • Animation logic is extracted into a pure utility module,
    frontend/src/app/workspace/component/menu/launch-rocket.ts, so it can be
    unit-tested without bootstrapping the heavyweight MenuComponent TestBed
    (the existing menu.component.spec.ts is entirely commented out and has no
    working setup).
  • MenuComponent.onRunButtonClick() invokes launchRocket(...) and then
    delegates to the existing dynamic onClickRunHandler so all existing button
    states (Run / Pause / Resume / Connect / Submitting / …) continue to work.
  • The animation uses the Web Animations API — no new CSS, no new dependencies.

Any related issues, documentation, discussions?

None. Cosmetic-only change isolated to the workflow editor's top menu.

How was this PR tested?

A new Jasmine spec covers the utility:
frontend/src/app/workspace/component/menu/launch-rocket.spec.ts — 13 tests,
all passing under yarn ng test --include="**/launch-rocket.spec.ts".

The tests verify:

  • returns null and creates no DOM when given null
  • appends a 🚀 element to document.body, positioned at the button's center
  • calls Element.prototype.animate with the configured duration
  • emits cycles × steps + 1 orbit keyframes plus the shoot-up keyframe
  • the orbit forms a closed counterclockwise loop (starts and ends at translate(0px, 0px))
  • rotation is strictly monotonically decreasing across orbit keyframes, with total angular distance equal to 360° × cycles (proves CCW + cycle count)
  • every orbit dx is non-positive (the circle is to the left of the start)
  • the shoot-up keyframe has opacity: 0, translates upward, and uses a rotation congruent to "pointing up" modulo 360°
  • the rocket element is removed when Animation.onfinish fires
  • multiple clicks create independent rockets
  • the orbit radius auto-shrinks when the Run button is close to the left edge of the viewport (≥ 40px, < 140px)

Also manually verified in ng serve by clicking the Run button on a runnable workflow.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Sonnet 4.6, 1M context, Anthropic, 2026-05-14)

chenlica and others added 8 commits September 24, 2025 11:30
…tive-merge-sort

feat(sort): replace python-based sort with native executor
…to-use-native-merge-sort

Revert "feat(sort): replace python-based sort with native executor"
Spawns a rocket emoji at the Run button's position and animates it
through three counterclockwise loops to the left of the button, then
accelerates straight up off the top of the viewport. Logic lives in a
pure utility so it can be unit-tested without bootstrapping the
MenuComponent TestBed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added feature frontend Changes related to the frontend GUI labels May 15, 2026
… run button

- Replace document.getElementById with @ViewChild to follow Angular idioms
- Cancel in-flight rocket animations in ngOnDestroy to prevent DOM leaks
- Handle Animation.oncancel alongside onfinish so cancelled animations also clean up the rocket element

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@chenlica
Copy link
Copy Markdown
Contributor Author

it's a prototype to learn how to use Claude to raise a PR

@chenlica chenlica closed this May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant