fix(logs): close sidebar when selected log disappears from filtered list#4186
fix(logs): close sidebar when selected log disappears from filtered list#4186waleedlatif1 merged 1 commit intostagingfrom
Conversation
…ist + cleanup Derive sidebar open state from selection validity instead of using a separate useEffect. Also removes unnecessary useMemo/useCallback in non-memo'd components, replaces useEffect with render-time reset in dashboard, fixes CSS tokens, and adds hierarchical query key factory. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Refactors several logs-related components to remove unnecessary Also tweaks styling tokens in the dashboard Reviewed by Cursor Bugbot for commit f5d6b6f. Configure here. |
Greptile SummaryThis PR fixes a bug where the log details sidebar stayed open when the selected log was filtered out of the list. Instead of using a The cleanup work — removing Confidence Score: 5/5Safe to merge — bug fix is correct, all cleanup changes are mechanically sound. No P0 or P1 findings. The derived-state approach for effectiveSidebarOpen is the cleaner solution. The useCallback/useMemo removals are all in non-memo'd contexts (or inside memo'd components where the removed memos were never passed to child memo'd components). The render-time setState reset in dashboard.tsx follows the documented React pattern and avoids unnecessary resets on polling refreshes. The statsAll() key and partialize additions are straightforward improvements. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Filter changes] --> B{selectedLogIndex}
B -- "-1 (log not in list)" --> C[effectiveSidebarOpen = false]
B -- "≥ 0 (log in list)" --> D[effectiveSidebarOpen = isSidebarOpen]
C --> E[LogDetails isOpen=false\nSidebar visually closes]
D --> F{isSidebarOpen}
F -- true --> G[LogDetails isOpen=true\nSidebar stays open]
F -- false --> H[LogDetails isOpen=false\nSidebar stays closed]
E --> I[isSidebarOpen store value\nunchanged — context preserved]
I --> J{Filter cleared / log\nreappears in list}
J -- selectedLogIndex ≥ 0 --> G
Reviews (1): Last reviewed commit: "fix(logs): close sidebar when selected l..." | Re-trigger Greptile |
…mat, logs performance improvements fix(csp): add missing analytics domains, remove unsafe-eval, fix workspace CSP gap (#4179) fix(landing): return 404 for invalid dynamic route slugs (#4182) improvement(seo): optimize sitemaps, robots.txt, and core web vitals across sim and docs (#4170) fix(gemini): support structured output with tools on Gemini 3 models (#4184) feat(brightdata): add Bright Data integration with 8 tools (#4183) fix(mothership): fix superagent credentials (#4185) fix(logs): close sidebar when selected log disappears from filtered list; cleanup (#4186)
Summary
effectiveSidebarOpen) instead of a useEffect, avoiding extra render cycles and covering all filter-clearing paths.useMemoand 6useCallbackcalls from non-memo'd components in the logs module. Replaced a dashboarduseEffectstate reset with a render-time reset pattern. Fixed CSS variable token usage in the line chart. Added hierarchicalstatsAllkey to the React Query key factory. Addedpartializeto the log details UI store to prevent persisting transientisResizingstate.Test plan