Skip to content

fix(ui): resource ui fixes#4113

Merged
TheodoreSpeaks merged 1 commit intodevfrom
fix/resource-opening
Apr 11, 2026
Merged

fix(ui): resource ui fixes#4113
TheodoreSpeaks merged 1 commit intodevfrom
fix/resource-opening

Conversation

@TheodoreSpeaks
Copy link
Copy Markdown
Collaborator

Summary

  • Deleting an "@"ed resource shouldn't remove it from the resource bar.
    handled by completely removing on context remove for resource (deleting resource tab functionality remains unchanged)
  • Opening the resource tab, then starting new task shouldn't reopen the resource view since there's no resources.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • Tested locally

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)

Screenshots/Videos

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 11, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 11, 2026 10:54pm

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 11, 2026

PR Summary

Low Risk
Low risk UI-state changes limited to the home chat view, mainly altering when the resource panel collapses and when resources are removed from the bar.

Overview
Fixes resource sidebar behavior in the Home chat view by stopping context deletions from removing resources (removes onContextRemove wiring that previously called removeResource).

Also resets/collapses the resource panel when no resolvedChatId is present (e.g., starting a new task) by clearing the stored resize width and forcing the panel collapsed state.

Reviewed by Cursor Bugbot for commit 7952f53. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 11, 2026

Greptile Summary

This PR fixes two related UI bugs in the Home component's resource panel behavior: (1) removing an @-mentioned context from the input no longer removes it from the resource bar (done by simply not passing onContextRemove to MothershipChat/UserInput), and (2) navigating to a new task now collapses the resource panel by adding an else branch to the resolvedChatId effect.

Confidence Score: 5/5

Safe to merge — both fixes are minimal, targeted, and don't introduce new side effects.

The two changes are narrow: omitting a previously-wired callback (fixing an over-eager resource removal) and adding an else-branch to collapse the panel on new-task navigation. Both are guarded by existing state/ref checks that prevent unintended re-expansion. No P0/P1 findings.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/home/home.tsx Two targeted bug fixes: onContextRemove no longer wired to removeResource, and resolvedChatId effect now collapses the resource panel when the chat ID is null (new task).

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[resolvedChatId changes] --> B{resolvedChatId truthy?}
    B -->|Yes| C[markRead]
    B -->|No - New Task| D[clearWidth + setIsResourceCollapsed true]

    E[resources array changes] --> F{resources.length > 0 AND panel collapsed?}
    F -->|Yes| G[Expand panel, skip transition animation]
    F -->|No| H[No-op]

    I[User removes @-context from input] --> J{onContextRemove passed?}
    J -->|Previously: Yes| K[removeResource called - BUG FIXED]
    J -->|Now: undefined| L[No-op - resource stays in bar]
Loading

Reviews (1): Last reviewed commit: "fix(ui): dont delete resource on clearin..." | Re-trigger Greptile

@TheodoreSpeaks TheodoreSpeaks merged commit 833f132 into dev Apr 11, 2026
14 checks passed
@TheodoreSpeaks TheodoreSpeaks deleted the fix/resource-opening branch April 11, 2026 23:14
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