mirror of
https://github.com/langgenius/dify.git
synced 2026-05-21 09:17:27 +08:00
2.2 KiB
2.2 KiB
Frontend Workflow
- Refer to the
./docs/test.mdand./docs/lint.mdfor detailed frontend workflow instructions. - For frontend coding tasks, also apply the repo-local
how-to-write-componentandtailwind-css-rulesskills when the change touches React components, state ownership, routing, styling, or Tailwind classes. - For frontend reviews, use the repo-local
frontend-code-reviewskill as the canonical checklist.
i18n
- User-facing strings must use
web/i18n/en-US/keys instead of hardcoded text. - When adding or renaming an i18n key, update all supported locale files with correct localized values; do not leave fallback English in non-English locales unless the repo already intentionally does so for that exact key.
Overlay Components (Mandatory)
../packages/dify-ui/README.mdis the permanent contract for overlay primitives, portals, rootisolation: isolate, and thez-50/z-60layering../docs/overlay.mdrecords the current web overlay best practices.- In new or modified code, use only overlay primitives from
@langgenius/dify-ui/*. - Do not introduce overlay imports from
@/app/components/base/*; when touching existing callers, migrate them.
SVG Icons (Mandatory)
- New custom SVG icons must be added under
../packages/iconify-collections/assets/.... - Run
pnpm --filter @dify/iconify-collections generateand consume generated icons with Tailwindi-custom-*classes. - Restart the web dev server after regenerating icons because Tailwind loads the custom icon collection at startup.
- Do not add new generated React icon components or JSON files under
app/components/base/icons/src/.... - See
../packages/iconify-collections/README.mdfor the full workflow.
Design Token Mapping
- When translating Figma designs to code, read
../packages/dify-ui/AGENTS.mdfor the Figma--radius/*token to Tailwindrounded-*class mapping. The two scales are offset by one step.
Automated Test Generation
- Use
./docs/test.mdas the canonical instruction set for generating frontend automated tests. - When proposing or saving tests, re-read that document and follow every requirement.
- All frontend tests MUST also comply with the
frontend-testingskill. Treat the skill as a mandatory constraint, not optional guidance.