Repository navigation
Add an activity method to keep Jax awake - #3
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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, theJaxhandle returned bycreateJax, and the fallback companion.Test plan
bun run test(166 tests, with this branch merged into the currentmain),bun run lint,bun run build