Skip to content

UI improvement#13

Merged
iPazooki merged 4 commits intomainfrom
ui-improvement
Apr 12, 2026
Merged

UI improvement#13
iPazooki merged 4 commits intomainfrom
ui-improvement

Conversation

@iPazooki
Copy link
Copy Markdown
Owner

@iPazooki iPazooki commented Apr 8, 2026

No description provided.

Mo Pazooki and others added 3 commits April 7, 2026 07:21
…s 16 conventions

- Extract getAuthOptions to shared lib/auth/auth-options.ts (Dependency Inversion)
- Convert book detail/edit [id] pages to Server Components with async params (Next.js 16)
- Extract useBookMutation hook from BookForm (Single Responsibility)
- Memoize LanguageContext and SidebarContext values with useMemo/useCallback
- Fix LanguageContext setState-in-effect lint error with lazy state initializer
- Add loading.tsx and error.tsx boundaries for book route segment
- Fix hardcoded TailAdmin branding in not-found.tsx
- Stabilize useGoBack hook with useCallback
- Improve copilot-instructions.md with deeper codebase conventions

Co-authored-by: Copilot <[email protected]>
- Replaced hardcoded English validation messages in `bookSchema` with translation keys.
- Updated `BookForm` and `book/error.tsx` to dynamically translate error messages using the `useLanguage` hook.
- Added new translation keys for validation errors, demographics description, and generic error states across English, Arabic, and Persian locale files (`en.json`, `ar.json`, `fa.json`).
- Applied a minor formatting adjustment to `AppSidebar.tsx`.
…t hydration

- Integrated the `useLanguage` hook into `NotificationDropdown` to replace hardcoded text with localized string keys.
- Added corresponding translation keys (`notification`, `requests_permission_to_change`, `project`, `min_ago`, `hr_ago`, `view_all_notifications`, etc.) to English, Arabic, and Persian locale files.
- Resolved a Next.js SSR hydration mismatch in `LanguageContext` by initializing state with the default locale and retrieving the saved locale from `localStorage` within a `useEffect` hook.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4253182477

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Introduce multi-language localization and refine error handling

- Added Persian (`fa`) and Arabic (`ar`) resource files for `BookErrors` in the Domain layer.
- Configured request localization middleware in the API project (`Program.cs`) to support English, Persian, and Arabic cultures.
- Converted static readonly fields in `BookErrors.cs` to expression-bodied properties to allow dynamic evaluation of localized resources per request.
- Updated the frontend fetch utility (`orval-fetch.ts`) to automatically inject the `Accept-Language` header based on the user's active locale.
- Enhanced the frontend error handler (`error-handler.ts`) to attempt JSON parsing for `ProblemDetails` when API errors are returned as raw strings.
@iPazooki iPazooki merged commit 57d5004 into main Apr 12, 2026
2 checks passed
@iPazooki iPazooki deleted the ui-improvement branch April 12, 2026 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant