Skip to content

feat: general requirements (user-friendly error display) - #62

Merged
AlyaEngineer merged 16 commits into
developfrom
feature/7-general-requirements
Jul 8, 2026
Merged

feat: general requirements (user-friendly error display)#62
AlyaEngineer merged 16 commits into
developfrom
feature/7-general-requirements

Conversation

@AlyaEngineer

@AlyaEngineer AlyaEngineer commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

Implements User-friendly error display from Feature 7 (General Requirements). Language switching and sticky header items also originated in this branch but were finalized in feature/1-app-header (already pending merge to develop) - so this PR effectively only brings in error handling.

Changes Made

  • Added user-friendly error display (toast and application-level errors)
  • Commit language switching (feat: language switching #53) will resolve in favor of feature/1-app-header

Related issue

Closes #10

Feature

Feature 7: General Requirements

Acceptance criteria

Feature 1: App Header
  • Non-auth users see Sign In / Sign Up in header (upper right) — 15
  • Auth users see History / Sign Out in header — 10
  • About link in header and footer — 10
  • Expired/invalid token → redirect from private routes to Main — 10
  • Sign In / Sign Up buttons redirect to respective form route — 15
Feature 2: Sign In / Sign Up
  • Sign In / Sign Up / Sign Out buttons present everywhere they should be — 10
  • Client-side validation (email, password: 8+ chars, letter+digit+special, Unicode) — 20
  • Successful login → redirect to Main — 10
  • Logged-in user on Sign In / Sign Up routes → redirect to Main — 10
Feature 3: Swagger Editor
  • Load/paste schema in JSON and YAML — 25
  • Auto-detect input format (JSON vs YAML) — 20
  • Format switch with JSON ↔ YAML conversion, no data loss — 20
  • Schema validation with error indication — 15
  • Auth users save schema; restored on next login — 10
  • Viewer auto-populates with endpoints on valid schema — 10
  • Responsive split view (horizontal/vertical by orientation) — 20
Feature 4: Swagger Viewer
  • Endpoint list organized by path/method — 20
  • Details: method, path, all param types (path/query/header/cookie) — 25
  • Request schema and example payloads displayed — 20
  • Response schema, examples, all status codes displayed — 25
  • Try-It-Out: fill params/headers/body, execute, show response — 20
  • Generate cURL + copy-to-clipboard — 10
Feature 5: History and Analytics
  • SSR-generated; empty state with links to editor/viewer — 15
  • Requests sorted by timestamp (most recent first) — 10
  • Server-side analytics: duration, status, timestamp, method, request size, response size, error details, endpoint/URL — 45
Feature 6: About Page
  • Public route, accessible to all — 5
  • Info about RS School course — 5
  • Team info (names, roles, GitHub links) — 10
  • Design consistent with the app — 5
Feature 7: General Requirements
  • i18n: 2+ languages with toggler in header — 30
  • Sticky header with animation on stick — 10
  • User-friendly error display — 10
  • Private routes protected (401 if not authenticated) — 5
Feature 8: YouTube Video
  • 5–7 min YouTube walkthrough linked, covers all criteria — 50

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would break existing functionality)
  • Documentation update

Checklist

  • Self-review done
  • No console errors / warnings / logs
  • No any / @ts-ignore
  • Tests added / updated and passing

How to test

  1. error.tsx
    Add TriggerErrorButton component to the project and import it in src/app/[locale]/page.tsx. Clicking the button throws an error, which triggers the nearest error.tsx UI
/// src/components/trigger-error-button/trigger-error-button.tsx

'use client';

import { Button } from '@mui/material';
import { useState } from 'react';

export function TriggerErrorButton() {
  const [shouldThrow, setShouldThrow] = useState(false);

  if (shouldThrow) {
    throw new Error('Test error for error.tsx boundary');
  }

  return (
    <Button color="error" onClick={() => setShouldThrow(true)} variant="outlined">
      Trigger Error via error.tsx
    </Button>
  );
}
  1. global-error.tsx
    Add .env.local to the project root with the variable NEXT_PUBLIC_TEST_GLOBAL_ERROR=true. Then add a conditional throw in the body of RootLayout (src/app/[locale]/layout.tsx):
///  src/app/[locale]/layout.tsx

