Stop range sliders from pushing an undo step on every input event
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, node.js
Research direction
Start in web/app.mjs at live() (lines 227–234), then inspect the slider handlers for Camera amount, Darken image, palette colours, Film grain and Vignette. Reuse one live() closure for each control across its input and change handlers, and apply the 80 entry cap there. Run npm test and npm run check; done when each control adds one undo entry per drag, one Ctrl+Z restores its starting value, and undo.length stays at or below 80.
Written by the indexing model from the issue text.
Description
live(mutate) is meant to take one undo snapshot per edit. It keeps a snap flag in its closure, and text fields create the closure once, so it works for them. The range sliders call live(...) inline inside their handlers instead:
oninput: e => live(v => { s.camera.amount = v; })(Number(e.target.value), false),
onchange: e => live(v => { s.camera.amount = v; })(Number(e.target.value), true)
Every input event creates a fresh closure with snap = false, so every event pushes a full JSON.stringify(sb) onto undo. One drag across the Camera amount slider leaves about 20 snapshots. Ctrl+Z then steps back one slider tick at a time.
live() also never trims the stack. commit() caps it at 80 entries, but this path grows undo without limit.
Task:
- create one
live(...)per slider and reuse it in both handlers, e.g. a smallrange(value, mutate, opts)helper next tonumber()andtext() - apply the same 80-entry cap inside
live()
The affected controls are Camera amount, Darken image, Film grain, Vignette and the four palette colour pickers.
Where: web/app.mjs:227-234 (live), web/app.mjs:300-301 (camera amount, darken), web/app.mjs:421 (palette colours), web/app.mjs:432-433 (grain, vignette).
Done when: one drag across the Camera amount slider adds exactly one entry to undo, and a single Ctrl+Z returns it to its starting value (same for Darken image, Film grain, Vignette and each palette colour picker); undo.length never goes above 80.
Getting started: Node 22, no npm install needed: git clone, npm start, open http://127.0.0.1:4520 in Chrome or Edge, and run npm test and npm run check before the PR. Comment here to claim it. Questions → Discord.
- Dominant language
- JavaScript
- Stars
- 42
- Forks
- 6
- Avg merge
- 12h 31m
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from blixvip/GenMotion
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
accessibility good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 91/100
All issues in blixvip/GenMotion
Similar issues
-
🐛 bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
LibreChat-AI/LibreChat#17887 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
liveshowy/webauthn_components#118 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
showdownjs/showdown#1113 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
dependents/node-precinct#167 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
volumio/volumio-plugins-sources-bookworm#279 · 1 comment ·
Maintainers usually reply within 1 day