Skip to content

feat: RSS-SE-26 display history analytics - #41

Merged
dilmun1101 merged 14 commits into
feature/historyAndAnaliticsfrom
story/RSS-SE-26_displayHistoryAnalytics
Jul 13, 2026
Merged

dilmun1101 merged 14 commits into
feature/historyAndAnaliticsfrom
story/RSS-SE-26_displayHistoryAnalytics

Conversation

@dilmun1101

@dilmun1101 dilmun1101 commented Jul 13, 2026 •

Copy link
Copy Markdown
Collaborator

📋 Trello Task ID

  • RSS-SE-26 (Task ID / Trello Card)
  • No ID (Global fix or chore)

⚡️ Summary

  • Added a request history page with data about status, duration, execution time, and request/response sizes.
  • Implemented logging of both successful and failed proxy requests into the history.
  • Non-authorized users are redirected to the main page.
  • Updated Russian and English texts for the history page and its UI elements.
  • Added empty history states and a shortcut to navigate back to the editor.

🛠 Type of change

  • feat (New feature)
  • fix (Bug fix)
  • refactor (Code improvement / Refactoring without changing logic)
  • style (Formatting, CSS)
  • docs (Documentation)
  • chore (Configs, Build)
  • test (Testing)

📷 Screenshots / GIFs

Снимок экрана 2026-07-13 181633 Снимок экрана 2026-07-13 191522

Summary by CodeRabbit

  • Новые возможности
    • Добавлена страница «История» с вводным блоком, пустым состоянием и кнопками в редактор/просмотр.
    • Появляются карточки запросов с методом, URL, статусом, длительностью, временем, размерами запроса/ответа и отображением ошибки при наличии.
  • Локализация
    • Обновлены и расширены переводы для истории и элементов страницы (EN/RU), включая новые тексты пустого состояния, заголовки и метаданные.
  • Исправления
    • История показывается только для текущего пользователя; при отсутствии выполняется редирект на главную.
    • Прокси-запросы теперь корректнее сохраняются в истории с учетом таймаутов, статусов и размеров ответа.

@vercel

vercel Bot commented Jul 13, 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 13, 2026 4:41pm

@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Страница истории загружает записи текущего пользователя из Supabase, отображает пустое состояние или карточки запросов, а proxy-маршрут сохраняет успешные и ошибочные операции в таблицу history. Добавлены серверные компоненты, форматтеры, стили, тесты и локализации.

Changes

История запросов и аналитика

