Skip to content

feat(app): idle bots sleep, and only a working flame moves on and on - #165

Merged
httpsphl merged 1 commit into
mainfrom
feat/sleeping-idle
Oct 4, 2026
Merged

httpsphl merged 1 commit into
mainfrom
feat/sleeping-idle

Conversation

@httpsphl

@httpsphl httpsphl commented Oct 4, 2026

Copy link
Copy Markdown
Owner

What

  • A bot with nothing to do (idle) now sleeps the same way a paused or stopped one does: a small ember with its eyes shut, standing still.
  • Only a working bot's mascot moves on and on (the burning flame and the embers). Every other change plays once:
    • Wake (existing, 0.8 s): when the bot starts working or comes back from paused or stopped. If it is turned back on with nothing to do, it wakes and then falls back asleep.
    • Fall asleep (new, mascot-sleep.css, 0.9 s): the mascot yawns, its lids grow heavy, open a little once more and close into the arcs, and it slumps as the flame burns down to the ember.
    • Cheer (existing): after real work it still cheers, then falls asleep.
  • Between the other moods, the flame morphs to the new shape once, with a d transition.
    • Chrome starts no transition while an animation is running, so the working flame burns down with its own frames (fire-sleep).
  • Waiting hops once as it starts waiting, then stands still. Tired keeps its low flame without moving.
  • The idle, waiting, tired and sleeping flame loops are gone. Their static shapes come from the old first frames.
  • A new awake mood covers mascots that belong to no bot (welcome, empty pages, setup). They stand with their eyes open, and they blink and glance around in the existing eye moments.
  • Spec 15.3 is updated.

Checks

  • pnpm check passes. New tests cover:
    • falling asleep;
    • waking and going back to sleep;
    • the cheer followed by sleep;
    • the frames ending at rest;
    • only working rules being infinite.
  • In the browser preview (FakeBotloft):
    • Idle bots show as embers, like the paused ones.
    • I stepped the fall-asleep frames by hand: the flame goes from y=133 to the ember at y=262, the eyes close, and the arcs appear by 0.7 s.
    • I checked that a static → static d transition runs, and that a working → idle change starts no transition (hence fire-sleep).
  • Not measured on this branch: CPU on the real app. An idle bot now runs no animation, which is the same case as the paused bots that measured about 0.01 core before.

Manual check on the real app

  1. Send a message to an idle bot. It hops awake, burns while it works, cheers when done, then falls asleep.
  2. Pause a working bot. It falls asleep without cheering.
  3. Resume it. It hops awake and goes back to sleep.

A bot with nothing to do now looks like a paused or stopped one: a small
ember with its eyes shut, standing still. Turned on, it hops awake; while
it works, the flame burns and throws embers as before; when it has nothing
left to do it cheers (after real work) and falls asleep. Every change
between moods plays once: the flame morphs to the new shape with a `d`
transition, and falling asleep has its own frames (a running animation
starts no transition). Waiting hops once as it starts; tired holds its low
flame. Mascots that are no bot's (welcome, empty pages, setup) stay awake.
@httpsphl
httpsphl enabled auto-merge October 4, 2026 19:55
@httpsphl
httpsphl merged commit 090a28a into main Oct 4, 2026
4 checks passed
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.

1 participant