Uh oh!
There was an error while loading. Please reload this page.
Add ticket archiving with separate archive view and restore functiona… - #26
Conversation
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 46 minutes and 8 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR adds ticket archiving end-to-end: DB schema and statements include an archived_at column and archived-aware queries; a migration and registry entry are added; backend routes provide GET /archived, POST /:id/archive, and POST /:id/unarchive with validation and WebSocket broadcasts; frontend types and api.tickets gain archive/unarchive/listArchived methods; the zustand store manages archivedTickets with optimistic archive/unarchive actions and fetch/open/close controls; UI adds an Archive button, per-ticket archive action, and an ArchiveDrawer component. Poem
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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/backend/db/migrations/registry.ts`:
- Around line 12-25: The registry imports and references a non-existent
migration m011 (import m011 from "./011_add_archive.ts") and then includes m011
in the exported migrations array, causing TS2307; either add a new migration
file named 011_add_archive.ts that exports the migration (matching the expected
symbol m011), or remove/update the import line and the m011 entry from the
migrations array in the file so the list only contains existing migration
symbols (e.g., adjust the import/export to match actual migration filenames and
exported names).
In `@src/backend/routes/tickets.ts`:
- Around line 180-211: The archive/unarchive routes must perform guarded updates
atomically instead of check-then-update: change the SQL used by
ticketStmts.archive.run to include a WHERE id = $id AND archivedAt IS NULL and
ticketStmts.unarchive.run to include WHERE id = $id AND archivedAt IS NOT NULL;
after calling run check the returned changes/lastID metadata (e.g.
result.changes) and if it's 0 re-fetch the row via ticketStmts.get.get(id) and
return 404 if missing or 409 if present but in the wrong state; only fetch and
return the updated row and broadcast when the update affected >0 rows.
Reference: app.post("/:id/archive"), app.post("/:id/unarchive"),
ticketStmts.archive.run, ticketStmts.unarchive.run, ticketStmts.get.get,
ticketStmts.list.all.
In `@src/frontend/App.tsx`:
- Line 4: The import of ArchiveDrawer in App.tsx is unresolved (TS2307); open
the component source (look for files named ArchiveDrawer.tsx,
ArchiveDrawer/index.tsx, or an archive drawer component) and either correct the
import path in App.tsx to the actual module location (e.g.,
./components/archive/ArchiveDrawer or ./components/ArchiveDrawer/index) or
update the component module to export a named export ArchiveDrawer (or change
the import to a default import) so that the symbol ArchiveDrawer referenced in
App.tsx matches the module's actual export.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 93dd17a8-e69c-467c-bceb-8091fbb4790b
📒 Files selected for processing (9)
src/backend/db/database.tssrc/backend/db/migrations/registry.tssrc/backend/routes/tickets.tssrc/common/types.tssrc/frontend/App.tsxsrc/frontend/components/kanban-board/TicketCard.tsxsrc/frontend/components/layout/Header.tsxsrc/frontend/lib/api.tssrc/frontend/store/store.ts
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/frontend/components/ArchiveDrawer.tsx`:
- Around line 24-45: The ArchiveDrawer renders a modal-like UI but lacks dialog
semantics and the icon-only close button has no accessible name; update the
drawer container in the ArchiveDrawer component to include role="dialog" and
aria-modal="true" and add an aria-labelledby that points to the header title
element (give the header title span a stable id), and give the close <button>
(the one using onClose and the X icon) an accessible name (e.g.,
aria-label="Close archive" or visually hidden text) so screen readers can
identify it.
- Around line 74-77: The Restore control in ArchiveDrawer (the element with
data-id={ticket.id} and onClick={handleUnarchive}) is hidden via "opacity-0
group-hover:opacity-100" and isn’t keyboard-accessible; update its
markup/classes so it becomes visible and focusable for keyboard users: make it a
semantic <button> (or add tabIndex={0} if changing element type is not possible)
and add focus-visible:opacity-100 and focus-within:opacity-100 (or
focus:opacity-100) to the className alongside the existing group-hover rule so
the control is revealed on keyboard focus and works with handleUnarchive.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 106d9ad3-4807-41f7-b71a-fef396b7a252
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (2)
src/backend/db/migrations/011_add_archive.tssrc/frontend/components/ArchiveDrawer.tsx
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Add ticket archiving with separate archive view and restore functionality
Summary by CodeRabbit
New Features
Chores