diff --git a/.replit b/.replit index f1bbfc88..409cff57 100644 --- a/.replit +++ b/.replit @@ -41,3 +41,7 @@ externalPort = 3000 [[ports]] localPort = 37143 externalPort = 3001 + +[[ports]] +localPort = 41349 +externalPort = 3002 diff --git a/replit.md b/replit.md index 485a4abd..963eec01 100644 --- a/replit.md +++ b/replit.md @@ -5,6 +5,12 @@ ThrillWiki is a community-driven web application for discovering, reviewing, and ## Recent Changes **October 2025 - Critical Bug Fixes & Stability Improvements (Latest)** +- **Moderation Queue Sorting Enhancement**: Enhanced sorting controls with visual loading indicators and diagnostic logging: + - Added animated spinners to sort controls (label and direction button) during data fetch operations + - Added comprehensive logging to track multi-level sort queries (escalated DESC → user-selected sort → created_at tertiary) + - Added detailed result preview logging showing first 3 items with sort field values for debugging + - Disabled sort controls during loading to prevent duplicate requests + - Mobile-specific loading text changes from "Ascending/Descending" to "Loading..." for clarity - **Moderation Queue Sorting Fix**: Resolved sorting controls not updating the UI by fixing type mismatch in QueueSortControls (Radix Select passes string, handler expected SortField) and correcting refresh strategy logic (user-initiated sort/filter changes now bypass "notify" freeze mode and always update display) - **Auth Loading State Fix**: Resolved perpetual loading state issue in auth buttons by simplifying useAuth hook's loading state management, removing blocking conditional logic, adding explicit setLoading(false) calls in all code paths, and ensuring pending email state cleanup occurs before early returns - **React Hooks Violation Fix**: Resolved critical hooks ordering issue in useSearch that caused app crashes during hot module reload (HMR) by using stable useMemo with entire options object as dependency diff --git a/src/components/moderation/ModerationQueue.tsx b/src/components/moderation/ModerationQueue.tsx index bb1703a3..90ed51b5 100644 --- a/src/components/moderation/ModerationQueue.tsx +++ b/src/components/moderation/ModerationQueue.tsx @@ -114,6 +114,7 @@ export const ModerationQueue = forwardRef((props, ref) => { activeStatusFilter={queueManager.filters.statusFilter} sortConfig={queueManager.sort.config} isMobile={isMobile} + isLoading={queueManager.loadingState === 'loading'} onEntityFilterChange={queueManager.filters.setEntityFilter} onStatusFilterChange={queueManager.filters.setStatusFilter} onSortChange={queueManager.sort.setConfig} diff --git a/src/components/moderation/QueueFilters.tsx b/src/components/moderation/QueueFilters.tsx index c98f8b3f..8e068276 100644 --- a/src/components/moderation/QueueFilters.tsx +++ b/src/components/moderation/QueueFilters.tsx @@ -10,6 +10,7 @@ interface QueueFiltersProps { activeStatusFilter: StatusFilter; sortConfig: SortConfig; isMobile: boolean; + isLoading?: boolean; onEntityFilterChange: (filter: EntityFilter) => void; onStatusFilterChange: (filter: StatusFilter) => void; onSortChange: (config: SortConfig) => void; @@ -31,6 +32,7 @@ export const QueueFilters = ({ activeStatusFilter, sortConfig, isMobile, + isLoading = false, onEntityFilterChange, onStatusFilterChange, onSortChange, @@ -118,6 +120,7 @@ export const QueueFilters = ({ sortConfig={sortConfig} onSortChange={onSortChange} isMobile={isMobile} + isLoading={isLoading} /> diff --git a/src/components/moderation/QueueSortControls.tsx b/src/components/moderation/QueueSortControls.tsx index b0ae3c8f..0a6975ad 100644 --- a/src/components/moderation/QueueSortControls.tsx +++ b/src/components/moderation/QueueSortControls.tsx @@ -1,4 +1,4 @@ -import { ArrowUp, ArrowDown } from 'lucide-react'; +import { ArrowUp, ArrowDown, Loader2 } from 'lucide-react'; import { Label } from '@/components/ui/label'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; import { Button } from '@/components/ui/button'; @@ -8,6 +8,7 @@ interface QueueSortControlsProps { sortConfig: SortConfig; onSortChange: (config: SortConfig) => void; isMobile: boolean; + isLoading?: boolean; } const SORT_FIELD_LABELS: Record = { @@ -19,7 +20,8 @@ const SORT_FIELD_LABELS: Record = { export const QueueSortControls = ({ sortConfig, onSortChange, - isMobile + isMobile, + isLoading = false }: QueueSortControlsProps) => { const handleFieldChange = (value: string) => { const validFields: SortField[] = ['created_at', 'submission_type', 'status']; @@ -48,14 +50,16 @@ export const QueueSortControls = ({ return (
-