Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ jobs:
cp "$f" "$f.mjs" && node --check "$f.mjs" && rm "$f.mjs"
done

# JS twin of the Python import guard: no-undef 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 (docks.js's showContextMenu + cycleBg). node
# --check (above) only checks syntax. Pinned eslint via npx keeps the repo build-free
# (no package.json / node_modules). ESLINT_USE_FLAT_CONFIG=false → use the legacy -c config.
- name: JS undefined-name guard (no-undef across src/)
run: ESLINT_USE_FLAT_CONFIG=false npx --yes eslint@8.57.1 --no-eslintrc -c tests/eslintrc.json --ext .js src/

- name: Check Python sources parse
run: |
python3 - <<'PY'
Expand Down
2 changes: 1 addition & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ function buildRasterTools(node) {
// Collapsible rail sections (Photopea/Illustrator-style accordion), persisted. Shared so
// dynamically-built panels (Properties, Colour) get a working caret too.
// ---- Dockable panels + collapse carets + shelf + bezel groups (extracted → src/ui/docks.js) ----
window.__docks = createDocks({ editor, measureFit, viewports, renderProcessorPanel, renderLibrary });
window.__docks = createDocks({ editor, measureFit, viewports, renderProcessorPanel, renderLibrary, renderJobsPanel, processorRelevant, cycleBg });

// ---- Keep-alive: let the server self-spin-down when this window closes ----
// The server is the program's compute half; while a window is open it should
Expand Down
2 changes: 1 addition & 1 deletion src/ui/docks.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// the control object is published, exactly as before).
import { showContextMenu } from "./menus.js"; // shelf-square right-click options menu

export function createDocks({ editor, measureFit, viewports, renderProcessorPanel, renderLibrary }) {
export function createDocks({ editor, measureFit, viewports, renderProcessorPanel, renderLibrary, renderJobsPanel, processorRelevant, cycleBg }) {
function wireSectionCollapse(section) {
const head = section.querySelector(".section-head"); if (!head || head._collapseWired) return;
head._collapseWired = true;
Expand Down
8 changes: 6 additions & 2 deletions tests/e2e/editor_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ def pick_color(page, swatch_index, hexes=None, none=False):
el.value = v; el.dispatchEvent(new Event('input', { bubbles: true })); }""", h)
if none:
page.click(".cp-window .cp-none")
page.wait_for_timeout(360) # let the coalesced "Colour" undo entry commit (debounce)
# wait for the coalesced "Colour" undo entry to actually commit (app.js debounces
# editor.commitCoalesce ~280ms after the last edit, clearing editor._coalescing) before
# closing — a condition, not a fixed 360ms. _coalescing is set true synchronously by the
# colour-apply, so this can't return early mid-coalesce and drop the entry.
settle(page, "() => !editor._coalescing")
page.evaluate("window.__docks && window.__docks.close('color')")
page.wait_for_timeout(40)

Expand Down Expand Up @@ -436,7 +440,7 @@ def main():
swapped = page.evaluate("""() => ({ fill: editor.nodeById('r1').getAttribute('fill'),
stroke: editor.nodeById('r1').getAttribute('stroke') })""")
check("Shift+X swaps fill/stroke", swapped["fill"] == "#def456" and swapped["stroke"] == "#abc123", f"{swapped}")
page.wait_for_timeout(320); page.evaluate("window.__docks.close('color')"); page.wait_for_timeout(40)
settle(page, "() => !editor._coalescing"); page.evaluate("window.__docks.close('color')"); page.wait_for_timeout(40) # commit the coalesced undo (condition, not 320ms) before closing

# inspector: stroke width (the v0 'stroke not applied' regression). Addressed by
# row label now that Transform (X/Y/W/H) leads the object panel.
Expand Down
13 changes: 13 additions & 0 deletions tests/eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"parserOptions": { "ecmaVersion": 2022, "sourceType": "module" },
"env": { "browser": true, "es2022": true, "worker": true },
"globals": {
"structuredClone": "readonly", "queueMicrotask": "readonly", "reportError": "readonly",
"requestIdleCallback": "readonly", "cancelIdleCallback": "readonly",
"ResizeObserver": "readonly", "IntersectionObserver": "readonly", "MutationObserver": "readonly",
"DOMParser": "readonly", "XMLSerializer": "readonly",
"DOMPoint": "readonly", "DOMMatrix": "readonly", "DOMRect": "readonly",
"Path2D": "readonly", "OffscreenCanvas": "readonly", "createImageBitmap": "readonly"
},
"rules": { "no-undef": "error" }
}
Loading