Skip to content

feat: RSS-SE-20 implement try it out ui form - #30

Merged
FierceSloth merged 5 commits into
feature/swaggerViewerfrom
story/RSS-SE-20_implementTryItOutUiForm
Jul 12, 2026
Merged

FierceSloth merged 5 commits into
feature/swaggerViewerfrom
story/RSS-SE-20_implementTryItOutUiForm

Conversation

@FierceSloth

@FierceSloth FierceSloth commented Jul 10, 2026 •

Copy link
Copy Markdown
Owner

📋 Trello Task ID

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

⚡️ Summary

  • Create interactive TryItOutForm UI component for parameters input and request body construction
  • Add withErrorPlug property to Input component to handle error container spacing and prevent layout shifts
  • Adjust Accordion component paddings and styles to match structural design specs

🛠 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

image

Summary by CodeRabbit

  • Новые возможности
    • Добавлена интерактивная секция «Попробовать» в раскрывающихся карточках endpoint’ов.
    • Можно вводить параметры и JSON-тело запроса, подставлять примеры и выполнять запрос, а также генерировать cURL.
  • Локализация
    • Добавлены переводы на русском и английском для интерфейса «Попробовать» и ошибок (в т.ч. при неверном JSON).
  • Улучшения интерфейса
    • Обновлены отступы, разделители и компоновка формы, списка и содержимого аккордеонов.
    • Настроено корректное отображение ошибок в полях ввода.

@vercel

vercel Bot commented Jul 10, 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 12, 2026 9:31am

@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 462a0875-e475-46fa-a33a-79e894bab7f1

📥 Commits

Reviewing files that changed from the base of the PR and between 6d0e99b and 18a956f.

📒 Files selected for processing (4)
  • messages/en.json
  • messages/ru.json
  • src/entities/endpoint/ui/try-it-out-form/try-it-out-form.tsx
  • src/shared/ui/accordion/accordion.module.scss
💤 Files with no reviewable changes (1)
  • src/shared/ui/accordion/accordion.module.scss
🚧 Files skipped from review as they are similar to previous changes (3)
  • messages/en.json
  • messages/ru.json
  • src/entities/endpoint/ui/try-it-out-form/try-it-out-form.tsx

📝 Walkthrough

Walkthrough

Добавлены типы OpenAPI для requestBody, локализация Try It Out и форма ввода параметров и JSON-тела запроса. Форма встроена в раскрытые endpoint’ы, а Accordion и Input обновлены для поддержки новой разметки.

Changes

Форма Try It Out для endpoint’ов

Layer / File(s) Summary
Контракт тела запроса и локализация
src/entities/endpoint/types/openapi-types.ts, messages/en.json, messages/ru.json
В контракт операции добавлены requestBody и типы схем, media type и тела запроса; добавлены строки интерфейса Try It Out на английском и русском языках.
Поддержка Accordion и Input
src/shared/ui/accordion/*, src/shared/ui/input/*
Переданный класс AccordionContent перенесён на внутренний контейнер; обновлены отступы, граница и логика резервирования места под ошибки Input.
Отображение формы Try It Out
src/entities/endpoint/ui/try-it-out-form/*, src/entities/endpoint/ui/endpoint-list/*
Добавлен компонент формы для параметров и JSON-примера тела запроса, а также его отображение внутри раскрытого endpoint’а и связанные стили.

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

Sequence Diagram(s)

sequenceDiagram
  participant EndpointList
  participant TryItOutForm
  participant Endpoint
  participant Input
  participant Translations
  EndpointList->>TryItOutForm: передаёт endpoint
  TryItOutForm->>Endpoint: читает параметры и requestBody
  TryItOutForm->>Input: отображает поля параметров
  TryItOutForm->>Translations: получает строки TryItOut
  TryItOutForm-->>EndpointList: отображает форму и JSON textarea
Loading

Possibly related PRs

Suggested reviewers: lexarudak, dilmun1101

🚥 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 Название кратко и точно отражает основное изменение: добавление UI-формы Try It Out.
Description check ✅ Passed Описание содержит все обязательные разделы шаблона, включая Trello ID, summary, type of change и скриншот.
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-20_implementTryItOutUiForm

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

🤖 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/entities/endpoint/ui/try-it-out-form/try-it-out-form.module.scss`:
- Around line 48-65: Remove the empty lines between CSS declarations in the
.textArea rule, including the gaps before padding, font-size, outline, and
color, so Stylelint passes without changing the styling.

In `@src/entities/endpoint/ui/try-it-out-form/try-it-out-form.tsx`:
- Around line 35-38: Англоязычные placeholder-ы в компоненте TryItOutForm не
локализованы. Добавьте в ключи TryItOut переводы с interpolation для типа
параметра и JSON placeholder-а, затем замените шаблоны `Enter ${param.in}...` и
`// JSON data` на соответствующие вызовы локализации.
- Around line 19-22: Не показывайте JSON-редактор, если requestBody не содержит
поддерживаемый media type application/json. В логике TryItOutForm, включая
вычисление jsonExample/defaultTextareaValue и рендеринг формы в соответствующем
компоненте, проверяйте наличие application/json и скрывайте редактор либо
выбирайте редактор, соответствующий фактическому типу содержимого, вместо
отображения пустого JSON-поля для XML или multipart.
- Line 30: Добавьте обработчик отправки для формы в компоненте TryItOutForm,
подключив его через onSubmit и отменяя native submit с помощью preventDefault;
реализуйте обработчик кнопки Generate cURL через onClick, чтобы обе
action-кнопки выполняли заявленные действия вместо перехода по текущему URL.
Если функциональность ещё не готова, временно задайте кнопкам type="button" и
отключите их.
- Around line 21-22: В вычислении `defaultTextareaValue` в компоненте формы не
отбрасывайте валидные falsy-значения и учитывайте альтернативу `examples`.
Используйте проверку `jsonExample !== undefined`, а если `example` отсутствует,
извлекайте подходящее значение из
`requestBody?.content['application/json']?.examples`; затем сериализуйте
найденный пример через `JSON.stringify`.
- Around line 44-49: Сделайте id textarea уникальным для каждого endpoint-а: в
компоненте try-it-out-form используйте идентификатор, производный от уникального
идентификатора endpoint-а, и передайте тот же id в htmlFor соответствующего
label вместо общего `request-body-textarea`.

In `@src/shared/ui/accordion/accordion.module.scss`:
- Line 60: Remove the duplicate border-top declaration from the accordion
content container, keeping the existing border-top rule on .contentInner as the
sole boundary.

In `@src/shared/ui/input/input.module.scss`:
- Line 43: Remove the empty line immediately before the min-height declaration
in the input styles so the declaration-empty-line-before Stylelint rule passes.
🪄 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: e611f166-731e-49de-8648-3fbbc9431927

📥 Commits

Reviewing files that changed from the base of the PR and between dbe65dc and 6d0e99b.

📒 Files selected for processing (11)
  • messages/en.json
  • messages/ru.json
  • src/entities/endpoint/types/openapi-types.ts
  • src/entities/endpoint/ui/endpoint-list/endpoint-list.module.scss
  • src/entities/endpoint/ui/endpoint-list/endpoint-list.tsx
  • src/entities/endpoint/ui/try-it-out-form/try-it-out-form.module.scss
  • src/entities/endpoint/ui/try-it-out-form/try-it-out-form.tsx
  • src/shared/ui/accordion/accordion.module.scss
  • src/shared/ui/accordion/accordion.tsx
  • src/shared/ui/input/input.module.scss
  • src/shared/ui/input/input.tsx

Comment on lines +48 to +65
.textArea {
width: 100%;
background: var(--bg-surface-2);
border: 2px solid var(--bg-surface-3);
border-radius: 1rem;

padding: 0.75rem 1.25rem;
margin-top: 8px;

font-size: 14px;
line-height: 1.5rem;
font-family: var(--font-mono);

outline: none;
resize: vertical;
transition: all 0.3s;

color: var(--text-primary);

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

Уберите пустые строки перед CSS-декларациями.

Stylelint отмечает строки 54, 57, 61 и 65. Это может блокировать lint-проверку CI.

🧰 Tools
🪛 Stylelint (17.14.0)

[error] 54-54: Expected no empty line before declaration (declaration-empty-line-before)

(declaration-empty-line-before)


[error] 57-57: Expected no empty line before declaration (declaration-empty-line-before)

(declaration-empty-line-before)


[error] 61-61: Expected no empty line before declaration (declaration-empty-line-before)

(declaration-empty-line-before)


[error] 65-65: Expected no empty line before declaration (declaration-empty-line-before)

(declaration-empty-line-before)

🤖 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/entities/endpoint/ui/try-it-out-form/try-it-out-form.module.scss` around
lines 48 - 65, Remove the empty lines between CSS declarations in the .textArea
rule, including the gaps before padding, font-size, outline, and color, so
Stylelint passes without changing the styling.

Source: Linters/SAST tools

Comment thread src/entities/endpoint/ui/try-it-out-form/try-it-out-form.tsx Outdated
Comment thread src/entities/endpoint/ui/try-it-out-form/try-it-out-form.tsx Outdated
<PlayIcon className={styles.titleIcon} />
<span>{t('title')}</span>
</h3>
<form className={styles.form}>

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 | 🏗️ Heavy lift

Подключите обработчики action-кнопок.

У Execute нет onSubmit, поэтому браузер выполняет обычную отправку формы на текущий URL; Generate cURL вообще не имеет обработчика. В результате заявленные действия не выполняются. Реализуйте обработчики и отменяйте native submit либо временно отключите эти кнопки.

Also applies to: 57-63

🤖 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/entities/endpoint/ui/try-it-out-form/try-it-out-form.tsx` at line 30,
Добавьте обработчик отправки для формы в компоненте TryItOutForm, подключив его
через onSubmit и отменяя native submit с помощью preventDefault; реализуйте
обработчик кнопки Generate cURL через onClick, чтобы обе action-кнопки выполняли
заявленные действия вместо перехода по текущему URL. Если функциональность ещё
не готова, временно задайте кнопкам type="button" и отключите их.

Comment thread src/entities/endpoint/ui/try-it-out-form/try-it-out-form.tsx
Comment thread src/entities/endpoint/ui/try-it-out-form/try-it-out-form.tsx Outdated
Comment thread src/shared/ui/accordion/accordion.module.scss Outdated
align-items: start;
gap: 0.4rem;

min-height: 0;

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

Уберите пустую строку перед декларацией.

Stylelint 17.14.0 сообщает declaration-empty-line-before на Line 43. Удалите пустую строку перед min-height, чтобы проверка стилей проходила.

   gap: 0.4rem;
-
   min-height: 0;
📝 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.

Suggested change
min-height: 0;
gap: 0.4rem;
min-height: 0;
🧰 Tools
🪛 Stylelint (17.14.0)

[error] 43-43: Expected no empty line before declaration (declaration-empty-line-before)

(declaration-empty-line-before)

🤖 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/shared/ui/input/input.module.scss` at line 43, Remove the empty line
immediately before the min-height declaration in the input styles so the
declaration-empty-line-before Stylelint rule passes.

Source: Linters/SAST tools

@merucoding
merucoding self-requested a review July 11, 2026 09:03

@merucoding merucoding left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good job!

@FierceSloth
FierceSloth merged commit ee92fd8 into feature/swaggerViewer Jul 12, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 18a956fd Deployed Jul 12, 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