GeezerVison is showing github.com — fix(logs): close sidebar when selected log disappears from filtered list by waleedlatif1 · Pull Request #4186 · simstudioai/sim
Conversation
Summary
- Bug fix: Sidebar now closes automatically when the selected log disappears from the filtered list (e.g., clearing an execution ID filter). Uses derived state (
effectiveSidebarOpen) instead of a useEffect, avoiding extra render cycles and covering all filter-clearing paths.
- Cleanup: Removed 12 unnecessary
useMemo and 6 useCallback calls from non-memo'd components in the logs module. Replaced a dashboard useEffect state reset with a render-time reset pattern. Fixed CSS variable token usage in the line chart. Added hierarchical statsAll key to the React Query key factory. Added partialize to the log details UI store to prevent persisting transient isResizing state.
Test plan
- Open logs page, select a log to open the sidebar
- Apply an execution ID filter, then clear it — sidebar should close
- Apply status/workflow filters, select a log, clear filters — sidebar should close if log is no longer in list
- Verify sidebar resize still works and persists width across reloads
- Verify dashboard chart segment selection resets when filters change
- Verify notification workflow selector still works
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
greptile-apps[bot] reacted with thumbs up emoji
…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 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
| Project |
Deployment |
Actions |
Updated (UTC) |
| docs |
Skipped |
|
Apr 15, 2026 7:49pm |

|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
cursor
Bot
commented
Apr 15, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
PR Summary
Medium Risk
Touches logs selection/sidebar visibility and dashboard segment-selection reset behavior; the new render-time reset logic and derived sidebar state could cause subtle UI regressions if conditions are miscomputed.
Overview
Fixes a logs UX bug by deriving effectiveSidebarOpen so the details sidebar automatically closes when the currently selected log is no longer present in the filtered/sorted list.
Refactors several logs-related components to remove unnecessary useMemo/useCallback usage and simplifies a few computed values, and changes the dashboard segment-selection reset from an effect to a key-based synchronous reset.
Also tweaks styling tokens in the dashboard LineChart, adds a hierarchical React Query key (logKeys.statsAll) for stats invalidation, and updates the persisted log-details UI store to only persist panelWidth (excluding transient isResizing).
Reviewed by Cursor Bugbot for commit f5d6b6f. Configure here.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Greptile Summary
This 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 useEffect to dispatch a close action, it derives effectiveSidebarOpen as isSidebarOpen && selectedLogIndex !== -1, which is simpler and covers all filter-clearing paths in a single expression.
The cleanup work — removing useMemo/useCallback from non-memo'd components, converting the dashboard's useEffect segment-reset to a render-time state update, adding partialize to prevent isResizing from persisting, aligning CSS variable tokens in the line chart, and adding a statsAll() prefix key for targeted invalidation — is all mechanically correct.
Confidence Score: 5/5
Safe 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
| Filename |
Overview |
| apps/sim/app/workspace/[workspaceId]/logs/logs.tsx |
Core bug fix via effectiveSidebarOpen derived state + mass removal of useMemo/useCallback from non-memo'd LogsFilterPanel; all logic is correct. |
| apps/sim/app/workspace/[workspaceId]/logs/components/dashboard/dashboard.tsx |
Replaces useEffect with render-time setState reset; valid React pattern, correctly prevents re-renders when only stat values (not workflow IDs) change. |
| apps/sim/app/workspace/[workspaceId]/logs/components/logs-list/logs-list.tsx |
Removes useCallback for DOM-only event handlers inside memo'd LogRow; safe because the custom comparator independently governs re-render decisions. |
| apps/sim/hooks/queries/logs.ts |
Adds statsAll() prefix key and updates useCancelExecution to use it; hierarchical invalidation is now correct and targeted. |
| apps/sim/stores/logs/store.ts |
Adds partialize to exclude transient isResizing from localStorage persistence; correct fix. |
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
Loading
Reviews (1): Last reviewed commit: "fix(logs): close sidebar when selected l..." | Re-trigger Greptile
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Sg312
added a commit
that referenced
this pull request
Apr 15, 2026
…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)
This branch was previously deployed
1 inactive
deployment
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|