Instruction file imported from thanapat2402/bill-splitter (
.github/instructions/frontend.instructions.md). Copyright stays with the author.
Frontend File Instructions
- Keep the app plain HTML, CSS, and browser JavaScript. Do not introduce frameworks, bundlers, or package-managed frontend dependencies unless the user explicitly asks.
- Preserve Thai-first labels, alerts, and confirmation copy unless the task is specifically about wording.
- Keep logic in the owning controller: composition in ../../AGENTS.md, browser orchestration in ../../script.js, pure calculations in ../../trip-logic.js, rendering in ../../trip-ui.js, form drafting in ../../expense-form.js, committed mutations in ../../trip-actions.js, shell behavior in ../../app-shell.js, and sharing/sync in ../../share-flow.js.
- Prefer cached DOM references and central event binding over scattered queries or listeners.
- Route committed-state refreshes through
updateUI(). When editing sub-expense drafts, preferupdateExpenseTotal()for local draft recalculation. - If you add or rename a top-level script or asset referenced by ../../index.html, update ../workflows/deploy-pages.yml in the same change.
- Validate edited UI flows on the local static page first, then use ../skills/frontend-static/SKILL.md or ../skills/deploy-check/SKILL.md when deploy behavior is involved.