Skip to content

Don't save a number typed on the way to a wrong one - #295

Merged
PhilReinking merged 2 commits into
mainfrom
fix/bits-351-number-save-on-the-way
Oct 17, 2026
Merged

PhilReinking merged 2 commits into
mainfrom
fix/bits-351-number-save-on-the-way

Conversation

@PhilReinking

Copy link
Copy Markdown
Contributor

Typing 2.5 into "Max characters" over 500 saved the 2 typed on the way, and 11 in "Height in lines" saved 1. The step's save waited for its debounce and went out after the next keys were refused. Now a number that turns wrong puts its option back into the waiting save, so the stored value stays.

Fixes BITS-351

  • The workbench store keeps each answer as last sent while its changes wait. Only the long text settings use it; other settings save as before.
  • The waiting save sends the stored value again (one request), so Saving… then Saved stays true.
  • Other changes in the same waiting save, like a height changed just before, still go out.

Tested: Vitest types key by key through the real store and debounce; 3 of the 5 new tests fail without the fix. Lint and vue-tsc pass.

Browser, counting saves on my own server: main saves 2 and 1; this branch saves only 500 and 5, and 10 and 800 still save.

Not tested: Firefox and Safari (checked in Brave).

Known gap: an owner who rests over 1 second on 2 before typing .5 saves the 2, like any number they pause on.

🤖 Generated with Claude Code

PhilReinking and others added 2 commits October 17, 2026 19:40
Typing 2.5 into Max characters saved the 2 typed on the way: the save
for 2 waited for its debounce, and 2. and 2.5 were refused, so the 2
went out. The same for 11 in Height in lines, which saved 1.

The workbench store now keeps the answer as it was sent before the
changes that wait for their debounce. When a number turns wrong, the
long text settings ask the store to put that option back, so the
waiting save sends the stored value. Other changes in the same waiting
save still go out.

Part of BITS-351

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@PhilReinking PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK at 9694c62, CI green. Vitest 548, lint, vue-tsc clean; 3 new tests fail on main's code. Brave, key by key: 2.5 keeps 500, 11 keeps 5, both with the message; 10 and 800 save, ending Saved; -5, 0, -1 send nothing. Held: a slow save in flight, a failed save, a height change just before, a block switch, leaving the page. Scale settings save as before. A pause over 1 s on 2 still saves the 2.

@PhilReinking
PhilReinking merged commit a4a43f0 into main Oct 17, 2026
6 checks passed
@PhilReinking
PhilReinking deleted the fix/bits-351-number-save-on-the-way branch October 17, 2026 18:06
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