Files
antd-admin/apps/with-lingui/.github/instructions/frontend.instructions.md
T
zuiidea c5221c71be feat(with-lingui): orders CRUD, shared hooks, auth refresh, and docs
- Add second sample resource (orders): API, schemas, MSW, routes, menu, Lingui, and E2E.

- Introduce useCrudToasts, useUrlSearchState, useTableFitHeight; extend useResourceCRUD with optimistic updates; add Vitest coverage for hooks and createHandler.

- Implement token refresh in http layer, RouteError, and new E2E specs (auth-refresh, rbac, url-state).

- Replace gen-resource codegen with English add-resource.instructions.md; fix Copilot instruction YAML in with-lingui and basic.

- Add with-lingui CI workflow, Cursor thin rules, optimization plan doc, and refresh README/AGENTS.

- Bump packages/create and lockfile where applicable.

Made-with: Cursor
2026-04-27 14:47:55 +08:00

1.3 KiB

applyTo, description
applyTo description
src/**/*.{ts,tsx,css} Use when editing React UI, route pages, components, styles, layout, i18n text, or Ant Design behavior. Keywords: frontend, component, page, ui, layout, style, antd, i18n.

Frontend Instructions

Purpose

Keep frontend changes predictable, minimal, and reusable for AI-assisted edits.

Do

  • Preserve existing route contracts and UI behavior unless explicitly asked.
  • Prefer reusable components and hooks over copy-paste logic.
  • Keep styles token-driven using existing theme/store patterns.
  • For Ant Design styling, follow this priority: component native API (variant/type/size/styles/classNames) -> theme.useToken() with inline style -> className + external CSS.
  • Keep translations compatible with Lingui macros and catalogs.
  • Follow current folder conventions under src/components and src/routes.

Do Not

  • Do not introduce new UI libraries when Ant Design already covers the need.
  • Do not bypass existing theme/store abstractions with hardcoded global state.
  • Do not write CSS overrides first when props or semantic styles can express the same UI.
  • Do not refactor unrelated files in the same change.

Validation

  • Run: pnpm exec vp check --no-fmt
  • For UI flow changes, run focused e2e where possible.