Skip to content

Commit 3d4415d

Browse files
chandrasekharan-zipstackclaudecoderabbitai[bot]
authored
UN-2966 [FEAT] Auto-refresh and controls for execution logs (#1687)
* UN-2454 [FIX] Avoid polling infinitely for in-progress execution - Update DetailedLogs and ExecutionLogs components to properly handle polling state - Update index.js dependencies - Update workers dependencies in pyproject.toml and uv.lock 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]> * Revert accidental changes to index.js and workers dependencies Reverted files that were not part of the intended fix: - frontend/src/index.js - workers/pyproject.toml - workers/uv.lock 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * UN-2454 [FIX] Fix date handling and polling logic in logging components - Fixed date calculation bug: use raw ISO timestamps instead of formatted display strings - Added createdAtRaw and modified_atRaw fields to preserve parseable date values - Implement stale interval re-check: stop polling when execution is >1 hour old via executionDetailsRef - Replace forEach loops with for...of for improved performance (4 instances) Fixes CodeRabbit comments about infinite polling and ensures logging components correctly handle timestamp calculations and respect staleness thresholds. 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]> * Update frontend/src/components/logging/detailed-logs/DetailedLogs.jsx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Chandrasekharan M <[email protected]> * UN-2454 [FIX] Use isFinite() for robust date validation in logging components Replace isNaN() with isFinite() for date validation in ExecutionLogs and DetailedLogs to prevent infinite polling when invalid timestamps occur. - DetailedLogs.jsx: Changed isNaN() to isFinite() check - ExecutionLogs.jsx: Added missing isFinite() date validation 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]> * UN-2454 [FIX] Resolve stale closure bug in polling state management Use ref instead of state for pollingIds to prevent stale closure issues in polling logic: - Added pollingIdsRef to track actively polling execution IDs - Updated all polling operations to directly mutate ref (no re-renders needed) - Removed redundant pollingIds state to eliminate unnecessary re-renders - Prevents duplicate polling loops and potential memory leaks 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]> * minor: Addressed a code smell * wip: Refresh and data filter above table * UN-2966 [FEAT] Auto-refresh toggle and controls for execution logs - Add reusable LogsRefreshControls component (toggle + refresh button) - Move date picker from nav bar to content area in ExecutionLogs - Update DetailedLogs to use shared LogsRefreshControls component - Fix table height to fill available space using flexbox layout 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * UN-2966 [FEAT] Enhanced execution logs UI with improved layout and controls - Added sticky table header for better scrolling experience - Improved pagination positioning and styling with reduced padding - Enhanced table layout with scrollbar isolated to table body - Fixed layout spacing in DetailedLogs header with refresh controls - Updated CSS for better visual consistency across logs components 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]> * UN-2966 [REFACTOR] Clean up DetailedLogs layout and improve UI - Moved "View Logs" button from header to cards row for better layout - Kept LogsRefreshControls in header top-right - Changed "View Logs" from link to button with FileTextOutlined icon - Removed unnecessary .detailed-logs-header-controls wrapper div - Updated header padding and button margins for consistency - Fixed pagination label in LogsTable (items → executions) 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]> * UN-2966 [FEAT] Table layout, column visibility controls and pagination fixes for execution/detailed logs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * UN-2966 [REFACTOR] Improve DetailedLogs table column sizing with percentage-based widths - Implement responsive column widths using fixed px for predictable content - Status Message column gets 30% (most important variable content) - File Name gets 12%, File Path gets 20% for variable content - Reduced fixed columns: Executed At (140px), Status (110px), File Size (70px) - Execution Time (90px), Action (60px) for better space distribution - Added explanatory comment for width allocation strategy * UN-2966 [FEATURE] Add sorting and execution ID filter to logs - Add file_size and execution_time sorting to DetailedLogs and LogsTable - Add execution ID filter search to ExecutionLogs page - Implement field mapping for proper backend sort ordering - Update API filter backend with id field for search capability 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * UN-2966 [FIX] Resolve CodeRabbit review comments Fixed RangePicker null guard to prevent runtime errors on partial date selection. Removed unused createdAtRaw field from ExecutionLogs and DetailedLogs components. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * UN-2966 [FIX] Use UUIDFilter for execution id field Changed `id` filter from `CharFilter(lookup_expr="icontains")` to `UUIDFilter()` in ExecutionFilter. UUIDs don't support icontains lookup, so this fixes a potential FieldError. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * UN-2966 [FIX] Disable refresh controls when execution reaches terminal state - Added terminal state detection for COMPLETED/ERROR/STOPPED statuses - Auto-refresh automatically disables when execution completes - Refresh button and toggle are disabled with visual feedback - Tooltip shows execution completion message when disabled 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]> * UN-2966 [FIX] Add PropTypes validation for StatusMessageCell Added PropTypes import and validation for StatusMessageCell component's 'text' prop to resolve ESLint error and prevent potential runtime issues. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * UN-2966 [FIX] Address SonarQube code smells in logging components - ExecutionLogs.jsx: Use optional chaining (value?.[0]) for cleaner null checks - LogsTable.jsx: Extract inline components (SearchFilterDropdown, SearchFilterIcon) with proper PropTypes for reusability and maintainability 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]> * UN-2966 [FIX] Prevent Action column from being hidden in visibility menu Excluded "action" column from the visibility menu to prevent users from losing access to the column visibility dropdown. This ensures the Action column remains always visible, maintaining user ability to interact with the table controls. 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]> * UN-2966 [FIX] Add error handling for clipboard operations * UN-2966 [FIX] Mark StatusMessageCell text prop as required * UN-2966 [FIX] Add missing id dependency to useEffect * UN-2966 [REFACTOR] Move SearchFilterIcon inline style to CSS 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * UN-2966 [REFACTOR] Extract inline component definitions to module level - DetailedLogs.jsx: Extracted ActionColumnHeader component to module level - LogsTable.jsx: Removed unnecessary arrow function wrappers for filterDropdown and filterIcon - Resolves SonarQube code smell for inline component definitions 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]> * UN-2966 [REFACTOR] Remove unnecessary arrow function wrapper from title prop Simplified the title prop by removing redundant arrow function wrapper. The title prop accepts JSX elements directly, so the wrapper was unnecessary. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Signed-off-by: Chandrasekharan M <[email protected]> Co-authored-by: Claude <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent c59b5c3 commit 3d4415d

File tree

13 files changed

+658
-186
lines changed

13 files changed

+658
-186
lines changed

backend/workflow_manager/execution/filter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111

1212
class ExecutionFilter(filters.FilterSet):
13+
id = filters.UUIDFilter()
1314
execution_entity = filters.ChoiceFilter(
1415
choices=[
1516
(ExecutionEntity.API.value, "API"),

backend/workflow_manager/file_execution/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class FileCentricExecutionViewSet(viewsets.ReadOnlyModelViewSet):
1616
serializer_class = FileCentricExecutionSerializer
1717
pagination_class = CustomPagination
1818
filter_backends = [DjangoFilterBackend, OrderingFilter]
19-
ordering_fields = ["created_at", "execution_time"]
19+
ordering_fields = ["created_at", "execution_time", "file_size"]
2020
ordering = ["created_at"]
2121
filterset_class = FileExecutionFilter
2222

frontend/src/components/logging/detailed-logs/DetailedLogs.css

Lines changed: 140 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,67 @@
1+
/* Flexbox layout for responsive table */
2+
.detailed-logs-container {
3+
display: flex;
4+
flex-direction: column;
5+
height: 100%;
6+
overflow: hidden;
7+
}
8+
9+
.detailed-logs-header {
10+
flex: 0 0 auto;
11+
display: flex;
12+
justify-content: space-between;
13+
align-items: center;
14+
padding: 16px 24px;
15+
}
16+
17+
.detailed-logs-cards {
18+
flex: 0 0 auto;
19+
}
20+
21+
.detailed-logs-table-container {
22+
flex: 1;
23+
min-height: 0;
24+
padding: 0 12px 8px;
25+
display: flex;
26+
flex-direction: column;
27+
}
28+
29+
.detailed-logs-table-container .ant-table-wrapper {
30+
flex: 1;
31+
min-height: 0;
32+
display: flex;
33+
flex-direction: column;
34+
}
35+
36+
.detailed-logs-table-container .ant-spin-nested-loading,
37+
.detailed-logs-table-container .ant-spin-container {
38+
flex: 1;
39+
min-height: 0;
40+
display: flex;
41+
flex-direction: column;
42+
}
43+
44+
.detailed-logs-table-container .ant-table {
45+
flex: 1;
46+
min-height: 0;
47+
display: flex;
48+
flex-direction: column;
49+
overflow: auto;
50+
}
51+
52+
.detailed-logs-table-container .ant-table-container {
53+
flex: 1;
54+
min-height: 0;
55+
display: flex;
56+
flex-direction: column;
57+
}
58+
59+
.detailed-logs-table-container .ant-table-body {
60+
flex: 1;
61+
min-height: 0;
62+
overflow-y: auto !important;
63+
}
64+
165
.logging-card-title {
266
font-weight: 600;
367
font-size: 14px;
@@ -16,11 +80,50 @@
1680
}
1781

1882
.view-log-button {
19-
margin-right: 20px;
83+
margin-right: 24px;
84+
}
85+
86+
/* Action column header with settings icon */
87+
.action-column-header {
88+
display: flex;
89+
align-items: center;
90+
justify-content: space-evenly;
91+
width: 100%;
92+
}
93+
94+
.column-settings-trigger {
95+
display: flex;
96+
align-items: center;
97+
justify-content: center;
98+
cursor: pointer;
99+
border-radius: 4px;
100+
}
101+
102+
.column-settings-trigger:hover {
103+
background-color: rgba(0, 0, 0, 0.04);
104+
}
105+
106+
.column-settings-icon {
107+
font-size: 16px;
108+
color: rgba(0, 0, 0, 0.45);
109+
}
110+
111+
.column-settings-trigger:hover .column-settings-icon {
112+
color: #1677ff;
113+
}
114+
115+
/* Thin scrollbar */
116+
.detailed-logs-table-container .ant-table-body::-webkit-scrollbar {
117+
width: 6px;
118+
}
119+
120+
.detailed-logs-table-container .ant-table-body::-webkit-scrollbar-thumb {
121+
background: rgba(0, 0, 0, 0.2);
122+
border-radius: 3px;
20123
}
21124

22-
.column-filter-dropdown{
23-
margin-bottom: 20px;
125+
.detailed-logs-table-container .ant-table-body::-webkit-scrollbar-track {
126+
background: transparent;
24127
}
25128

26129
.search-container {
@@ -32,3 +135,37 @@
32135
margin-bottom: 8px;
33136
display: block;
34137
}
138+
139+
/* Fix cursor in pagination dropdown */
140+
.detailed-logs-table-container .ant-pagination-options .ant-select-selector {
141+
cursor: pointer;
142+
}
143+
144+
.detailed-logs-table-container
145+
.ant-pagination-options
146+
.ant-select-selection-item {
147+
cursor: pointer;
148+
}
149+
150+
/* Status message text with ellipsis */
151+
.status-message-text {
152+
display: block;
153+
overflow: hidden;
154+
text-overflow: ellipsis;
155+
white-space: nowrap;
156+
}
157+
158+
/* Outlined copy button style - matches LLM Profiles / API Deployments */
159+
.copy-btn-outlined {
160+
border: 1px solid #d9d9d9;
161+
background: #fff;
162+
color: rgba(0, 0, 0, 0.65);
163+
margin-left: 8px;
164+
height: auto;
165+
min-width: auto;
166+
}
167+
168+
.copy-btn-outlined:hover {
169+
border-color: #1677ff;
170+
color: #1677ff;
171+
}

0 commit comments

Comments
 (0)