feat: stabilize WebSocket connections by using memoized filter objects in LiveLogViewer

This commit is contained in:
GitHub Actions
2025-12-16 06:10:34 +00:00
parent 67d671bc0c
commit 90ee8c7f83
3 changed files with 412 additions and 168 deletions

View File

@@ -134,9 +134,13 @@ const getLevelColor = (level: string): string => {
return 'text-gray-300';
};
// Stable default filter objects to prevent useEffect re-triggers on parent re-render
const EMPTY_LIVE_FILTER: LiveLogFilter = {};
const EMPTY_SECURITY_FILTER: SecurityLogFilter = {};
export function LiveLogViewer({
filters = {},
securityFilters = {},
filters = EMPTY_LIVE_FILTER,
securityFilters = EMPTY_SECURITY_FILTER,
mode = 'security',
maxLogs = 500,
className = '',