refactor: clean up project route - [INS-2051]#9635
Conversation
✅ Circular References ReportGenerated at: 2026-02-12T08:34:41.989Z Summary
Click to view all circular references in PR (76)Click to view all circular references in base branch (76)Analysis✅ No Change: This PR does not introduce or remove any circular references. This report was generated automatically by comparing against the |
There was a problem hiding this comment.
Pull request overview
This PR refactors the organization/project sidebar UI by extracting the organization picker and project list/filter UI into dedicated reusable components, simplifying the organization/project index route and reusing the same sidebar implementation in both the project index and project detail routes.
Changes:
- Added reusable
OrganizationSelectcomponent for organization switching. - Added reusable
ProjectListSidebarcomponent for project filtering/list + navigation. - Simplified
organization.$organizationId.project._index.tsxloader/UI and centralizedgetProjectsWithGitRepositoriesinorganization.$organizationId.project.$projectId._index.tsx.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/insomnia/src/ui/components/project/project-list-sidebar.tsx | New extracted sidebar project list/filter component used by multiple routes. |
| packages/insomnia/src/ui/components/project/organization-select.tsx | New extracted organization selection component used by multiple routes. |
| packages/insomnia/src/routes/organization.$organizationId.project._index.tsx | Refactored org/project index route to use extracted sidebar components and simplified loader. |
| packages/insomnia/src/routes/organization.$organizationId.project.$projectId._index.tsx | Reuses extracted sidebar components and exports getProjectsWithGitRepositories for sharing. |
Comments suppressed due to low confidence (1)
packages/insomnia/src/routes/organization.$organizationId.project.$projectId._index.tsx:625
projectsWithPresenceis mapped for all projects and filtering now happens insideProjectListSidebar. When a user types a filter, this still recomputes presence for every project (each one filteringpresence), which can be noticeably more work than the previousfilter(...).map(...)approach. Consider lifting the filter state up so you can filter before computing presence, or moving the presence mapping into the sidebar so it can operate on the already-filtered list.
const projectsWithPresence = projects.map(project => {
const projectPresence = presence
.filter(p => p.project === project.remoteId)
.filter(p => p.acct !== userSession.accountId)
.map(user => {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request refactors the organization and project sidebar in the main organization/project index route. The sidebar logic and UI for organization selection and project listing/filtering have been extracted into new dedicated components, improving code modularity and maintainability. Filtering logic has been moved, and related imports have been updated to reflect these changes.
Sidebar refactor and component extraction:
OrganizationSelectcomponent (organization-select.tsx), replacing the previous inline implementation in the main route file. [1] [2]ProjectListSidebarcomponent (project-list-sidebar.tsx), removing the inline project filter and project list code from the main route file. [1] [2] [3] [4]Code cleanup and import updates:
organization.$organizationId.project.$projectId._index.tsxto reflect the new component structure. [1] [2] [3] [4]getProjectsWithGitRepositoriesfrom the main route file, keeping only the correct version. [1] [2]