Skip to content

fix(organizations): align sidebar loading and chat actions - #7691

Merged
waleedlatif1 merged 2 commits into
stagingfrom
codex/org-sidebar-prefetch
Sep 9, 2026
Merged

fix(organizations): align sidebar loading and chat actions#7691
waleedlatif1 merged 2 commits into
stagingfrom
codex/org-sidebar-prefetch

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Hydrate organization chats and workspaces before rendering the sidebar, using the existing query keys and authorized reads. Preserve client recovery and default workspace creation.
  • Match workspace chat actions with inline rename, pin/unpin, read/unread, and See more controls in the organization sidebar. Reuse the existing menus and collapsed flyout.
  • Prevent closing context menus from stealing focus from inline rename during their exit animation.

Type of Change

  • Bug fix

Testing

  • 134 targeted tests passed across organization/workspace layouts, sidebar interactions, and chat APIs, including rename rollback, menu focus, and active-chat visibility across pagination.
  • Browser checks verified server-rendered lists without duplicate hydration requests, rename persistence, pin/read actions, collapsed-menu focus, pagination, and workspace navigation.
  • Type checking, lint, all 46 repository audits, block registry validation, and docs manifest checks passed. No migrations changed.

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

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 9, 2026 10:44pm UTC

Request Review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@greptile-apps

greptile-apps Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR hydrates organization sidebar data before rendering, adds workspace-style chat actions and pagination, and prevents an exiting context menu from taking focus away from inline rename.

  • Prefetches authorized organization chats, active workspaces, and the viewer profile under existing React Query keys.
  • Adds rename, pin/unpin, read/unread, copy-link, and open-in-new-tab actions to organization chats.
  • Preserves the active chat in paginated history and resets local state when switching organizations.
  • Makes closing context menus inert during exit animation to preserve rename focus.
  • Extracts workspace-list seeding for reuse while leaving empty lists uncached so client-side default workspace creation still runs.

Confidence Score: 5/5

The PR appears safe to merge; the two previous sidebar-pagination findings are resolved and no new actionable defect remains.

The active route now determines the minimum visible chat range, and keying OrganizationChats by organization resets pagination and interaction state across organization navigation. Hydration preserves existing query keys and leaves failed or empty optional prefetches available to client recovery.

Important Files Changed

Filename Overview
apps/sim/app/o/[organizationId]/layout.tsx Waits for authorized organization-sidebar data before serializing the hydration state.
apps/sim/app/o/[organizationId]/prefetch.ts Prefetches organization chats, workspaces, and profile data using existing client cache keys.
apps/sim/app/o/[organizationId]/components/organization-sidebar/components/chats-section/chats-section.tsx Adds paginated chat rendering, keeps the routed chat visible, and integrates inline actions.
apps/sim/app/o/[organizationId]/components/organization-sidebar/hooks/use-organization-chat-actions.ts Coordinates organization chat menus, optimistic mutations, inline rename, and link actions.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workflow-list/components/context-menu/context-menu.tsx Supports copy-link actions and makes closed menu content inert during its exit animation.
apps/sim/lib/workspaces/seed-workspace-list.ts Extracts reusable workspace-list seeding while preserving client recovery for empty or failed reads.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Authorized organization layout] --> B[Prefetch organization chats]
    A --> C[Seed non-empty workspace list]
    A --> D[Prefetch viewer profile]
    B --> E[React Query dehydration]
    C --> E
    D --> E
    E --> F[Hydrated organization sidebar]
    F --> G[Chat pagination and route visibility]
    F --> H[Rename, pin, and read actions]
Loading

Reviews (2): Last reviewed commit: "fix(organizations): preserve chat contex..." | Re-trigger Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@waleedlatif1
waleedlatif1 merged commit a89b158 into staging Sep 9, 2026
34 checks passed
@waleedlatif1
waleedlatif1 deleted the codex/org-sidebar-prefetch branch September 9, 2026 22:49
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