export default async function RootLayout({ children, params }: Props) {
    const { locale } = await params;

    if (process.env.NEXT_PUBLIC_TEST_GLOBAL_ERROR === 'true') {
        throw new Error('Test error for global-error.tsx boundary');
    }

    return (
        <html lang={locale}>
           <body>
               {....}
            </body>
       </html>
    );
}

Restart the dev server (Next.js only reads .env.local on startup). The app should fail to render entirely and fall back to global-error.tsx (unstyled, since theme and i18n providers are unavailable at this level by Next.js design).

  1. ToastProvider
    Temporary component TriggerToastButton (src/components/trigger-toast-button/trigger-toast-button.tsx) lets you pick a severity and trigger a toast via useToast(). Add temporarily to any page (e.g. the main page).
'use client';

const SEVERITIES: ToastType[] = ['success', 'error'];

export function TriggerToastButton() {
  const showToast = useToast();
  const [severity, setSeverity] = useState<ToastType>('success');
  return (
    <Stack direction="row" spacing={1}>
      <TextField
        label="Severity"
        onChange={(event) => setSeverity(event.target.value as ToastType)}
        select
        size="small"
        value={severity}
      >
        {SEVERITIES.map((item) => (
          <MenuItem key={item} value={item}>
            {item}
          </MenuItem>
        ))}
      </TextField>
      <Button onClick={() => showToast(`Test toast (${severity})`, severity)} variant="outlined">
        Trigger Toast
      </Button>
    </Stack>
  );
}

Screenshots

globai-error.tsx

Снимок экрана 2026-07-08 090415 Снимок экрана 2026-07-08 100035

error.tsx with i18n

Снимок экрана 2026-07-08 085146

success toast

Снимок экрана 2026-07-08 085138

error toast

Снимок экрана 2026-07-08 085129

Summary by CodeRabbit

Summary

  • New Features
    • Added localized error handling pages with “Try again” retry actions.
    • Introduced bottom-right success/error toasts via a global provider.
    • Updated the app layout to consistently include the header and footer.
    • Added Russian translations and expanded English error/toaster message text.
  • Bug Fixes
    • Toast dismiss actions now ignore click-away events; error views log issues and support retry.
  • Tests
    • Added unit/integration tests for error pages and toast components/provider.
  • Chores
    • Updated dependency and tooling versions.

YuliaDemir and others added 2 commits June 30, 2026 16:07
* feat: install next+ts+linter+prettier+ husky+redux

* feat: configs + perfectionist + lint fix

* feat: install scss

* refactor: add some folders

* feat: install i18n + basic configs

* feat: add internatiolisation

* feat: language switcher

* feat: dependencies update

* fix: delete scss + delete unnecessary files

* fix: delete unnecessary layout
* feat: add error page component

* test: add tests for error page component

* feat: add global error page component

* test: add tests for global error page component

* feat: implement toast provider and toast component

* test: add tests for toast provider and toast component

* feat: add toaster messages dictionary

* chore: add coderabbit config

* fix: fix .coderabbit.yaml instruction

* fix: add target branches for review to instructions

* fix: move console.error into useEffect

* fix: ignore clickaway on close

* test: add test for onClose on clickaway

* fix: memoize showToast and context value with useCallback/useMemo
@AlyaEngineer
AlyaEngineer requested a review from lexarudak July 6, 2026 12:17
@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
swagger-editor-app Ready Ready Preview, Comment Jul 8, 2026 10:53am

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7cb87f67-2709-48b9-8283-c7f3dd775847

📥 Commits

Reviewing files that changed from the base of the PR and between 6154a44 and 53b41d3.

📒 Files selected for processing (2)
  • src/app/[locale]/layout.tsx
  • src/components/header/header.tsx
✅ Files skipped from review due to trivial changes (1)
  • src/components/header/header.tsx

📝 Walkthrough

Walkthrough

This PR adds locale and global error pages, a toast notification provider and component, a sticky header with layout wiring, expanded English/Russian messages, and updated app dependencies and tooling.

Changes

User-friendly errors and supporting UI/i18n

