From b5834976d2ec2e5870731b1d38b83a73ec9775b2 Mon Sep 17 00:00:00 2001 From: miteruzo Date: Wed, 3 Jun 2026 23:05:46 +0900 Subject: [PATCH] #90 --- AGENTS.md | 36 ++++ .../app/controllers/materials_controller.rb | 4 +- backend/app/controllers/posts_controller.rb | 6 +- backend/app/controllers/users_controller.rb | 2 +- .../app/controllers/wiki_pages_controller.rb | 2 +- frontend/src/components/PostEditForm.tsx | 63 +++---- frontend/src/components/PostFormTagsArea.tsx | 57 +++---- .../PostOriginalCreatedTimeField.tsx | 126 +++++++------- frontend/src/components/TagSearch.tsx | 6 +- frontend/src/components/common/FieldError.tsx | 7 +- frontend/src/components/common/FormField.tsx | 36 ++++ frontend/src/components/common/TagInput.tsx | 16 +- frontend/src/components/common/TextArea.tsx | 2 +- frontend/src/lib/useValidationErrors.ts | 28 ++++ .../deerjikists/DeerjikistDetailPage.tsx | 46 ++++-- .../pages/materials/MaterialDetailPage.tsx | 114 +++++++------ .../src/pages/materials/MaterialNewPage.tsx | 113 +++++++------ .../pages/materials/MaterialSearchPage.tsx | 28 ++-- frontend/src/pages/posts/PostNewPage.tsx | 156 ++++++++++-------- frontend/src/pages/posts/PostSearchPage.tsx | 112 +++++++------ frontend/src/pages/tags/NicoTagListPage.tsx | 45 +++-- frontend/src/pages/tags/TagDetailPage.tsx | 102 +++++++----- frontend/src/pages/tags/TagListPage.tsx | 126 +++++++------- .../src/pages/theatres/TheatreDetailPage.tsx | 16 +- frontend/src/pages/users/SettingPage.tsx | 27 ++- frontend/src/pages/wiki/WikiEditPage.tsx | 45 +++-- frontend/src/pages/wiki/WikiNewPage.tsx | 44 +++-- frontend/src/pages/wiki/WikiSearchPage.tsx | 31 ++-- 28 files changed, 854 insertions(+), 542 deletions(-) create mode 100644 frontend/src/components/common/FormField.tsx create mode 100644 frontend/src/lib/useValidationErrors.ts diff --git a/AGENTS.md b/AGENTS.md index 168db54..e4704c2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -122,6 +122,42 @@ Do not write or report `npm test` as a repository command unless a `test` script - Keep page-level code under `frontend/src/pages` and shared UI/feature code under `frontend/src/components` unless existing patterns point elsewhere. - Match existing Tailwind, component, and import alias conventions. +### Frontend TSX style + +- Preserve the local TSX formatting style. Do not normalize TSX to common Prettier-style React formatting unless explicitly asked. +- Prefer `const` arrow functions for TypeScript/TSX component and helper declarations. +- Put two blank lines before and after top-level `const` function declarations, unless imports, exports, or file boundaries make that awkward. +- In TSX, indent nested tag attributes with one tab relative to the tag line. With the project tab width, this visually appears as 4 spaces. +- Keep a tag's closing marker on the same line as the final prop when the tag spans multiple lines. Do not put `/>` or `>` on its own line unless the existing surrounding code does so. +- Keep JSX closing parentheses in the existing compact style, for example `)` rather than moving `)` onto a separate line. + +Preferred: + +```tsx +const PostFormTagsArea: FC = ({ tags, setTags, errors, ...rest }) => { + return ( +