Skip to content

feat(suggestions): menu de ações (editar/excluir) no clique direito d…#395

Merged
GRHInvDev merged 1 commit into
mainfrom
388-intranet---regua-de-emocoes---correcoes
Jun 25, 2026
Merged

feat(suggestions): menu de ações (editar/excluir) no clique direito d…#395
GRHInvDev merged 1 commit into
mainfrom
388-intranet---regua-de-emocoes---correcoes

Conversation

@GRHInvDev

@GRHInvDev GRHInvDev commented Jun 25, 2026

Copy link
Copy Markdown
Owner

…o card

Clique direito sobre uma ideia no kanban admin abre um dialog enxuto com Editar ou Excluir (exclusão pede confirmação). Adiciona mutation deleteAdmin.

Summary by CodeRabbit

  • New Features

    • Admins can now open a context menu on suggestion cards to edit or delete them.
    • Added a confirmation flow for deleting suggestions, with loading feedback while the action is in progress.
  • Bug Fixes

    • Suggestion boards now refresh automatically after a delete action succeeds.
    • Error and success messages are shown for delete actions to improve feedback.
  • Chores

    • Updated the app version to 1.51.0.

…o card

Clique direito sobre uma ideia no kanban admin abre um dialog enxuto com
Editar ou Excluir (exclusão pede confirmação). Adiciona mutation deleteAdmin.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
elo Ready Ready Preview, Comment Jun 25, 2026 8:59pm

@GRHInvDev
GRHInvDev merged commit ce808f6 into main Jun 25, 2026
6 of 7 checks passed
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e70169d2-b527-411d-bcb4-7c1d284a040a

📥 Commits

Reviewing files that changed from the base of the PR and between 1f53f55 and a476454.

📒 Files selected for processing (5)
  • package.json
  • src/app/(authenticated)/admin/suggestions/page.tsx
  • src/components/admin/suggestion/idea-actions-dialog.tsx
  • src/components/admin/suggestion/suggestions-kanban-board.tsx
  • src/server/api/routers/suggestions.ts

📝 Walkthrough

Walkthrough

The package version was bumped to 1.51.0, and the admin suggestions flow now includes a context-menu actions dialog, delete handling, and page/router wiring for edit and delete actions.

Changes

Suggestion actions and deletion

Layer / File(s) Summary
Actions dialog component
src/components/admin/suggestion/idea-actions-dialog.tsx
The new dialog formats idea numbers, exposes controlled open state, and switches between action and delete-confirmation content with loading support.
Kanban context-menu wiring
src/components/admin/suggestion/suggestions-kanban-board.tsx
The kanban board accepts onContextMenuSuggestion and invokes it from card context-menu events after preventing the browser menu.
Delete mutation
src/server/api/routers/suggestions.ts
The suggestions router adds deleteAdmin, which deletes a suggestion by id and returns the deleted id.
Admin page orchestration
src/app/(authenticated)/admin/suggestions/page.tsx
The admin suggestions page imports IdeaActionsDialog, tracks the selected suggestion, opens the dialog from card context menus, calls deleteAdmin on confirm, and refetches the list after success.

Sequence Diagram(s)

sequenceDiagram
  participant Board as SuggestionsKanbanBoard
  participant Page as "src/app/(authenticated)/admin/suggestions/page.tsx"
  participant Dialog as IdeaActionsDialog
  participant Router as "suggestions.deleteAdmin"
  participant DB as "ctx.db.suggestion"
  Board->>Page: onContextMenuSuggestion(suggestion)
  Page->>Dialog: open selected suggestion
  Dialog->>Page: onDelete()
  Page->>Router: deleteAdmin({ id })
  Router->>DB: ctx.db.suggestion.delete(...)
  DB-->>Router: deleted record
  Router-->>Page: { success: true, id }
  Page->>Page: toast and refetch suggestions
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I hopped through menus, soft and sly,
Right-click, then "Edit" caught my eye.
"Delete" blinked, the dialog said,
Then refetch danced round my head. 🐰
Hop, hop—my whiskers fly!

✨ 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 388-intranet---regua-de-emocoes---correcoes

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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