akseljoonas HF Staff commited on
Commit
70d2074
·
1 Parent(s): 13c9630

Fix stuck 'Waiting for approval' spinner and improve table rendering

Browse files

Clear waiting-approval activity status immediately when user approves,
instead of waiting for the backend's tool_state_change event over SSE.

Improve markdown table styles: horizontal overflow scroll, header
background, better padding, and alternating row striping.

frontend/src/components/Chat/MarkdownContent.tsx CHANGED
@@ -70,16 +70,30 @@ const markdownSx: SxProps<Theme> = {
70
  width: '100%',
71
  my: 2,
72
  fontSize: '0.85rem',
 
 
 
 
 
 
 
73
  },
74
  '& th': {
75
  borderBottom: '2px solid var(--border-hover)',
 
76
  textAlign: 'left',
77
- p: 1,
 
78
  fontWeight: 600,
 
79
  },
80
  '& td': {
81
  borderBottom: '1px solid var(--tool-border)',
82
- p: 1,
 
 
 
 
83
  },
84
 
85
  '& hr': {
 
70
  width: '100%',
71
  my: 2,
72
  fontSize: '0.85rem',
73
+ display: 'block',
74
+ overflowX: 'auto',
75
+ WebkitOverflowScrolling: 'touch',
76
+ },
77
+ '& thead': {
78
+ position: 'sticky',
79
+ top: 0,
80
  },
81
  '& th': {
82
  borderBottom: '2px solid var(--border-hover)',
83
+ bgcolor: 'var(--hover-bg)',
84
  textAlign: 'left',
85
+ px: 1.5,
86
+ py: 0.75,
87
  fontWeight: 600,
88
+ whiteSpace: 'nowrap',
89
  },
90
  '& td': {
91
  borderBottom: '1px solid var(--tool-border)',
92
+ px: 1.5,
93
+ py: 0.75,
94
+ },
95
+ '& tr:nth-of-type(even) td': {
96
+ bgcolor: 'color-mix(in srgb, var(--hover-bg) 50%, transparent)',
97
  },
98
 
99
  '& hr': {
frontend/src/hooks/useAgentChat.ts CHANGED
@@ -651,7 +651,10 @@ export function useAgentChat({ sessionId, isActive, onReady, onError, onSessionD
651
  setNeedsAttention(sessionId, false);
652
  const hasApproved = approvals.some(a => a.approved);
653
  if (hasApproved) {
654
- updateSession(sessionId, { isProcessing: true });
 
 
 
655
  }
656
 
657
  // Persist updated tool states so a page refresh during execution
 
651
  setNeedsAttention(sessionId, false);
652
  const hasApproved = approvals.some(a => a.approved);
653
  if (hasApproved) {
654
+ updateSession(sessionId, {
655
+ isProcessing: true,
656
+ activityStatus: { type: 'thinking' },
657
+ });
658
  }
659
 
660
  // Persist updated tool states so a page refresh during execution