A web app's scripts in src/ don't count as UI, so changing them gets no Visual check #320

Closed
opened 2026-10-29 21:51:21 -04:00 by cmoriarty · 1 comment
Owner

What happens
The fix loop runs the Visual check only when a UI file changed (conditions.is_ui_path). That means .html, .css, .tsx, .jsx and the like anywhere, but .js and .ts only under ui/, web/, frontend/ or client/. Braid's own planned projects build plain-JavaScript web apps with their code in src/: the Breakout game draws everything from src/render.js. A fix run that changes only src/render.js or src/main.js, such as the colours or the controls, gets no Visual check. Seen 2026-10-29 setting up #269's seeded faults.

Fix
Count a script as UI when the project is a web app whose page loads it: a .js/.ts file under the folder an index.html script tag points into, or any script in a project whose index.html sits at the root. Keep a Node service's src/ out.

Done when
A fix run on a Vite plain-JavaScript game that changes only src/render.js gets a Visual check; one that changes a Node service's src/server.js does not. Tests cover both.

**What happens** The fix loop runs the Visual check only when a UI file changed (`conditions.is_ui_path`). That means `.html`, `.css`, `.tsx`, `.jsx` and the like anywhere, but `.js` and `.ts` only under `ui/`, `web/`, `frontend/` or `client/`. Braid's own planned projects build plain-JavaScript web apps with their code in `src/`: the Breakout game draws everything from `src/render.js`. A fix run that changes only `src/render.js` or `src/main.js`, such as the colours or the controls, gets no Visual check. Seen 2026-10-29 setting up #269's seeded faults. **Fix** Count a script as UI when the project is a web app whose page loads it: a `.js`/`.ts` file under the folder an `index.html` script tag points into, or any script in a project whose `index.html` sits at the root. Keep a Node service's `src/` out. **Done when** A fix run on a Vite plain-JavaScript game that changes only `src/render.js` gets a Visual check; one that changes a Node service's `src/server.js` does not. Tests cover both.
Author
Owner

Shipped in PR #356 (c00c62f1, live on production).

  • The fix: a .js/.mjs/.ts file counts as UI when it sits under a folder that a root index.html's script tags load from, or directly in the root when the page loads from there.
  • Tests (tests/engine/test_page_scripts_are_ui.py, real git):
    • a Vite game that changes only src/render.js gets a Visual check; this fails without the fix;
    • a Node service's src/server.js does not.
**Shipped** in PR #356 (c00c62f1, live on production). - **The fix:** a `.js`/`.mjs`/`.ts` file counts as UI when it sits under a folder that a root `index.html`'s script tags load from, or directly in the root when the page loads from there. - **Tests** (`tests/engine/test_page_scripts_are_ui.py`, real git): - a Vite game that changes only `src/render.js` gets a Visual check; this fails without the fix; - a Node service's `src/server.js` does not.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/braid#320
No description provided.