Layer / File(s) Summary
Error boundary pages and ErrorCard
src/components/error-card/error-card.tsx, src/app/[locale]/error.tsx, src/app/[locale]/error.test.tsx, src/app/global-error.tsx, src/app/global-error.test.tsx
Adds ErrorCard, a locale-scoped ErrorPage, and a GlobalError page that log errors and render retry UI, with tests for rendering, retry, and console logging.
Toast provider
src/providers/toast-provider/types.ts, src/providers/toast-provider/Toast.tsx, src/providers/toast-provider/Toast.test.tsx, src/providers/toast-provider/ToastProvider.tsx, src/providers/toast-provider/ToastProvider.test.tsx, src/providers/mui-provider.tsx
Adds ToastType, a MUI Toast snackbar/alert, a ToastProvider with showToast and useToast, and provider-level wiring plus tests.
Header and root layout wiring
src/components/index.ts, src/app/[locale]/layout.tsx, src/app/[locale]/page.tsx, src/components/header/header.tsx
Adds Footer export, wraps the locale layout with header/footer, and removes those elements from the home page while updating the header border styling.
i18n messages
src/i18n/messages/en.json, src/i18n/messages/ru.json
Adds errorPage and toaster strings to English and introduces a full Russian message file.
Dependency and tooling updates
package.json
Adds emotion/MUI and next-intl, bumps React packages, and upgrades dev tooling versions.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant App
  participant ErrorPage
  participant GlobalError
  participant ErrorCard
  participant unstable_retry

  App->>ErrorPage: render locale error
  App->>GlobalError: render fatal error
  ErrorPage->>ErrorCard: title, description, retry button text
  GlobalError->>ErrorCard: title, description, button text
  ErrorCard->>unstable_retry: retry click
Loading
sequenceDiagram
  participant Component
  participant useToast
  participant ToastProvider
  participant Toast

  Component->>useToast: showToast(message, severity)
  useToast->>ToastProvider: update provider state
  ToastProvider->>Toast: render Snackbar + Alert
  Toast-->>Component: close or auto-hide
Loading

Possibly related PRs

Suggested reviewers: Ivan-khodorov, lexarudak

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The header/footer/layout refactor and related message changes appear unrelated to the error-display requirement. Move the header/footer/layout and other unrelated UI changes into a separate PR so this one stays focused on error handling.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the main change: user-friendly error display.
Linked Issues check ✅ Passed The PR adds app and global error UIs plus a toast system with i18n and severity types, matching #10.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/7-general-requirements

Comment @coderabbitai help to get the list of available commands.

@AlyaEngineer AlyaEngineer added the feature-7-general Feature 7: General Requirements label Jul 7, 2026
@AlyaEngineer
AlyaEngineer marked this pull request as ready for review July 7, 2026 01:10

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (6)
src/providers/toast-provider/ToastProvider.tsx (1)

21-49: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Consecutive showToast calls will abruptly swap content instead of properly transitioning.

