feat(ticketing): complete V2 ticketing system rebuild#112
Open
TristanHourtoulle wants to merge 37 commits intodevfrom
Open
feat(ticketing): complete V2 ticketing system rebuild#112TristanHourtoulle wants to merge 37 commits intodevfrom
TristanHourtoulle wants to merge 37 commits intodevfrom
Conversation
Remove all frontend ticketing code (types, services, hooks, components, pages, tests, docs) and clean up references in navigation, toasts, and role permissions. This clears the way for the TICKETING-V2 rebuild. Closes TRI-85
…tilities for V2 Lay the frontend foundations for the ticketing V2 system: - Types and interfaces aligned with backend MongoDB schemas - Zod validation schemas for ticket and message creation forms - File utilities for validation, image compression, and Base64 conversion
…ons for V2 Implements the full service layer with CRUD operations, admin endpoints, config hook for ticket metadata, and French toast translations.
…dependencies - Add JSDoc to useTicketConfig and useTicketService custom hooks - Add axios status/statusText logging in logError per service-logging standard - Use useRef for ticketService to stabilize fetchConfigs/refetch references
…file upload - tests/unit/services/ticket.test.ts: 12 tests for all service methods - tests/unit/hooks/useTicketConfig.test.ts: 7 tests for config fetching, filtering, refetch - tests/unit/lib/file-upload.test.ts: 12 tests for validation, compression, base64 conversion
Create 7 components for the ticket conversation UI (TRI-97): - AttachmentPreview: image thumbnail with lightbox, document card with download - MessageBubble: 4 visual styles (own/admin/internal/system) - MessageThread: scrollable list with date separators, auto-scroll, internal filtering - MessageInput: auto-resize textarea, file attachments, admin visibility toggle - TicketHeader: back link, reference copy, status/priority badges, reopen button - TicketSidebar: metadata, timestamps, collapsible status history - Barrel index.ts for all ticket component exports
…layout Create /tickets/[id] page (TRI-96) with: - Ticket fetch by reference/ID + message polling every 20s - Two-column layout: conversation left, metadata sidebar right - Mobile responsive: sidebar collapses to Sheet drawer - Description block with attachment thumbnails - Loading skeletons and not-found empty state - Reopen action with toast feedback
…page Extract ticket creation form from modal into a full page with: - Back button, card-wrapped form, cancel/submit buttons - Navigate from /support to /support/new instead of opening dialog - Remove skeleton flickering on search by tracking initial load state
…ency color coding - Replace Radix Select with Popover+Command combobox for all 4 filters - Redesign search bar with visible icon, focus ring, and clear button - Add URGENCY_COLORS mapping (gray/amber/orange/red) for ticket cards
…bility - Add scrollbar-gutter: stable on html to prevent shift when Radix locks scroll - Remove height constraint on Select viewport that caused layout issues - Increase search icon opacity in CommandInput from 50 to 70
…ce for V2 Includes modified hooks, schemas, file upload utils, and service layer needed by the new ticketing UI components and pages.
…lities Tests for FileDropzone, StatusBadge, TicketCard, TicketEmptyState, TicketStatsBar, TypeCardGrid, and useDraftPersistence hook.
Adds FileDropzone, StatusBadge, TicketCardSkeleton, TicketEmptyState, TicketStatsBar, and TypeCardGrid components used across support pages.
… admin controls Implements TRI-100 (shared helpers) and TRI-99 (admin sidebar controls). Adds PopulatedUser/AdminUser types, getAdminUsers service, admin toasts, and editable status/priority/assignee/tags controls in the ticket sidebar.
Replace inline date formatting, permission checks, and populated field resolvers with imports from lib/utils/ticket-helpers.
…arams, and admin sidebar link
…filters, and updatedAt sort - New TicketPagination component with page numbers, jump-to-page, configurable page size (10/20/50) - Support page: all filters (type, category, urgency) now sent to backend instead of client-side filtering - Both pages: state synced to URL search params (page, limit, filters, sort) for bookmarkable/shareable URLs - Default sort changed from createdAt to updatedAt (most recently updated first) - Smooth scroll-to-top on page/filter/sort changes - Blue-600 gradient theme matching site design
…on in ticket sidebar
…ities Strengthen Record types with union keys (TicketStatus, TicketType, etc.), move filter interfaces and defaults into lib/constants/ticket.ts, and extract pagination helpers into a dedicated utility module.
Move message submission from MessageInput into useTicket hook, extract admin ticket controls from sidebar into dedicated component, and update all pages/components to use centralized filter constants and pagination.
Replace form.watch subscription with useRef-based debounce to prevent stale closure issues and ensure proper cleanup on unmount.
Cast unknown status/type values in tests to match strengthened union types and fix expected API payloads for updateTicket and bulkUpdate.
Coverage Report
File Coverage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete rebuild of the ticketing system (V2) from scratch. Replaces the old monolithic ticketing code with a clean architecture: typed service layer, domain hooks, modular UI components, admin dashboard, and comprehensive unit tests.
Type of Change
Changes Overview
Foundation
lib/types/ticket.ts,lib/schemas/ticket.ts,lib/utils/file-upload.ts)lib/constants/ticket.ts)lib/utils/ticket-helpers.ts)Service Layer
useTicketService()hook with 14 typed methods returningApiResult<T>(services/ticket.ts)lib/toast.ts)Domain Hooks
useTicket()— single ticket detail: fetch, messages, polling with Page Visibility API, reopen, optimistic updates (hooks/useTicket.ts)useTicketList()— user ticket listing: filters, pagination, URL sync, debounced search (hooks/useTicketList.ts)useTicketConfig()— dynamic config fetching with active filter and sort (hooks/useTicketConfig.ts)useAdminTickets()— admin dashboard state: filters, sorting, selection, bulk ops (hooks/useAdminTickets.ts)useDraftPersistence()— localStorage draft auto-save for ticket creation form (hooks/useDraftPersistence.ts)User Pages
/support— ticket list with filters, search, pagination, unread indicators/support/new— ticket creation form with React Hook Form + Zod, type card grid, file dropzone, draft persistence/tickets/[id]— two-column conversation layout with message polling, sidebar, mobile SheetAdmin Pages
/admin/tickets— admin dashboard with stats bar, data table, bulk actions, quick row updatesUI Components (16 components)
message-thread,message-bubble(4 variants),message-inputticket-card,ticket-header,ticket-sidebar(with admin controls),status-badgefile-dropzone,type-card-grid,ticket-filters,ticket-paginationticket-empty-state,ticket-card-skeleton,ticket-stats-bar,attachment-previewadmin-ticket-table,admin-stats-bar,admin-ticket-filters,admin-bulk-toolbarUnit Tests (47+ new tests across 12 files)
Technical Details
Files Changed: ~67 files
Main Areas:
hooks/— 5 new domain hookscomponents/ticket/— 16 new UI components + 4 admin componentsservices/ticket.ts— complete service rewrite withApiResult<T>patternlib/— types, schemas, constants, utilitiestests/unit/— 12 test filesTesting
npx vitest run)npx tsc --noEmit)Breaking Changes
useTickethook replaced with new implementation (different API surface)Deployment Notes
TRI-89) before first use