- แถบกรองสองชั้นในแถวเดียว: ทั้งหมด → 3 ประเภท │ ยอดนิยม → หมวดภาพยนตร์เดิม
- เก็บประเภทที่ฟิลด์เดี่ยว cinema.venue_type (ค่าเดียว) + hasVenue()/filterCinemas({ venue })
- ย้าย "กลุ่มคนฉายหนัง" จาก categories ขึ้นชั้น 1 (ไม่ให้ปุ่มซ้ำ) · tag ยังอยู่และยังค้นหาเจอ
- เลือกได้ทีละชั้น: กดประเภทล้างหมวด / กดหมวดล้างประเภท / ทั้งหมดล้างทั้งคู่
- ปิด popularity path เมื่อกรองด้วยประเภท (กันจัดอันดับข้ามประเภท)
- หลังบ้าน: ช่อง "ประเภทโรงหนัง" ในหมวดข้อมูลหลัก + sanitize เฉพาะค่าใน VENUE_TYPES
- i18n: messages.venues (TH/EN) · override ได้ผ่าน site.terms
- scripts/set-venue-types.mjs จัดประเภท 29 โรง (15 ท้องถิ่น / 11 อินดี้ / 3 กลุ่มคนฉายหนัง) พร้อมสำรอง content.json
- tests: hasVenue + filterCinemas (165 ผ่าน) · sw v2.0.5 · DESIGN/AGENTS/README/admin-guide/api อัปเดต
54 lines
7.6 KiB
Markdown
54 lines
7.6 KiB
Markdown
# App — Agent Guide
|
|
|
|
This starter ships as a blank Agent-Native app canvas — that describes its
|
|
initial state, not necessarily its current one. See `DEVELOPING.md` before
|
|
making any source code change.
|
|
|
|
## Skills
|
|
|
|
Search with `rg --hidden --follow`; read the exact linked guide before deeper work. `.agents/skills/build-an-app/SKILL.md` — start here for vague requests to create a domain app. `.agents/skills/adding-a-feature/SKILL.md` — cross-area feature checklist. Data/integrations: `.agents/skills/actions/SKILL.md`, `.agents/skills/storing-data/SKILL.md`, `.agents/skills/security/SKILL.md`, `.agents/skills/secrets/SKILL.md`, `.agents/skills/sharing/SKILL.md`. UI: `.agents/skills/frontend-design/SKILL.md`, `.agents/skills/shadcn-ui/SKILL.md`, `.agents/skills/client-side-routing/SKILL.md`. Agent context/workflows: `.agents/skills/context-awareness/SKILL.md`, `.agents/skills/real-time-sync/SKILL.md`, `.agents/skills/reliable-mutations/SKILL.md`, `.agents/skills/performance/SKILL.md`, `.agents/skills/delegate-to-agent/SKILL.md`. Framework: `.agents/skills/agent-native-docs/SKILL.md`, `.agents/skills/agent-native-toolkit/SKILL.md`, `.agents/skills/customizing-agent-native/SKILL.md`.
|
|
|
|
Use local docs only (no web research): `pnpm action docs-search --query "<topic>"`, `pnpm action docs-search --slug "<slug>"`, `pnpm action docs-search --list`, `pnpm action source-search --query "<pattern>"`, `pnpm action source-search --path <path>`, or `pnpm action source-search --list`. For external-agent integrations, read `pnpm action docs-search --slug "external-agents"`.
|
|
|
|
This repo is a single standalone app (`agent-native.scaffold.shape:
|
|
"standalone"`), not a workspace root. If the user asks for a workspace, a
|
|
platform or suite of apps, a second app, an app shell or launcher, or Dispatch,
|
|
read the `multi-app-workspace` skill before touching the repo layout.
|
|
|
|
## Core rules
|
|
|
|
- UI feedback: target 100 ms, never exceed 400 ms; acknowledge before network work.
|
|
- Normal app data must flow through actions. Keep actions deterministic and focused; use agent chat/AgentSidebar for AI work and follow-ups in the same thread. Keep structured state in SQL and large files in configured storage; persist references only.
|
|
- For external integrations, inspect the workspace/provider connection catalog first; reuse its scoped resolver. Never hardcode credentials, webhook URLs, or private/customer data.
|
|
- Never fabricate. Report failures and recover; verify writes by reading the row or screen. Navigation is in `<current-screen>`; use `view-screen` for fresh visible-record details.
|
|
- PWA: ห้ามลบ `<link rel="manifest">` ใน `app/root.tsx` · ทุกครั้งที่ปล่อยเวอร์ชันให้ bump `VERSION` ใน `public/sw.js` (ขั้น activate จะลบแคชเก่าให้เอง) · ไอคอนแอปเป็น PNG (`public/icon-192|512|maskable-512|180.png`) ไม่ใช่ SVG
|
|
|
|
For custom branding, keep `server/plugins/agent-native-email-branding.ts` aligned: `app.name` appears in transactional email and optional `app.logoUrl` must be an absolute HTTPS URL.
|
|
|
|
## Application state
|
|
|
|
- `navigation` describes the view and selected ids. The default home view is
|
|
`home` at `/` (blank app canvas). No agent rail or chat is mounted by
|
|
default; add one only when the user asks.
|
|
- Use `navigate` when supported and `view-screen` for a fresh read of visible details; basic navigation is already in `<current-screen>`.
|
|
|
|
## Building a domain app
|
|
|
|
Choose the primary workflow and route before editing. Build on the blank canvas in `app/routes/_index.tsx` or add domain routes under `app/routes/`. This starter has no Chat route, sidebar, header, or agent rail; add only the navigation the product needs. Set `app.homePath` in the existing `defineAppConfig` in `server/plugins/config.ts` as `DEVELOPING.md` describes.
|
|
|
|
Use `adding-a-feature` for functional parity and `frontend-design` for a user-facing screen. Keep feature guidance here and update `README.md` as `DEVELOPING.md` describes. After all edits, run one typecheck, one doctor check, and one browser smoke of the primary workflow and its authenticated landing. Skip production build and extra test suites.
|
|
|
|
Before building common workspace or agent UI, read `agent-native-toolkit`; for supported customization, read `customizing-agent-native`.
|
|
|
|
- Guarded verification: run `pnpm agent-native:doctor`; fix findings before done.
|
|
|
|
- แผนผังการทำงาน (Frontend / Backend / Data): `docs/architecture.html` — เอกสารประกอบ เปิดด้วยเบราว์เซอร์ ไม่ถูก build เข้าแอป; อัปเดตเมื่อโครง route/API/data เปลี่ยน
|
|
- SEO/AI: ข้อบังคับอยู่ใน `DESIGN.md` หัวข้อ "SEO และการป้องกัน AI" — **ห้ามฝังโดเมนในโค้ด**: canonical/OG/JSON-LD/sitemap/robots/ลิงก์แชร์มาจาก origin ของ request (`app/lib/request-origin.ts` + `resolvePageOrigin()`), ตัวสร้าง meta คือ `app/lib/seo.ts`, ไฟล์ crawler คือ `server/routes/sitemap.xml.ts` + `server/routes/robots.txt.ts` (Nitro route — ไม่ใช่ `public/`) + `public/ai.txt` · งาน cross-engine (Chromium/Firefox/Safari) ดูหัวข้อ "Cross-engine parity" ใน `DESIGN.md`
|
|
- คู่มือใช้งานหลังบ้าน (ภาษาไทย ทีละงาน): `docs/admin-guide.md` · API reference: `docs/api.md`
|
|
- Cross-engine parity: ทุกครั้งที่เพิ่ม CSS แบบ vendor-specific (`::-webkit-*`, `-webkit-mask-*`, `::-moz-*`) หรือสไตล์ของ native control ต้องใส่คู่ของอีกเอนจินในบล็อก "ความเท่ากันข้ามเอนจิน" (`app/global.css`, อยู่ใน `@layer base`) — **ตัวอนิเมชันห้ามผูกกับคลาส `fx-motion` อย่างเดียว** (เคยทำให้อนิเมชันหายทั้งเว็บ) · ข้อยกเว้นที่ตั้งใจปล่อยไว้ดูตารางใน `DESIGN.md`
|
|
- แถบกรองหน้าแรกมีสองชั้นในแถวเดียว: `totals → VENUE_TYPES (โรงภาพยนตร์ท้องถิ่น/อินดี้/กลุ่มคนฉายหนัง) → หมวด`
|
|
· ประเภทโรงหนังเก็บที่ `cinema.venue_type` (ค่าเดียว) ไม่ใช่ `tags` · ห้ามมีค่าซ้ำระหว่าง `VENUE_TYPES` กับ `CINEMA_CATEGORIES`
|
|
· เลือกได้ทีละชั้น (กดประเภท → ล้างหมวด, กดหมวด → ล้างประเภท) · ป้ายมาจาก `messages.venues` ห้าม hardcode
|
|
- เมื่อเพิ่ม/เปลี่ยนฟิลด์ใน `Cinema`, หมวดหมู่, หรือ flow ของหลังบ้าน → อัปเดต `DESIGN.md` + `docs/architecture.html` + `docs/admin-guide.md` พร้อมกัน (ห้ามปล่อยเอกสารตกรุ่น)
|
|
- ห้ามเขียนทับ `data/content/content.json` ด้วย seed: `readContent()` โยน error เมื่อไฟล์เสีย และสำรอง `.output/content.json.bakN` ก่อนแก้ด้วยสคริปต์
|