mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 17:11:13 -05:00
Enhance moderation queue sorting with visual indicators and logging
Add loading spinners, detailed sort query logging, result preview logging, disable sort controls during loading, and mobile-specific loading text changes. Also, fix type mismatch in QueueSortControls and correct refresh strategy logic. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ef7037e7-a631-48a2-94d1-9a4b52d7c35a Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7cdf4e95-3f41-4180-b8e3-8ef56d032c0e/ef7037e7-a631-48a2-94d1-9a4b52d7c35a/kq6AhNt
This commit is contained in:
@@ -224,6 +224,12 @@ export function useModerationQueueManager(config: ModerationQueueManagerConfig):
|
||||
);
|
||||
|
||||
// CRITICAL: Multi-level ordering
|
||||
console.log('📊 [SORT QUERY] Applying multi-level sort:', {
|
||||
level1: 'escalated DESC',
|
||||
level2: `${sort.debouncedConfig.field} ${sort.debouncedConfig.direction.toUpperCase()}`,
|
||||
level3: sort.debouncedConfig.field !== 'created_at' ? 'created_at ASC' : 'none'
|
||||
});
|
||||
|
||||
// Level 1: Always sort by escalated first (descending)
|
||||
submissionsQuery = submissionsQuery.order('escalated', { ascending: false });
|
||||
|
||||
@@ -291,6 +297,17 @@ export function useModerationQueueManager(config: ModerationQueueManagerConfig):
|
||||
|
||||
if (submissionsError) throw submissionsError;
|
||||
|
||||
// Log the actual data returned to verify sort order
|
||||
if (submissions && submissions.length > 0) {
|
||||
const sortField = sort.debouncedConfig.field;
|
||||
const preview = submissions.slice(0, 3).map(s => ({
|
||||
id: s.id.substring(0, 8),
|
||||
[sortField]: s[sortField],
|
||||
escalated: s.escalated
|
||||
}));
|
||||
console.log(`📋 [SORT RESULT] First 3 items by ${sortField}:`, preview);
|
||||
}
|
||||
|
||||
// Fetch related profiles and entities
|
||||
const userIds = [
|
||||
...new Set([
|
||||
|
||||
Reference in New Issue
Block a user