The provider holds a single toast state object with open staying true across successive showToast calls (e.g., a "save failed" toast quickly followed by a "sign-out succeeded" toast, both mentioned in the linked issue's use cases). Since open never toggles to false in between, the Snackbar/Alert won't exit/re-enter — the message and severity just swap in place without giving the user a chance to notice the first toast, and MUI's own autoHideDuration timer handling for such "stacked" invocations is not guaranteed to reset cleanly.

MUI's official Snackbar docs recommend a queuing approach: close the current snackbar first, then set the next message once onExited fires (or track a queue and only update the visible message when the previous one has exited).

♻️ Suggested consecutive-snackbar pattern (per MUI docs)
-  const showToast = useCallback((message: string, severity: ToastType = 'success') => {
-    setToast({ message, open: true, severity });
-  }, []);
+  const [queue, setQueue] = useState<ToastState[]>([]);
+
+  const showToast = useCallback((message: string, severity: ToastType = 'success') => {
+    setQueue((prev) => [...prev, { message, open: true, severity }]);
+  }, []);
+
+  useEffect(() => {
+    if (queue.length && !toast.open) {
+      setToast(queue[0]);
+      setQueue((prev) => prev.slice(1));
+    } else if (queue.length && toast.open) {
+      setToast((prev) => ({ ...prev, open: false }));
+    }
+  }, [queue, toast.open]);

This is only a real problem if the app can trigger back-to-back toasts (likely, given the many toast triggers listed in the issue). Given the multiple simultaneous non-critical error/success scenarios described in the PR (save failures, sign-in/out, history load errors, cURL copy), consecutive toasts seem plausible.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/providers/toast-provider/ToastProvider.tsx` around lines 21 - 49, The
ToastProvider currently overwrites a single visible toast in place, so
consecutive showToast calls skip the exit/enter transition and can confuse MUI
Snackbar timing. Update ToastProvider to queue or stage toasts instead of
replacing toast state immediately: when showToast is called while a toast is
open, close the current Toast first and only apply the next message/severity
after the previous one has fully exited (using Toast’s onExited or equivalent).
Keep the fix centered around the showToast, handleClose, and
ToastContext.Provider flow so back-to-back notifications transition cleanly.
src/i18n/messages/en.json (1)

38-38: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove leftover debug key.

"check": "check english" at the root isn't part of any namespace used by generateMetadata, Header, HomePage, errorPage, or toaster. Looks like a leftover debug/test artifact.

🧹 Proposed removal
     "historyLoadError": "Failed to load request history"
-  },
-  "check": "check english"
+  }
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/i18n/messages/en.json` at line 38, Remove the leftover debug translation
entry from the root of the English messages file. The key "check" is not used by
generateMetadata, Header, HomePage, errorPage, or toaster, so delete it from the
messages object and keep only the namespace keys that are actually consumed by
the app.
src/app/[locale]/layout.tsx (1)

33-48: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Consider validating locale before use.

locale from params isn't checked against routing.locales. next-intl's setup guide recommends guarding with hasLocale + notFound() in the locale layout, since [locale] is a catch-all segment.

🛡️ Proposed guard
+import { hasLocale } from 'next-intl';
+import { notFound } from 'next/navigation';
+
+import { routing } from '`@/i18n/routing`';
+
 export default async function RootLayout({ children, params }: Props) {
   const { locale } = await params;
+
+  if (!hasLocale(routing.locales, locale)) {
+    notFound();
+  }
 
   return (
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/app/`[locale]/layout.tsx around lines 33 - 48, The RootLayout in
next-intl locale handling uses params.locale directly without validating it, so
add a locale guard before rendering. In RootLayout, check the awaited locale
against routing.locales with hasLocale and call notFound() for invalid values,
then continue rendering with the validated locale passed into
NextIntlClientProvider and html lang.
src/components/language-switcher/language-switcher.tsx (2)

18-24: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Consider wrapping the locale switch in a transition for pending UI feedback.

Other next-intl locale-switcher implementations wrap router.replace in startTransition so the UI can show a pending state while the new locale's segment loads. Not required, but improves perceived responsiveness on slower navigations.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/language-switcher/language-switcher.tsx` around lines 18 - 24,
The locale switch handler in handleChange currently calls router.replace
directly, so the UI cannot reflect a pending navigation state. Update the
language-switcher component to wrap the locale change in startTransition around
router.replace, and use the transition state to support pending feedback while
the new locale loads.

27-46: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Select is missing an accessible name.

The Select has no InputLabel/labelId pairing and no aria-label, so screen reader users get no context that this control switches the site language.

♿ Proposed fix
       <Select
         className={styles.select}
+        inputProps={{ 'aria-label': 'Select language' }}
         MenuProps={{

Per MUI's docs, "Select always needs an accessible name," obtainable via an associated label or aria-label on inputProps.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/language-switcher/language-switcher.tsx` around lines 27 - 46,
The Select in language-switcher.tsx is missing an accessible name, so update the
language switcher control to provide one by either adding an InputLabel/labelId
pairing or setting an aria-label on the Select. Keep the change within the
LanguageSwitcher component and ensure the existing Select, FormControl, and
MenuItem structure still works with the new accessible naming.
src/app/global-error.tsx (1)

47-55: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Fallback error text is hardcoded (not localized).

Unlike the locale error.tsx, this component doesn't use next-intl translations. This is likely intentional/necessary since global-error.tsx replaces the root layout and loses access to context providers set up there, but it does mean non-English users see English text on the rare occasion this boundary triggers.

If localizing this fallback is desired, next-intl docs note global-error can still be used with i18n, though it requires wiring up its own message loading independent of the removed root layout.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/app/global-error.tsx` around lines 47 - 55, The fallback UI in
globalError is hardcoded in English, unlike the localized error screen
elsewhere. If localization is desired, update the GlobalError component to load
messages independently of the root layout and use next-intl translations for the
heading, body, and retry label; otherwise keep the current behavior as an
intentional non-localized fallback.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 37-38: The React package versions are duplicated across manifest
sections and currently conflict, so npm may resolve the older devDependencies
pin instead of the intended one. Update the package.json entries for react and
react-dom so the versions match exactly in both dependencies and
devDependencies, or remove the duplicate devDependencies entries entirely,
keeping the manifest consistent.

In `@src/app/`[locale]/page.tsx:
- Around line 6-11: The home page is still rendering the leftover debug
translation key instead of the real HomePage copy. Update the page component in
the default locale route to use the existing HomePage.title and
HomePage.description translations from getTranslations() rather than t('check'),
and ensure the rendered markup reflects the HomePage section instead of the
placeholder string.

In `@src/i18n/messages/ru.json`:
- Line 38: Remove the leftover debug translation entry from the ru messages
file: the standalone "check" key with the test string is not a real UI message.
Update the Messages object in messages/ru.json to keep only the intended
HomePage-related keys, and ensure any code using this translation continues to
reference the existing HomePage message symbols rather than the debug key.

---

Nitpick comments:
In `@src/app/`[locale]/layout.tsx:
- Around line 33-48: The RootLayout in next-intl locale handling uses
params.locale directly without validating it, so add a locale guard before
rendering. In RootLayout, check the awaited locale against routing.locales with
hasLocale and call notFound() for invalid values, then continue rendering with
the validated locale passed into NextIntlClientProvider and html lang.

In `@src/app/global-error.tsx`:
- Around line 47-55: The fallback UI in globalError is hardcoded in English,
unlike the localized error screen elsewhere. If localization is desired, update
the GlobalError component to load messages independently of the root layout and
use next-intl translations for the heading, body, and retry label; otherwise
keep the current behavior as an intentional non-localized fallback.

In `@src/components/language-switcher/language-switcher.tsx`:
- Around line 18-24: The locale switch handler in handleChange currently calls
router.replace directly, so the UI cannot reflect a pending navigation state.
Update the language-switcher component to wrap the locale change in
startTransition around router.replace, and use the transition state to support
pending feedback while the new locale loads.
- Around line 27-46: The Select in language-switcher.tsx is missing an
accessible name, so update the language switcher control to provide one by
either adding an InputLabel/labelId pairing or setting an aria-label on the
Select. Keep the change within the LanguageSwitcher component and ensure the
existing Select, FormControl, and MenuItem structure still works with the new
accessible naming.

In `@src/i18n/messages/en.json`:
- Line 38: Remove the leftover debug translation entry from the root of the
English messages file. The key "check" is not used by generateMetadata, Header,
HomePage, errorPage, or toaster, so delete it from the messages object and keep
only the namespace keys that are actually consumed by the app.

In `@src/providers/toast-provider/ToastProvider.tsx`:
- Around line 21-49: The ToastProvider currently overwrites a single visible
toast in place, so consecutive showToast calls skip the exit/enter transition
and can confuse MUI Snackbar timing. Update ToastProvider to queue or stage
toasts instead of replacing toast state immediately: when showToast is called
while a toast is open, close the current Toast first and only apply the next
message/severity after the previous one has fully exited (using Toast’s onExited
or equivalent). Keep the fix centered around the showToast, handleClose, and
ToastContext.Provider flow so back-to-back notifications transition cleanly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 671edccb-b96f-4e63-b5fa-52f4038b55d9

📥 Commits

Reviewing files that changed from the base of the PR and between 21cef07 and 2b74ed5.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (29)
  • .coderabbit.yaml
  • AGENTS.md
  • CLAUDE.md
  • next.config.ts
  • package.json
  • src/app/[locale]/error.test.tsx
  • src/app/[locale]/error.tsx
  • src/app/[locale]/layout.tsx
  • src/app/[locale]/page.module.css
  • src/app/[locale]/page.tsx
  • src/app/global-error.test.tsx
  • src/app/global-error.tsx
  • src/app/layout.tsx
  • src/app/page.tsx
  • src/components/header/header.tsx
  • src/components/index.ts
  • src/components/language-switcher/language-switcher.module.css
  • src/components/language-switcher/language-switcher.tsx
  • src/i18n/messages/en.json
  • src/i18n/messages/ru.json
  • src/i18n/navigation.ts
  • src/i18n/request.ts
  • src/i18n/routing.ts
  • src/providers/toast-provider/Toast.test.tsx
  • src/providers/toast-provider/Toast.tsx
  • src/providers/toast-provider/ToastProvider.test.tsx
  • src/providers/toast-provider/ToastProvider.tsx
  • src/providers/toast-provider/types.ts
  • src/proxy.ts
💤 Files with no reviewable changes (2)
  • src/app/layout.tsx
  • src/app/page.tsx

Comment thread package.json
Comment thread src/app/[locale]/page.tsx
Comment thread src/i18n/messages/ru.json
Comment thread src/app/[locale]/error.tsx Outdated
Comment thread src/app/[locale]/error.tsx
Comment thread src/app/[locale]/error.tsx Outdated
Comment thread src/app/[locale]/error.tsx Outdated
Comment thread src/app/[locale]/page.module.css Outdated
Comment thread src/components/language-switcher/language-switcher.module.css Outdated

&:hover {
:global(.MuiOutlinedInput-notchedOutline) {
border-color: rgb(192 132 252 / 75%) !important;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

цвета б конечно в палитру записать и юзать ограниченное их кол-во

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

будет тема из хедер-ветки

Comment thread src/providers/toast-provider/Toast.tsx
Comment thread src/providers/toast-provider/ToastProvider.tsx Outdated
Comment thread src/providers/toast-provider/ToastProvider.tsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/components/header/header.tsx (1)

41-53: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Mixing style and sx for related transitions is inconsistent.

minHeight and its transition are set via the inline style prop, while py and its transition use sx. Consolidating both into sx (or theme.transitions.create(['padding', 'min-height'], ...)) would be more idiomatic MUI usage and easier to maintain/theme.

♻️ Suggested consolidation
       <Toolbar
-        style={{
-          minHeight,
-          transition: 'min-height 200ms',
-        }}
         sx={{
+          minHeight,
           py,
           transition: (theme) =>
-            theme.transitions.create(['padding'], {
+            theme.transitions.create(['padding', 'min-height'], {
               duration: theme.transitions.duration.short,
             }),
         }}
       >
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/header/header.tsx` around lines 41 - 53, The Toolbar styling
is split between inline style and sx for related layout transitions, which is
inconsistent. Update the Header Toolbar in header.tsx so both minHeight and
py-related transition behavior are handled in sx using the theme object, keeping
the transition definitions together with theme.transitions.create and removing
the inline style prop for these shared styles.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/header/header.tsx`:
- Around line 33-40: The AppBar styling in header should not rely on borderColor
alone, since it won’t render without an actual border. Update the AppBar sx in
header.tsx to add a visible bottom border/divider (for example via borderBottom
or borderBottomWidth with a border style) while keeping the existing
backgroundColor and sticky behavior.

---

Nitpick comments:
In `@src/components/header/header.tsx`:
- Around line 41-53: The Toolbar styling is split between inline style and sx
for related layout transitions, which is inconsistent. Update the Header Toolbar
in header.tsx so both minHeight and py-related transition behavior are handled
in sx using the theme object, keeping the transition definitions together with
theme.transitions.create and removing the inline style prop for these shared
styles.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a48dff04-364c-49cc-96e4-9eeaa7d92fd0

📥 Commits

Reviewing files that changed from the base of the PR and between 48e18cb and 09225a5.

📒 Files selected for processing (7)
  • src/app/[locale]/error.tsx
  • src/app/global-error.tsx
  • src/components/error-card/error-card.tsx
  • src/components/header/header.tsx
  • src/i18n/messages/en.json
  • src/i18n/messages/ru.json
  • src/providers/mui-provider.tsx
✅ Files skipped from review due to trivial changes (2)
  • src/i18n/messages/en.json
  • src/i18n/messages/ru.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/app/global-error.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/components/header/header.tsx (1)

41-53: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Mixing style and sx for related transitions is inconsistent.

minHeight and its transition are set via the inline style prop, while py and its transition use sx. Consolidating both into sx (or theme.transitions.create(['padding', 'min-height'], ...)) would be more idiomatic MUI usage and easier to maintain/theme.

♻️ Suggested consolidation
       <Toolbar
-        style={{
-          minHeight,
-          transition: 'min-height 200ms',
-        }}
         sx={{
+          minHeight,
           py,
           transition: (theme) =>
-            theme.transitions.create(['padding'], {
+            theme.transitions.create(['padding', 'min-height'], {
               duration: theme.transitions.duration.short,
             }),
         }}
       >
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/header/header.tsx` around lines 41 - 53, The Toolbar styling
is split between inline style and sx for related layout transitions, which is
inconsistent. Update the Header Toolbar in header.tsx so both minHeight and
py-related transition behavior are handled in sx using the theme object, keeping
the transition definitions together with theme.transitions.create and removing
the inline style prop for these shared styles.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/header/header.tsx`:
- Around line 33-40: The AppBar styling in header should not rely on borderColor
alone, since it won’t render without an actual border. Update the AppBar sx in
header.tsx to add a visible bottom border/divider (for example via borderBottom
or borderBottomWidth with a border style) while keeping the existing
backgroundColor and sticky behavior.

---

Nitpick comments:
In `@src/components/header/header.tsx`:
- Around line 41-53: The Toolbar styling is split between inline style and sx
for related layout transitions, which is inconsistent. Update the Header Toolbar
in header.tsx so both minHeight and py-related transition behavior are handled
in sx using the theme object, keeping the transition definitions together with
theme.transitions.create and removing the inline style prop for these shared
styles.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a48dff04-364c-49cc-96e4-9eeaa7d92fd0

📥 Commits

Reviewing files that changed from the base of the PR and between 48e18cb and 09225a5.

📒 Files selected for processing (7)
  • src/app/[locale]/error.tsx
  • src/app/global-error.tsx
  • src/components/error-card/error-card.tsx
  • src/components/header/header.tsx
  • src/i18n/messages/en.json
  • src/i18n/messages/ru.json
  • src/providers/mui-provider.tsx
✅ Files skipped from review due to trivial changes (2)
  • src/i18n/messages/en.json
  • src/i18n/messages/ru.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/app/global-error.tsx
🛑 Comments failed to post (1)
src/components/header/header.tsx (1)

33-40: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

borderColor: 'divider' has no visible effect without a border width/style.

The AppBar doesn't set border, borderWidth, or borderStyle, so borderColor: 'divider' is dead CSS — no border will render. If the intent is a bottom divider under the sticky header, add borderBottom/borderBottomWidth.

🎨 Proposed fix
       sx={{
         backgroundColor: 'background.paper',
-        borderColor: 'divider',
+        borderBottom: 1,
+        borderColor: 'divider',
       }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

    <AppBar
      elevation={0}
      position="sticky"
      sx={{
        backgroundColor: 'background.paper',
        borderBottom: 1,
        borderColor: 'divider',
      }}
    >
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/header/header.tsx` around lines 33 - 40, The AppBar styling in
header should not rely on borderColor alone, since it won’t render without an
actual border. Update the AppBar sx in header.tsx to add a visible bottom
border/divider (for example via borderBottom or borderBottomWidth with a border
style) while keeping the existing backgroundColor and sticky behavior.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/app/[locale]/layout.tsx (1)

49-53: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider wrapping {children} in a <main> landmark.

Header/Footer sandwich {children} directly without a semantic <main> element, which affects accessibility landmark navigation.

♻️ Proposed fix
           <MuiProvider>
             <Header />
-            {children}
+            <main>{children}</main>
             <Footer />
           </MuiProvider>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/app/`[locale]/layout.tsx around lines 49 - 53, Wrap the routed page
content rendered by the layout in a semantic <main> landmark so accessibility
tools can identify the primary content area. Update the layout component that
composes MuiProvider, Header, Footer, and {children} to place {children} inside
a <main> element, keeping Header and Footer outside that landmark.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/app/`[locale]/layout.tsx:
- Around line 49-53: Wrap the routed page content rendered by the layout in a
semantic <main> landmark so accessibility tools can identify the primary content
area. Update the layout component that composes MuiProvider, Header, Footer, and
{children} to place {children} inside a <main> element, keeping Header and
Footer outside that landmark.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 72e86b96-a581-490c-81c5-5cb932ccdd89

📥 Commits

Reviewing files that changed from the base of the PR and between 09225a5 and 6154a44.

📒 Files selected for processing (6)
  • src/app/[locale]/error.tsx
  • src/app/[locale]/layout.tsx
  • src/app/[locale]/page.tsx
  • src/app/global-error.tsx
  • src/components/error-card/error-card.tsx
  • src/components/index.ts
💤 Files with no reviewable changes (1)
  • src/app/[locale]/page.tsx
✅ Files skipped from review due to trivial changes (1)
  • src/components/index.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/components/error-card/error-card.tsx
  • src/app/global-error.tsx
  • src/app/[locale]/error.tsx

@AlyaEngineer
AlyaEngineer merged commit 55f86f4 into develop Jul 8, 2026
3 checks passed
@AlyaEngineer
AlyaEngineer deleted the feature/7-general-requirements branch July 8, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature-7-general Feature 7: General Requirements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User frendly errors

4 participants