Skip to content

Replace Knight Rider sweep bar with a simple on/off square toggle #196

Closed

Description

@mdev34-lab

What

Replace the sweeping "Knight Rider" bar shown at the bottom of the chat input while a session is active with a simple two-state blink: a single white square that toggles on and off every 0.5s, like an audio-recorder indicator.

Where

  • packages/tui/src/ui/spinner.ts — createFrames() / createColors(), the "blocks" style generates the 54-frame sweep-with-trail animation
  • packages/tui/src/component/prompt/index.tsx — spinnerDef memo builds frames/color from createFrames/createColors with style: "blocks", rendered as:

tsx

  <spinner color={spinnerDef().color} frames={spinnerDef().frames} interval={40} />

Proposed change

Don't need the full Knight Rider machinery for this. Simplest path: give spinnerDef a two-frame set instead of createFrames/createColors output, e.g.:

ts

const spinnerDef = createMemo(() => {
  const agent = /* ...unchanged agent/color logic... */
  return {
    frames: ["■", " "],
    color: () => color, // flat color generator, no gradient/fade needed
  }
})

and bump the render interval from 40 to 500:

<spinner color={spinnerDef().color} frames={spinnerDef().frames} interval={500} />

If createColors/createFrames remain used elsewhere (worth checking — deriveTrailColors, deriveInactiveColor, KnightRiderStyle may have other callers), leave ui/spinner.ts alone and just stop calling it from this one call site; otherwise it may be worth trimming the now-dead trail/fade logic out of ui/spinner.ts in a follow-up.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions