Skip to content

Feat: implement Problems feature with frontend UI refactoring - #10

Merged
MathCunha16 merged 4 commits into
mainfrom
feature/frontend/api-implementation
Jul 21, 2026
Merged

Feat: implement Problems feature with frontend UI refactoring#10
MathCunha16 merged 4 commits into
mainfrom
feature/frontend/api-implementation

Conversation

@MathCunha16

@MathCunha16 MathCunha16 commented Jul 21, 2026

Copy link
Copy Markdown
Owner

This pull request introduces several UI and architectural improvements to the frontend, focusing on enhanced modal experiences, sidebar state management, and code organization. The main highlights include the addition of a reusable confirmation modal, a new sidebar context for managing open/close state with smooth transitions, and the extraction of the problems API. Some legacy UI elements and hardcoded status bars have been removed to streamline the interface.

UI/UX Improvements

  • Added a reusable ConfirmModal component with modern styling and integrated it into the project deletion flow, replacing the browser's default confirmation dialog for a better user experience. (frontend/src/components/ConfirmModal.tsx, frontend/src/components/ConfirmModal.module.css, frontend/src/components/DashboardView.tsx) [1] [2] [3] [4] [5] [6]
  • Added a new modal style for the problem form to ensure visual consistency across the app. (frontend/src/features/problems/components/ProblemForm.module.css)
  • Removed legacy status bar and system persistence UI elements to declutter the interface. (frontend/src/components/DashboardView.tsx, frontend/src/components/RootLayout.tsx) [1] [2]

Sidebar Architecture & Responsiveness

  • Introduced a SidebarContext with a provider and hook to manage sidebar open/close state application-wide, and refactored the sidebar to use this context for smooth transitions and a "wall-hugging" toggle button. (frontend/src/contexts/SidebarContext.tsx, frontend/src/components/RootLayout.tsx) [1] [2] [3] [4]
  • Added a responsive top bar that displays the app logo when the sidebar is closed, improving navigation on smaller screens. (frontend/src/components/RootLayout.tsx)

Code Organization

  • Extracted the problems API logic into its own module for better separation of concerns and maintainability. (frontend/src/features/problems/api/problemsApi.ts)

Summary by CodeRabbit

  • Novos Recursos

    • Adicionado gerenciamento completo de problemas e diagnósticos, incluindo criação, edição, exclusão, filtros, severidade e status.
    • Incluído gerenciamento de tags para projetos, snippets e problemas.
    • Adicionados modais de confirmação acessíveis para ações de exclusão, com suporte a carregamento.
    • Projetos agora usam navegação aprimorada por cartões e abas no workspace.
    • Sidebar pode ser aberta e fechada com transições suaves.
  • Melhorias de Interface

    • Formulários agora redimensionam áreas de texto automaticamente.
    • Adicionados estilos, badges, indicadores e painéis para problemas, tags e detalhes técnicos.
    • Melhorados estados de foco, hover, desabilitado e feedback de ações.

@MathCunha16 MathCunha16 self-assigned this Jul 21, 2026
@coderabbitai

coderabbitai Bot commented Jul 21, 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 (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 0d17f1a4-feb2-4582-9cd0-e918cfb1edf6

📥 Commits

Reviewing files that changed from the base of the PR and between 3911998 and e0a5b86.

📒 Files selected for processing (11)
  • frontend/src/components/ConfirmModal.module.css
  • frontend/src/components/ConfirmModal.tsx
  • frontend/src/components/ProjectDetailView.tsx
  • frontend/src/components/RootLayout.tsx
  • frontend/src/contexts/SidebarContext.ts
  • frontend/src/contexts/SidebarProvider.tsx
  • frontend/src/features/problems/components/ProblemForm.module.css
  • frontend/src/features/problems/components/ProblemForm.tsx
  • frontend/src/features/projects/components/ProjectForm.module.css
  • frontend/src/hooks/useSidebar.ts
  • frontend/src/routes/projects.$projectId.module.css
🚧 Files skipped from review as they are similar to previous changes (7)
  • frontend/src/components/ConfirmModal.module.css
  • frontend/src/components/ConfirmModal.tsx
  • frontend/src/features/problems/components/ProblemForm.module.css
  • frontend/src/features/projects/components/ProjectForm.module.css
  • frontend/src/components/RootLayout.tsx
  • frontend/src/components/ProjectDetailView.tsx
  • frontend/src/features/problems/components/ProblemForm.tsx

📝 Walkthrough

Walkthrough

A atualização adiciona suporte completo a problemas e tags, reorganiza o workspace de projetos, substitui confirmações nativas por modais assíncronos, introduz auto-resize em textareas e implementa abertura e fechamento controlados da sidebar.

Changes

Gerenciamento do workspace

Layer / File(s) Summary
Contratos, APIs e cache
frontend/src/types/api.ts, frontend/src/features/problems/..., frontend/src/features/tags/...
Adiciona tipos, endpoints REST e hooks React Query para problemas e tags, incluindo consultas, mutações, status e invalidação de cache.
Formulários e dimensionamento
frontend/src/features/problems/components/*, frontend/src/hooks/useAutoResize.ts, frontend/src/features/projects/components/ProjectForm.*
Implementa criação e edição de problemas em modal, validação, estados de carregamento e auto-resize para textareas.
Workspace de snippets e problemas
frontend/src/components/ProjectDetailView.tsx, frontend/src/routes/projects.$projectId.module.css
Adiciona abas, filtros, detalhes, status, tags, editores read-only, cópia de conteúdo e formulários de snippets e problemas.
Confirmação de deleções
frontend/src/components/ConfirmModal.*, frontend/src/components/DashboardView.tsx
Substitui window.confirm por confirmação assíncrona com foco controlado, focus trap, loading e prevenção de navegação acidental nos cards.
Sidebar e layout principal
frontend/src/contexts/*, frontend/src/hooks/useSidebar.ts, frontend/src/components/RootLayout.tsx, frontend/src/routes/__root.module.css
Adiciona contexto e provider da sidebar, botão de alternância, wrapper animado, top bar condicional e novos estilos do layout.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ProjectDetailView
  participant ProblemForm
  participant useProblems
  participant problemsApi
  participant API
  ProjectDetailView->>ProblemForm: abre criação ou edição
  ProblemForm->>useProblems: envia dados do problema
  useProblems->>problemsApi: executa mutação
  problemsApi->>API: envia requisição REST
  API-->>problemsApi: retorna problema atualizado
  problemsApi-->>ProjectDetailView: invalida e atualiza queries
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed O título resume bem a implementação da feature de Problems e a refatoração da UI frontend, que são os principais focos do PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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

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

@MathCunha16
MathCunha16 marked this pull request as ready for review July 21, 2026 09:58
@MathCunha16 MathCunha16 added enhancement New feature or request Frontend Frontend feature or modification labels Jul 21, 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.

Actionable comments posted: 8

Caution

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

⚠️ Outside diff range comments (1)
frontend/src/components/DashboardView.tsx (1)

96-165: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Separe as ações do card do Link

O Link do @tanstack/react-router renderiza um <a> por padrão, então Archive/Delete/Manage ficam aninhados em uma âncora. Mova esses botões para fora do Link e deixe nele só a área de navegação do card.

🤖 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 `@frontend/src/components/DashboardView.tsx` around lines 96 - 165, Separate
the card actions from the `@tanstack/react-router` Link in the project card
rendering: keep only the navigational card content inside the Link, and move the
Archive, Delete, and Manage buttons outside it while preserving their existing
handlers, styling, and disabled state.
🧹 Nitpick comments (1)
frontend/src/components/ProjectDetailView.tsx (1)

798-869: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Popover de gerenciamento de tags duplicado entre snippets e problemas.

Este bloco (filtro, lista filtrada e botão "Create") é praticamente idêntico ao das linhas 1220-1291 do detalhe de problemas. Extrair um componente compartilhado (ex.: <TagManager>) recebendo itemId, itemType, tags e os handlers (handleAddTag/handleRemoveTag/handleCreateAndAddTag) evita divergência futura entre os dois fluxos e reduz a superfície do componente.

🤖 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 `@frontend/src/components/ProjectDetailView.tsx` around lines 798 - 869,
Extraia o popover duplicado de gerenciamento de tags usado em snippets e
problemas para um componente compartilhado, como TagManager, recebendo itemId,
itemType, tags e os handlers de adicionar, remover e criar tags. Substitua os
blocos correspondentes, incluindo o filtro, a lista e o botão de criação,
mantendo o comportamento atual e reutilizando o componente nos dois fluxos.
🤖 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 `@frontend/src/components/ConfirmModal.module.css`:
- Around line 22-26: Rename the `@keyframes` identifier modalIn to kebab-case such
as modal-in, and update the animation declaration referencing it so both names
remain consistent.

In `@frontend/src/components/ConfirmModal.tsx`:
- Line 35: Update the ConfirmModal overlay’s onClick behavior to call onClose
only when !isLoading, preventing backdrop dismissal during deletion while
preserving normal closing when loading is complete.
- Around line 34-41: Atualize o componente ConfirmModal para usar role="dialog",
aria-modal="true" e um rótulo acessível associado ao título. Ao abrir, mova e
mantenha o foco dentro do modal, impedindo que o teclado alcance o conteúdo de
fundo; ao fechar ou desmontar, restaure o foco ao elemento que o acionou.

In `@frontend/src/components/RootLayout.tsx`:
- Around line 56-58: Update the sidebar wrapper in RootLayout to add
inert={!isOpen}, so closed sidebar content is removed from keyboard navigation
and the accessibility tree while preserving the existing className behavior.

In `@frontend/src/features/problems/components/ProblemForm.module.css`:
- Around line 24-27: Renomeie a animação modalEnter para o formato kebab-case
exigido pelo Stylelint, atualizando tanto a referência na propriedade animation
quanto o identificador correspondente em `@keyframes`; preserve os demais
parâmetros da animação.

In `@frontend/src/features/problems/components/ProblemForm.tsx`:
- Around line 79-145: Associate every label in ProblemForm with its control by
adding stable, unique id values to the title input, severity and status selects,
errorDescription textarea, and solution textarea, then set each corresponding
label’s htmlFor to the matching id. Preserve the existing form behavior and
styling.
- Line 208: Atualize o fluxo de edição em torno de ProblemForm e useProblemQuery
para impedir a renderização do formulário enquanto os dados do problema ainda
estão carregando. Exiba um estado de carregamento e trate o erro antes de montar
ProblemFormInner, ou configure useProblemQuery para usar uma query suspensiva;
preserve a inicialização de initialValues somente após problem estar disponível.
- Around line 211-218: Atualize o fluxo de submissão em handleSubmit para
persistir também o status selecionado no EditProblemFormModal, usando a mutação
ou endpoint de status já existente em vez de incluí-lo em UpdateProblemRequest.
Se a edição de status não for suportada, remova o seletor correspondente e evite
apresentar uma alteração que não será salva.

---

Outside diff comments:
In `@frontend/src/components/DashboardView.tsx`:
- Around line 96-165: Separate the card actions from the `@tanstack/react-router`
Link in the project card rendering: keep only the navigational card content
inside the Link, and move the Archive, Delete, and Manage buttons outside it
while preserving their existing handlers, styling, and disabled state.

---

Nitpick comments:
In `@frontend/src/components/ProjectDetailView.tsx`:
- Around line 798-869: Extraia o popover duplicado de gerenciamento de tags
usado em snippets e problemas para um componente compartilhado, como TagManager,
recebendo itemId, itemType, tags e os handlers de adicionar, remover e criar
tags. Substitua os blocos correspondentes, incluindo o filtro, a lista e o botão
de criação, mantendo o comportamento atual e reutilizando o componente nos dois
fluxos.
🪄 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 (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 59ec2fd9-b5a2-4563-9f14-f0aabbaf31d3

📥 Commits

Reviewing files that changed from the base of the PR and between e59e56c and 3911998.

📒 Files selected for processing (18)
  • frontend/src/components/ConfirmModal.module.css
  • frontend/src/components/ConfirmModal.tsx
  • frontend/src/components/DashboardView.tsx
  • frontend/src/components/ProjectDetailView.tsx
  • frontend/src/components/RootLayout.tsx
  • frontend/src/contexts/SidebarContext.tsx
  • frontend/src/features/problems/api/problemsApi.ts
  • frontend/src/features/problems/components/ProblemForm.module.css
  • frontend/src/features/problems/components/ProblemForm.tsx
  • frontend/src/features/problems/hooks/useProblems.ts
  • frontend/src/features/projects/components/ProjectForm.module.css
  • frontend/src/features/projects/components/ProjectForm.tsx
  • frontend/src/features/tags/api/tagsApi.ts
  • frontend/src/features/tags/hooks/useTags.ts
  • frontend/src/hooks/useAutoResize.ts
  • frontend/src/routes/__root.module.css
  • frontend/src/routes/projects.$projectId.module.css
  • frontend/src/types/api.ts

Comment thread frontend/src/components/ConfirmModal.module.css Outdated
Comment thread frontend/src/components/ConfirmModal.tsx Outdated
Comment thread frontend/src/components/ConfirmModal.tsx Outdated
Comment thread frontend/src/components/RootLayout.tsx
Comment thread frontend/src/features/problems/components/ProblemForm.module.css Outdated
Comment thread frontend/src/features/problems/components/ProblemForm.tsx Outdated
Comment thread frontend/src/features/problems/components/ProblemForm.tsx Outdated
Comment thread frontend/src/features/problems/components/ProblemForm.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Frontend Frontend feature or modification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant