Skip to content

Add an activity method to keep Jax awake - #3

Merged
ScottMorris merged 1 commit into
mainfrom
feat/activity
Oct 15, 2026
Merged

ScottMorris merged 1 commit into
mainfrom
feat/activity

Conversation

@ScottMorris

Copy link
Copy Markdown
Contributor

Summary

  • Keep him awake. activity() lets an app tell Jax something happened without changing his mood, so he wakes from a nap and the idle timers restart. It is on the motion engine, the Jax handle returned by createJax, and the fallback companion.
  • Planboard uses it so typing and clicking keep him awake.

Test plan

  • bun run test (166 tests, with this branch merged into the current main), bun run lint, bun run build
  • New tests cover waking from a nap and restarting the idle timers
  • CI is green on this pull request

…ging his mood

**Summary**

- `Jax.activity()` tells him something is happening in the app. With `autoIdle` it wakes him from a nap and puts off the next nap and idle change, and it never changes a mood the app is holding.

**Why**

- An app has no way to say "the person is still here" without calling `setMood('chill')`, which also cancels a held mood such as `writing`.

**Details**

- Added to `Jax` and `Motion` in `src/types.ts`, implemented in `createMotion` (a no-op without `autoIdle`) and forwarded by `createJax`; the SVG fallback has nothing to wake, so it does nothing.
- Tests cover waking from a nap, repeated activity holding off a nap, a held mood being left alone, and no effect without `autoIdle`.

**Notes**

- A contract change: anything implementing `Jax` or `Motion` needs the new method.
@ScottMorris ScottMorris added the enhancement New feature or request label Oct 15, 2026
@ScottMorris
ScottMorris merged commit 407d97c into main Oct 15, 2026
5 checks passed
@ScottMorris
ScottMorris deleted the feat/activity branch October 15, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant