Skip to content

Leaky-bucket mechanism for soft-TODOs#2

Open
nedtwigg wants to merge 1 commit intomainfrom
feat/soft-todo-leaky-bucket
Open

Leaky-bucket mechanism for soft-TODOs#2
nedtwigg wants to merge 1 commit intomainfrom
feat/soft-todo-leaky-bucket

Conversation

@nedtwigg
Copy link
Copy Markdown
Member

Summary

  • Soft-TODOs now use a leaky-bucket instead of clearing on first keypress: 5 rapid keypresses to drain, 3 seconds idle to refill
  • Unifies TodoState into a single number (TODO_OFF, [0..TODO_SOFT_FULL], TODO_HARD), eliminating the separate todoBucketLevel field
  • TODO pill visually shrinks (scale + opacity) as the bucket drains, with CSS transitions
  • Adds interactive Storybook story (TodoBucket) for tuning the feel

Test plan

  • All 111 existing tests pass
  • TypeScript compiles clean (lib + standalone)
  • Manual: set alarm, let it ring, attend → soft-TODO appears. Type slowly — pill shrinks per keypress and grows back on idle. 5 rapid chars clears it.
  • Check TodoBucket Storybook story for interactive feel testing

🤖 Generated with Claude Code

Instead of clearing a soft-TODO on the first keypress, use a
filling/leaky bucket: typing drains it (5 keypresses to empty),
idling refills it (3 seconds to full). The TODO pill visually
shrinks and fades as the bucket drains.

Unifies TodoState into a single number — TODO_OFF (-1),
[0..TODO_SOFT_FULL] for soft, TODO_HARD (2) — eliminating the
separate todoBucketLevel field and preventing desync bugs.

Includes an interactive Storybook story (TodoBucket) for tuning feel.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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