Skip to content

feat: add animated CLI banner with static logo fallback#33

Merged
abhiramkast merged 2 commits into
mainfrom
feat/animated-banner
May 21, 2026
Merged

feat: add animated CLI banner with static logo fallback#33
abhiramkast merged 2 commits into
mainfrom
feat/animated-banner

Conversation

@harsh7z

@harsh7z harsh7z commented May 21, 2026

Copy link
Copy Markdown
Contributor

What

Adds an Ink-rendered braille animation that plays before the interactive prompts on linq init, linq login, and linq signup. The static logo (already shown on bare linq via help) is now generated from the same frame data, so animated and static versions stay visually aligned.

Where

  • src/lib/banner-motion.tsx — new Ink/React component with 43-frame braille animation (auto-generated from ASCII Motion, patched for crop + theming).
  • src/lib/banner.ts — exports renderBanner() (animated, used by commands) and LOGO (static string, derived from the first frame of the animation, used by help.ts). Falls back to the static logo when stdout isn't a TTY or NO_COLOR/CI is set.
  • src/commands/{init,login,signup}.ts — call await renderBanner() before the welcome line. For login, it's gated behind the interactive token prompt so --token users don't see it.
  • package.json / tsconfig.json — add ink, react deps and enable jsx: "react-jsx".

Preview

animated-banner

Renders an Ink-based braille animation on init/login/signup, plus a
synchronous static logo on bare `linq` (via help). Animation and
static both reuse the same frame data so they stay visually aligned.
@harsh7z
harsh7z requested a review from jflayhart as a code owner May 21, 2026 16:57
@harsh7z
harsh7z requested a review from abhiramkast May 21, 2026 16:59
- Split banner-motion.tsx into banner-frames.ts (pure data) +
  banner-motion.tsx (ink/react component). banner.ts imports
  STATIC_LOGO_LINES from banner-frames.ts so the static path doesn't
  load ink at all.
- renderBanner() now dynamic-imports ink + react + banner-motion only
  when an animation actually plays. Bare linq / linq tokens / etc no
  longer pay the ~50-100ms ink load cost.
- Suppress Node's "Importing JSON modules is an experimental feature"
  warning in bin/run.js + bin/dev.js. It's emitted by ink's
  transitive deps; targeted by warning name + message so other
  warnings still surface.
- Derive ANIMATION_MS from the sum of frame durations instead of the
  hard-coded 2100ms guess.

Fixes the 3 broken test files (init/login/signup) that previously
failed because ink loaded yoga-layout WASM at module-import time.
@abhiramkast
abhiramkast merged commit 7c3984e into main May 21, 2026
4 checks passed
@abhiramkast
abhiramkast deleted the feat/animated-banner branch May 21, 2026 17:43
@jflayhart

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 2.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants