()
| 206 | * @returns The logs page view with table and sidebar details |
| 207 | */ |
| 208 | export default function Logs() { |
| 209 | const params = useParams() |
| 210 | const workspaceId = params.workspaceId as string |
| 211 | |
| 212 | const { |
| 213 | timeRange, |
| 214 | startDate, |
| 215 | endDate, |
| 216 | level, |
| 217 | workflowIds, |
| 218 | folderIds, |
| 219 | setWorkflowIds, |
| 220 | searchQuery: urlSearchQuery, |
| 221 | setSearchQuery: setUrlSearchQuery, |
| 222 | triggers, |
| 223 | resetFilters, |
| 224 | setLevel, |
| 225 | setFolderIds, |
| 226 | setTriggers, |
| 227 | setTimeRange, |
| 228 | setDateRange, |
| 229 | clearDateRange, |
| 230 | } = useLogFilters() |
| 231 | |
| 232 | const viewMode = useFilterStore((s) => s.viewMode) |
| 233 | const setViewMode = useFilterStore((s) => s.setViewMode) |
| 234 | |
| 235 | const [{ selectedLogId, isSidebarOpen }, dispatch] = useReducer(logSelectionReducer, { |
| 236 | selectedLogId: null, |
| 237 | isSidebarOpen: false, |
| 238 | }) |
| 239 | |
| 240 | const [executionId] = useQueryState(executionIdParam.key, executionIdParam.parser) |
| 241 | const [pendingExecutionId, setPendingExecutionId] = useState<string | null>(() => executionId) |
| 242 | |
| 243 | /** |
| 244 | * The log-details `tab` param is owned/written by the details panel, but the |
| 245 | * orchestrator must clear it when the panel closes so a lingering `?tab=trace` |
| 246 | * never carries over to the next log opened from the list. |
| 247 | */ |
| 248 | const [, setLogDetailsTab] = useQueryState(logDetailsTabParam.key, { |
| 249 | ...logDetailsTabParam.parser, |
| 250 | ...logDetailsTabUrlKeys, |
| 251 | }) |
| 252 | |
| 253 | /** |
| 254 | * `urlSearchQuery` is the instant nuqs value (its URL write is debounced inside |
| 255 | * `useLogFilters`); the query/filtering still debounce off it to avoid |
| 256 | * per-keystroke fetches. |
| 257 | */ |
| 258 | const debouncedSearchQuery = useDebounce(urlSearchQuery, 300) |
| 259 | |
| 260 | const isLive = true |
| 261 | const [isVisuallyRefreshing, setIsVisuallyRefreshing] = useState(false) |
| 262 | const [isExporting, setIsExporting] = useState(false) |
| 263 | const refreshTimersRef = useRef(new Set<number>()) |
| 264 | const logsRef = useRef<WorkflowLogSummary[]>([]) |
| 265 | const selectedLogIndexRef = useRef(-1) |
nothing calls this directly
no test coverage detected