Skip to content

fix(home): stop sidebar collapsing when artifact opens#3677

Merged
waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1/fix-sidebar-collapse
Mar 19, 2026
Merged

fix(home): stop sidebar collapsing when artifact opens#3677
waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1/fix-sidebar-collapse

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Stop auto-collapsing the sidebar when a new artifact opens in mothership chat
  • Removed sidebar toggle logic from handleResourceEvent in home.tsx

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Mar 19, 2026 6:45pm

Request Review

@cursor
Copy link

cursor bot commented Mar 19, 2026

PR Summary

Low Risk
Low risk UI behavior change limited to Home resource-open handling; removes an implicit sidebar toggle so layout state should no longer change unexpectedly when artifacts open.

Overview
Stops automatically collapsing the workspace sidebar when a mothership resource/artifact opens from chat.

handleResourceEvent in home.tsx now only expands the resource panel (if collapsed) and no longer reads/toggles useSidebarStore, preventing side effects on sidebar state.

Written by Cursor Bugbot for commit b342834. Configure here.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 19, 2026

Greptile Summary

This is a minimal, focused bug fix that removes the unintended side-effect of auto-collapsing the left sidebar whenever a new artifact (resource) was opened in the mothership chat panel.

Changes made:

  • Removed the two-line block inside handleResourceEvent that called useSidebarStore.getState() and conditionally called toggleCollapsed() to collapse the sidebar.
  • Removed the now-unused useSidebarStore import.

The remaining behavior of handleResourceEvent is preserved: if the resource panel is currently collapsed, it expands it (setIsResourceCollapsed(false)) and triggers the slide-in animation (startAnimatingIn()). The sidebar state is simply no longer touched during this flow.

Confidence Score: 5/5

  • Safe to merge — the change is a clean removal of an undesired side effect with no risk of regressions.
  • The diff removes exactly two lines of unintended behavior and one no-longer-needed import. The surrounding code remains functionally complete and correct. There is no new logic introduced, no shared state mismanagement, and no risk of breaking adjacent functionality.
  • No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/home/home.tsx Removes two lines from handleResourceEvent that were collapsing the sidebar whenever an artifact opened, and cleans up the now-unused useSidebarStore import. The remaining logic (expanding the resource panel and triggering the slide-in animation) is intact and correct.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Resource event fires] --> B{Is resource panel collapsed?}
    B -- Yes --> C[setIsResourceCollapsed false]
    C --> D[startAnimatingIn]
    D --> E[Resource panel slides in]
    B -- No --> F[No-op]

    style A fill:#4f46e5,color:#fff
    style E fill:#16a34a,color:#fff
    style F fill:#6b7280,color:#fff
Loading

Last reviewed commit: "fix(home): stop side..."

@waleedlatif1 waleedlatif1 merged commit 507954c into staging Mar 19, 2026
7 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/fix-sidebar-collapse branch March 19, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant