Open-ends: JS no-undef guard (catches a docks crash bug) + colour-undo condition wait#3
Merged
Merged
Conversation
…it regressions)
docks.js referenced three names the #25 extraction from app.js never wired in
(found by the new JS no-undef guard):
- cycleBg — the ◧ "Cycle background" panel-header button called cycleBg("output")
directly, but it's exported from viewport.js and wasn't in scope → clicking it
threw ReferenceError. REAL crash.
- renderJobsPanel — guarded by `typeof ... === "function"`, so no crash, but it was
undefined in docks scope → the Jobs panel was silently skipped on every
renderPanels() refresh.
- processorRelevant — same typeof guard → silently fell back to `true`, so the
Processor panel was always treated as context-relevant (auto-shelving defeated).
All three are app-wired runtime deps, so inject them through the createDocks
factory like renderProcessorPanel/renderLibrary already are (app.js has all three
in scope at the call site). e2e stays 371/371.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The JS twin of tests/test_imports.py. node --check (already in CI) only checks syntax; this catches an identifier used but neither imported, declared, nor a browser global — the missing-import ReferenceError class the app.js/editor.js splits keep introducing (showContextMenu, and now cycleBg/renderJobsPanel/ processorRelevant). Runs eslint's no-undef over src/ via a pinned `npx eslint@8.57.1` so the repo stays build-free (no package.json / node_modules); tests/eslintrc.json holds the browser-module config + a modern-globals allowlist. Wired into ci.yml. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…sleep The two remaining long colour sleeps (360ms in pick_color, 320ms after the fill/stroke swap) outlasted app.js's 280ms debounce that commits the coalesced "Colour" undo entry (editor.commitCoalesce → clears editor._coalescing) before the panel closes. editor._coalescing is set true synchronously by the colour-apply, so settle(page, "()=>!editor._coalescing") waits for the real commit and can't return early and drop the entry. e2e still 371/371 (undo-coalesce checks pass). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Attacking the open ends after the audit merge. Two of four done; the JS guard is the win.
JS undefined-name guard (#36) — found a real crash bug
Mirrors the Python
tests/test_imports.pyfor the frontend: eslintno-undefoversrc/, run via a pinnednpx eslint@8.57.1so the repo stays build-free (no package.json/node_modules).node --check(already in CI) only checks syntax; this catches the missing-import ReferenceError class the app.js/editor.js splits keep introducing.On its first run it flagged 3 names in
docks.js(the #25 extraction), all unwired:cycleBg— the ◧ "Cycle background" header button called it directly but it wasn't imported → clicking it threw ReferenceError (real crash).renderJobsPanel—typeof-guarded, so the Jobs panel was silently skipped on everyrenderPanels()refresh.processorRelevant—typeof-guarded → always fell back totrue, defeating Processor auto-shelving.Fixed by injecting all three through the
createDocksfactory (likerenderProcessorPanel/renderLibrary). Wired the guard intoci.yml.Colour-undo coalesce → condition wait (#37)
Converted the last two long e2e sleeps (360/320ms) that outlasted app.js's 280ms coalesce-commit debounce to
settle(page, "()=>!editor._coalescing")— a self-verifying signal that can't drop the undo entry.Not done (deliberate)
main()for marginal benefit (faster--only); not worth risking the green suite — left for a focused effort.Verified: e2e 371/371, test_imports/smoke/capabilities green, eslint guard clean.