feat: data table improvements — SLA column, pagination, column resize, ordinal dates

- Call Recordings: pagination (15/page), column toggle, sortable SLA/duration/date, ordinal dates, SSE refresh
- Missed Calls: full rewrite matching data table pattern (pagination, column toggle, sort, SLA from entity)
- Call History: SLA column from entity field
- Table component: ResizableTableContainer + ColumnResizer for all tables
- Date formatting: formatDateOrdinal utility (1st April, 2nd March, etc.)
- SLA reads from platform call.sla field (seeded for 200 records)
- AI button long-press triggers OTP-gated cache clear for re-analysis

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-01 16:51:45 +05:30
parent b90740e009
commit 4f5370abdc
8 changed files with 461 additions and 160 deletions

View File

@@ -35,6 +35,11 @@ const MAINT_ACTIONS: Record<string, MaintAction> = {
description: 'Delete all imported leads from a selected campaign. For testing only.',
needsPreStep: true,
},
clearAnalysisCache: {
endpoint: 'clear-analysis-cache',
label: 'Regenerate AI Analysis',
description: 'Clear all cached recording analyses. Next AI click will re-transcribe and re-analyze.',
},
};
export const useMaintShortcuts = () => {
@@ -51,6 +56,16 @@ export const useMaintShortcuts = () => {
setActiveAction(null);
}, []);
// Listen for programmatic triggers (e.g., long-press on AI button)
useEffect(() => {
const maintHandler = (e: CustomEvent<string>) => {
const action = MAINT_ACTIONS[e.detail];
if (action) openAction(action);
};
window.addEventListener('maint:trigger', maintHandler as EventListener);
return () => window.removeEventListener('maint:trigger', maintHandler as EventListener);
}, [openAction]);
useEffect(() => {
const handler = (e: KeyboardEvent) => {
if (e.ctrlKey && e.shiftKey && e.key === 'R') {
@@ -79,5 +94,5 @@ export const useMaintShortcuts = () => {
return () => window.removeEventListener('keydown', handler);
}, [openAction]);
return { isOpen, activeAction, close };
return { isOpen, activeAction, close, openAction, actions: MAINT_ACTIONS };
};