Layer / File(s) Summary
Контракт и загрузка истории
src/features/history/api/history.ts, src/shared/api/supabase/get-current-user.ts
Определены данные истории, добавлена выборка по user_id, а получение пользователя переведено на auth.getUser().
Логирование proxy-запросов
app/api/proxy/route.ts
Ответы буферизуются, измеряются и сохраняются в history; таймауты возвращают 504, прочие ошибки — 502.
Авторизация и сборка страницы
app/[locale]/history/page.tsx, src/pages/history-page/index.ts, src/pages/history-page/ui/history-page.tsx, src/pages/history-page/ui/history-page.module.scss, src/pages/history-page/ui/history-page.test.tsx
Страница перенаправляет пользователей без user.id домой, загружает историю и отображает пустое состояние или список карточек.
Форматирование и отображение истории
src/pages/history-page/lib/*, src/pages/history-page/ui/history-intro/*, src/pages/history-page/ui/empty-history-message/*, src/pages/history-page/ui/history-requst-card/*, messages/*.json
Добавлены форматтеры, интро, локализованные подписи, анимированное пустое состояние, карточки запросов и тесты компонентов.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant HistoryPage
  participant Supabase
  participant HistoryRequestCard
  Client->>HistoryPage: открыть страницу истории
  HistoryPage->>Supabase: получить текущего пользователя
  Supabase-->>HistoryPage: user.id
  HistoryPage->>Supabase: загрузить history по user_id
  Supabase-->>HistoryPage: записи истории
  HistoryPage->>HistoryRequestCard: передать items
  HistoryRequestCard-->>Client: отобразить карточки или пустое состояние
Loading

Possibly related PRs

Suggested reviewers: fiercesloth

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Заголовок кратко и точно отражает основное изменение: страницу истории и аналитику запросов.
Description check ✅ Passed Описание соответствует шаблону: есть ID задачи, summary, тип изменения и скриншоты для UI-изменений.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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 story/RSS-SE-26_displayHistoryAnalytics

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

@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: 8

🧹 Nitpick comments (1)
src/features/history/api/history.ts (1)

19-23: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Отсутствует ограничение количества строк в запросе истории.

Запрос не содержит .limit()/пагинации, поэтому со временем активный пользователь может выгружать неограниченно растущий список записей history при каждом заходе на страницу.

♻️ Пример ограничения выборки
   const { data, error } = await supabase
     .from('history')
     .select('id, user_id, url, method, status, duration, timestamp, request_size, response_size, error_details')
     .eq('user_id', userId)
-    .order('timestamp', { ascending: false });
+    .order('timestamp', { ascending: false })
+    .limit(100);
🤖 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/features/history/api/history.ts` around lines 19 - 23, Ограничьте
количество записей в запросе истории, добавив `.limit()` или существующую
пагинацию в цепочку Supabase-запроса после сортировки по `timestamp` в
обработчике, использующем выборку из таблицы `history`. Сохраните сортировку по
убыванию и примените согласованный с приложением максимальный размер страницы.
🤖 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 `@app/api/proxy/route.ts`:
- Around line 45-101: Вынесите дублируемую запись в `history` из основного
`try/catch` в отдельный helper, вызываемый из обоих путей прокси. Внутри helper
изолируйте создание Supabase-клиента, `auth.getUser()` и `insert` собственным
`try/catch`, чтобы ошибки логирования не изменяли успешный ответ или основной
статус прокси; проверяйте результат `insert` и логируйте полученную ошибку.
Сохраните текущие поля истории и различия статусов успешного и исключительного
путей.
- Around line 68-72: Sanitize the headers in the proxy response construction
around responseBuffer before returning the new Response: remove the original
content-encoding and content-length headers because response.arrayBuffer() has
already decoded the body. Preserve all other response headers and the existing
status and statusText values.

In `@src/features/history/api/history.ts`:
- Around line 25-27: Обработайте ошибку загрузки истории в связке loadHistory и
маршрута истории: не допускайте проброса PostgrestError в рендер без fallback.
Либо возвращайте безопасный пустой список из loadHistory при ошибке, либо
добавьте error.tsx для маршрута app/[locale]/history, сохранив корректное
отображение пользовательского fallback вместо необработанной 500-ошибки.

In
`@src/pages/history-page/ui/empty-history-message/empty-history-message.module.scss`:
- Around line 1-7: Центрируйте контейнер .container вместе с сообщением и CTA:
добавьте ему горизонтальное авто-центрирование или используйте отдельный
layout-класс для общего центрированного обёртывающего блока. Сохраните текущие
ограничения ширины и вертикальную компоновку.

In
`@src/pages/history-page/ui/history-requst-card/history-request-card.module.scss`:
- Around line 1-12: Сделайте адаптивным стиль .container: разрешите перенос
flex-элементов, добавьте min-width: 0 и примените overflow-wrap: anywhere к
элементу с URL, чтобы содержимое не выходило за пределы viewport на узких
экранах.
- Around line 18-22: Добавьте в module.scss селекторы .meta, .info и .infoError,
используемые компонентом history-request-card.tsx, чтобы CSS Module
экспортировал все указанные классы и применял стили метаданных и ошибки. Не
удаляйте className из компонента.

In `@src/pages/history-page/ui/history-requst-card/history-request-card.tsx`:
- Around line 34-42: Update the requestSize and responseSize render expressions
in the history request card so null or undefined values display — or N/A instead
of 0 B, while actual numeric zero continues to display 0 B.
- Line 31: Update the timestamp formatting in the history request card around
the `new Date(item.timestamp)` expression to use `Intl.DateTimeFormat` with the
request locale from `next-intl` and an explicit `timeZone`, rather than relying
on `toLocaleString()` defaults. Preserve the displayed timestamp while making
formatting deterministic across server environments.

---

Nitpick comments:
In `@src/features/history/api/history.ts`:
- Around line 19-23: Ограничьте количество записей в запросе истории, добавив
`.limit()` или существующую пагинацию в цепочку Supabase-запроса после
сортировки по `timestamp` в обработчике, использующем выборку из таблицы
`history`. Сохраните сортировку по убыванию и примените согласованный с
приложением максимальный размер страницы.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e339bd23-31b8-46f3-8747-ef41dc005b96

📥 Commits

Reviewing files that changed from the base of the PR and between 7cdc9a7 and f7eb11e.

📒 Files selected for processing (15)
  • app/[locale]/history/page.tsx
  • app/api/proxy/route.ts
  • messages/en.json
  • messages/ru.json
  • src/features/history/api/history.ts
  • src/pages/history-page/index.ts
  • src/pages/history-page/ui/empty-history-message/empty-history-message.module.scss
  • src/pages/history-page/ui/empty-history-message/empty-history-message.tsx
  • src/pages/history-page/ui/history-intro/history-intro.module.scss
  • src/pages/history-page/ui/history-intro/history-intro.tsx
  • src/pages/history-page/ui/history-page.module.scss
  • src/pages/history-page/ui/history-page.tsx
  • src/pages/history-page/ui/history-requst-card/history-request-card.module.scss
  • src/pages/history-page/ui/history-requst-card/history-request-card.tsx
  • src/shared/api/supabase/get-current-user.ts

Comment thread app/api/proxy/route.ts Outdated
Comment thread app/api/proxy/route.ts
Comment on lines +25 to +27
if (error) {
throw error;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== history api ==\n'
ast-grep outline src/features/history/api/history.ts --view expanded || true
printf '\n== page ==\n'
ast-grep outline "app/[locale]/history/page.tsx" --view expanded || true

printf '\n== relevant files with line numbers ==\n'
cat -n src/features/history/api/history.ts | sed -n '1,220p'
printf '\n---\n'
cat -n "app/[locale]/history/page.tsx" | sed -n '1,220p'

printf '\n== references to loadHistory ==\n'
rg -n "loadHistory\\(" . -g '!node_modules' -g '!dist' -g '!build' || true

Repository: FierceSloth/swagger-editor-app

Length of output: 2638


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== history route files ==\n'
find app -path '*/history/*' -maxdepth 4 -type f | sort || true

printf '\n== error/loading boundaries ==\n'
fd -a 'error.tsx|loading.tsx|not-found.tsx' app || true

printf '\n== specific route boundary files ==\n'
for f in \
  "app/[locale]/history/error.tsx" \
  "app/[locale]/history/loading.tsx" \
  "app/error.tsx" \
  "app/[locale]/error.tsx" \
  "app/error.tsx"
do
  if [ -f "$f" ]; then
    echo "--- $f"
    cat -n "$f" | sed -n '1,220p'
  fi
done

Repository: FierceSloth/swagger-editor-app

Length of output: 340


Обработать ошибку загрузки истории на уровне маршрута

src/features/history/api/history.ts сейчас пробрасывает PostgrestError, а app/[locale]/history/page.tsx вызывает await loadHistory(user.id) без try/catch. Любой сбой Supabase уронит рендер страницы 500-ошибкой без пользовательского fallback; здесь нужен либо локальный fallback/пустой список, либо app/[locale]/history/error.tsx.

🤖 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/features/history/api/history.ts` around lines 25 - 27, Обработайте ошибку
загрузки истории в связке loadHistory и маршрута истории: не допускайте проброса
PostgrestError в рендер без fallback. Либо возвращайте безопасный пустой список
из loadHistory при ошибке, либо добавьте error.tsx для маршрута
app/[locale]/history, сохранив корректное отображение пользовательского fallback
вместо необработанной 500-ошибки.

Comment thread src/pages/history-page/ui/empty-history-message/empty-history-message.module.scss Outdated
Comment on lines +1 to +12
.container {
display: flex;
align-items: center;
gap: 10px;
padding: 10px;
border: 1px solid rgba(255, 255, 255, 0.5);
border-radius: 15px;
background: rgba(255, 255, 255, 0.1);
transition: 1s;
font-size: 14px;
color: rgba(255, 255, 255, 0.5);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Сделайте карточку адаптивной.

display: flex без flex-wrap/responsive layout размещает URL и все метаданные в одну строку. На узких экранах карточка будет выходить за пределы viewport. Добавьте перенос, min-width: 0 и overflow-wrap: anywhere для URL либо используйте responsive grid.

🤖 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/pages/history-page/ui/history-requst-card/history-request-card.module.scss`
around lines 1 - 12, Сделайте адаптивным стиль .container: разрешите перенос
flex-элементов, добавьте min-width: 0 и примените overflow-wrap: anywhere к
элементу с URL, чтобы содержимое не выходило за пределы viewport на узких
экранах.

Comment on lines +18 to +22
.item {
display: flex;
flex-direction: column;
gap: 5px;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Добавьте отсутствующие CSS-классы компонента.

history-request-card.tsx использует styles.meta, styles.info и styles.infoError, но этот module.scss экспортирует только container и item. Поэтому стили метаданных и ошибки не применяются. Добавьте соответствующие селекторы или удалите эти className.

🤖 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/pages/history-page/ui/history-requst-card/history-request-card.module.scss`
around lines 18 - 22, Добавьте в module.scss селекторы .meta, .info и
.infoError, используемые компонентом history-request-card.tsx, чтобы CSS Module
экспортировал все указанные классы и применял стили метаданных и ошибки. Не
удаляйте className из компонента.

Comment thread src/pages/history-page/ui/history-requst-card/history-request-card.tsx Outdated
Comment thread src/pages/history-page/ui/history-requst-card/history-request-card.tsx Outdated
@dilmun1101 dilmun1101 changed the title Story/rss se 26 display history analytics feat: RSS-SE-26 display history analytics Jul 13, 2026

@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

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/api/proxy/route.ts (1)

103-113: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Ограничить размер upstream-ответа в прокси
response.arrayBuffer() целиком буферизует ответ в памяти, а для произвольного targetUrl здесь нет никакого лимита. Большой или chunked-ответ может привести к OOM на сервере. Нужен потоковый проксирующий ответ с ранним обрывом по max size; одной проверки Content-Length недостаточно.

🤖 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 `@app/api/proxy/route.ts` around lines 103 - 113, Измените обработку ответа в
прокси вокруг вызова fetch и текущего response.arrayBuffer(), чтобы читать
upstream-поток порциями и прерывать его при достижении допустимого максимального
размера, включая ответы без Content-Length. Сохраняйте существующие duration и
responseSize для успешно завершённых ответов, а превышение лимита обрабатывайте
контролируемым обрывом upstream-потока и соответствующим ответом клиенту.
🧹 Nitpick comments (1)
app/api/proxy/route.ts (1)

114-122: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Логирование истории блокирует ответ клиенту прокси.

await logHistorySafely(...) вызывается и ожидается до return как в успешном, так и в catch-пути. Это добавляет к каждому проксируемому запросу дополнительный сетевой round-trip к Supabase (auth.getUser() + insert) прежде, чем клиент получит ответ, хотя сам ответ (responseBuffer/статус ошибки) уже полностью готов.

В Next.js для этого случая (логирование/аналитика после отправки ответа, без блокировки) есть штатный стабильный API after() из next/server, который можно использовать прямо в Route Handler, включая доступ к cookies()/headers() внутри callback — то есть createClient() внутри logHistorySafely продолжит работать корректно.

♻️ Перенос логирования истории в after()
+import { after } from 'next/server';
...
-    await logHistorySafely({
-      targetUrl,
-      method,
-      status: response.status,
-      duration,
-      requestSize,
-      responseSize,
-      errorDetails: response.ok ? null : `HTTP ${response.status}`,
-    });
+    after(() =>
+      logHistorySafely({
+        targetUrl,
+        method,
+        status: response.status,
+        duration,
+        requestSize,
+        responseSize,
+        errorDetails: response.ok ? null : `HTTP ${response.status}`,
+      }),
+    );
-    await logHistorySafely({
-      targetUrl,
-      method,
-      status,
-      duration,
-      requestSize,
-      responseSize: 0,
-      errorDetails,
-    });
+    after(() =>
+      logHistorySafely({
+        targetUrl,
+        method,
+        status,
+        duration,
+        requestSize,
+        responseSize: 0,
+        errorDetails,
+      }),
+    );

Also applies to: 140-148

🤖 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 `@app/api/proxy/route.ts` around lines 114 - 122, Перенесите вызовы
logHistorySafely из синхронного пути обработчика в callback after() из
next/server, включая успешную и catch-ветки, чтобы они выполнялись после
отправки ответа и не блокировали его. Зарегистрируйте callback после полной
подготовки responseBuffer и статуса, сохранив все текущие поля логирования и
возможность createClient() использовать cookies()/headers().
🤖 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.

Outside diff comments:
In `@app/api/proxy/route.ts`:
- Around line 103-113: Измените обработку ответа в прокси вокруг вызова fetch и
текущего response.arrayBuffer(), чтобы читать upstream-поток порциями и
прерывать его при достижении допустимого максимального размера, включая ответы
без Content-Length. Сохраняйте существующие duration и responseSize для успешно
завершённых ответов, а превышение лимита обрабатывайте контролируемым обрывом
upstream-потока и соответствующим ответом клиенту.

---

Nitpick comments:
In `@app/api/proxy/route.ts`:
- Around line 114-122: Перенесите вызовы logHistorySafely из синхронного пути
обработчика в callback after() из next/server, включая успешную и catch-ветки,
чтобы они выполнялись после отправки ответа и не блокировали его.
Зарегистрируйте callback после полной подготовки responseBuffer и статуса,
сохранив все текущие поля логирования и возможность createClient() использовать
cookies()/headers().

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 10ff6b2a-48cd-4c5a-9964-a22ed9a96bf8

📥 Commits

Reviewing files that changed from the base of the PR and between 69ab084 and e12d073.

📒 Files selected for processing (1)
  • app/api/proxy/route.ts

@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 (2)
src/pages/history-page/lib/format-history.test.ts (1)

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

Сделайте проверку timestamp детерминированной.

Тест повторяет внутренний алгоритм formatTimestamp, поэтому он может пройти даже при неверном формате или timezone. Задайте явные locale/timezone и сравнивайте с фиксированной строкой; отдельно покройте русскую и английскую локализации.

🤖 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/pages/history-page/lib/format-history.test.ts` around lines 62 - 75,
Сделайте тесты formatTimestamp детерминированными: не вычисляйте ожидаемое
значение через методы Date, а сравнивайте с фиксированной строкой при явно
заданных locale и timezone. Добавьте отдельные проверки для английской и русской
локализаций, чтобы тесты выявляли ошибки формата и часового пояса.
src/pages/history-page/ui/history-requst-card/history-request-card.test.tsx (1)

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

Добавьте проверки timestamp и nullable-размеров.

Тесты не проверяют отображение timestamp и не отличают null от реального 0 B. Добавьте assertions для форматированной даты и отдельный сценарий с null для request_size/response_size.

🤖 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/pages/history-page/ui/history-requst-card/history-request-card.test.tsx`
around lines 32 - 56, Расширьте тесты вокруг HistoryRequestCard: добавьте
assertions для отображения форматированного timestamp в успешном и/или ошибочном
сценарии, используя ожидаемый формат компонента. Добавьте отдельный сценарий с
request_size и response_size равными null и проверьте их nullable-отображение,
отличая его от реального значения 0 B.
🤖 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/pages/history-page/ui/empty-history-message/empty-history-message.module.scss`:
- Line 33: Rename the spinReverse keyframe to kebab-case in its declaration and
update the animation reference in the empty-history message styles to use the
renamed keyframe.

In `@src/pages/history-page/ui/history-page.module.scss`:
- Around line 24-29: Update the .actions flex container to allow its CTA buttons
to wrap or stack vertically on narrow viewports, while preserving the existing
centered alignment and spacing for wider layouts.

In `@src/pages/history-page/ui/history-requst-card/history-request-card.tsx`:
- Around line 38-50: Локализуйте подписи Req:, Res: и Error: в компоненте
истории, используя существующие переводы History либо локализованные значения из
HistoryPage. Обновите отображение метаданных в history-request-card и сохраните
текущую структуру и форматирование размеров.

---

Nitpick comments:
In `@src/pages/history-page/lib/format-history.test.ts`:
- Around line 62-75: Сделайте тесты formatTimestamp детерминированными: не
вычисляйте ожидаемое значение через методы Date, а сравнивайте с фиксированной
строкой при явно заданных locale и timezone. Добавьте отдельные проверки для
английской и русской локализаций, чтобы тесты выявляли ошибки формата и часового
пояса.

In `@src/pages/history-page/ui/history-requst-card/history-request-card.test.tsx`:
- Around line 32-56: Расширьте тесты вокруг HistoryRequestCard: добавьте
assertions для отображения форматированного timestamp в успешном и/или ошибочном
сценарии, используя ожидаемый формат компонента. Добавьте отдельный сценарий с
request_size и response_size равными null и проверьте их nullable-отображение,
отличая его от реального значения 0 B.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 18f3f676-f44b-454f-8fdf-edcc0a073dc1

📥 Commits

Reviewing files that changed from the base of the PR and between e12d073 and 23705cb.

📒 Files selected for processing (16)
  • messages/en.json
  • messages/ru.json
  • src/pages/history-page/lib/format-history.test.ts
  • src/pages/history-page/lib/format-history.ts
  • src/pages/history-page/ui/empty-history-message/empty-history-message.module.scss
  • src/pages/history-page/ui/empty-history-message/empty-history-message.test.tsx
  • src/pages/history-page/ui/empty-history-message/empty-history-message.tsx
  • src/pages/history-page/ui/history-intro/history-intro.module.scss
  • src/pages/history-page/ui/history-intro/history-intro.test.tsx
  • src/pages/history-page/ui/history-intro/history-intro.tsx
  • src/pages/history-page/ui/history-page.module.scss
  • src/pages/history-page/ui/history-page.test.tsx
  • src/pages/history-page/ui/history-page.tsx
  • src/pages/history-page/ui/history-requst-card/history-request-card.module.scss
  • src/pages/history-page/ui/history-requst-card/history-request-card.test.tsx
  • src/pages/history-page/ui/history-requst-card/history-request-card.tsx
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/pages/history-page/ui/history-intro/history-intro.tsx
  • src/pages/history-page/ui/empty-history-message/empty-history-message.tsx
  • src/pages/history-page/ui/history-page.tsx
  • messages/en.json
  • messages/ru.json

inset: 16px;
border-radius: 50%;
border: 1px dashed var(--bg-surface-4);
animation: spinReverse 12s linear infinite;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Используйте kebab-case для имени keyframe.

spinReverse нарушает правило Stylelint keyframes-name-pattern. Переименуйте и объявление, и ссылку:

Предлагаемое исправление
-  animation: spinReverse 12s linear infinite;
+  animation: spin-reverse 12s linear infinite;

-@keyframes spinReverse {
+@keyframes spin-reverse {

Also applies to: 64-64

🤖 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/pages/history-page/ui/empty-history-message/empty-history-message.module.scss`
at line 33, Rename the spinReverse keyframe to kebab-case in its declaration and
update the animation reference in the empty-history message styles to use the
renamed keyframe.

Source: Linters/SAST tools

Comment on lines +24 to +29
.actions {
display: flex;
align-items: center;
justify-content: center;
gap: 16px;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Разрешите перенос CTA-кнопок на узких экранах.

.actions всегда остаётся одной строкой, хотя empty-state содержит две кнопки, локализованные подписи и значительный горизонтальный padding. На мобильном viewport кнопки могут выйти за границы контейнера и ухудшить доступ к навигации.

Добавьте flex-wrap или media-query с вертикальным расположением кнопок.

Also applies to: 37-39

🤖 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/pages/history-page/ui/history-page.module.scss` around lines 24 - 29,
Update the .actions flex container to allow its CTA buttons to wrap or stack
vertically on narrow viewports, while preserving the existing centered alignment
and spacing for wider layouts.

Comment on lines +38 to +50
<span className={styles.metaItem}>
Req: {formatSize(item.request_size)}
<span className={styles.separator}>|</span>
Res: {formatSize(item.response_size)}
</span>
</div>
</div>

{item.error_details && (
<div className={styles.errorRow}>
<ErrorIcon className={styles.errorIcon} />
<span className={styles.errorLabel}>Error:</span>
<span className={styles.errorText}>{item.error_details}</span>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Локализуйте подписи метаданных.

Req:, Res: и Error: останутся на английском в русской локали. Получайте эти подписи через History translations или передавайте локализованные значения из HistoryPage.

🤖 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/pages/history-page/ui/history-requst-card/history-request-card.tsx`
around lines 38 - 50, Локализуйте подписи Req:, Res: и Error: в компоненте
истории, используя существующие переводы History либо локализованные значения из
HistoryPage. Обновите отображение метаданных в history-request-card и сохраните
текущую структуру и форматирование размеров.

@dilmun1101
dilmun1101 merged commit 9b99b7b into feature/historyAndAnalitics Jul 13, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — cb7d5f78 Deployed Jul 13, 2026 by vercel[bot]
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.

2 participants