Merge Marcus's feat/org-project-routes onto staging's Project model · simstudioai/sim@abd0d0e · GitHub
Skip to content

Commit abd0d0e

Browse files
Merge Marcus's feat/org-project-routes onto staging's Project model
Brings in the 9 branch-only commits from origin/feat/org-project-routes (the first 14, the version diff and fork preview, landed on staging as #8455): Kept, rewired onto staging's Project API (/api/projects): - project view as a pane on organization Home, the redesigned Environments tab with promote/refresh, sync review, Chats section, composer, settings rendered in the pane - create a mapped secret from a fork sync (POST /api/workspaces/[id]/fork/mapping) - sub-agent activity and cited sources in chat - hide-chat / expand-pane toggle on the resource panel, combined with staging's compact layout Dropped in favour of staging's model: - the prototype project, project_workspace and copilot_chat_project tables (migrations 0389-0391 and the 0030 backfill), and the projects API built on them - project-scoped permission groups, credential groups, data retention and usage - chat project marks and the manual environment position - the older copies of dashboards, charts and the #8455 diff work - the single-environment invite modal, which changed inviting outside the flag Project rows archive the project through DELETE /api/projects/[id]; sync review compares through staging's comparison modal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lrd1NLD9qx2KBLVnw32c3E
2 parents 90086de + fb86acf commit abd0d0e

131 files changed

Lines changed: 4905 additions & 1782 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/sim/app/api/workspaces/[id]/fork/mapping/route.ts‎

Lines changed: 13 additions & 0 deletions
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { getWorkspaceSettingsNavigationContract } from '@/lib/api/contracts/workspace-settings'
2+
import {
3+
defineInternalJsonRoute,
4+
internalOrchestrationErrorPolicy,
5+
internalRateLimits,
6+
internalSessionAuth,
7+
} from '@/lib/api/server/routes'
8+
import {
9+
readWorkspaceSettingsNavigation,
10+
readWorkspaceSettingsNavigationOperation,
11+
} from '@/lib/settings/application/workspace-navigation'
12+
13+
export const GET = defineInternalJsonRoute({
14+
contract: getWorkspaceSettingsNavigationContract,
15+
auth: internalSessionAuth,
16+
operation: readWorkspaceSettingsNavigationOperation,
17+
rateLimit: internalRateLimits.none({
18+
reason: 'Read-only settings navigation, matching existing settings-page admission',
19+
}),
20+
errorPolicy: internalOrchestrationErrorPolicy,
21+
mapInput: ({ params }) => ({ workspaceId: params.id }),
22+
useCase: readWorkspaceSettingsNavigation,
23+
staticResponseHeaders: { 'Cache-Control': 'private, no-store' },
24+
})

‎apps/sim/app/o/[organizationId]/components/organization-sidebar/components/chats-section/chats-section.tsx‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use client'
22

3+
import type { ReactNode } from 'react'
34
import {
45
chipVariants,
56
cn,
@@ -28,6 +29,8 @@ import {
2829

2930
interface ChatRowProps {
3031
chat: OrganizationChat
32+
/** Shown before the title, such as the projects the chat worked in. */
33+
leading?: ReactNode
3134
isCurrentRoute: boolean
3235
isSelected: boolean
3336
isMenuOpen: boolean
@@ -39,6 +42,7 @@ interface ChatRowProps {
3942

4043
function ChatRow({
4144
chat,
45+
leading,
4246
isCurrentRoute,
4347
isSelected,
4448
isMenuOpen,
@@ -66,6 +70,7 @@ function ChatRow({
6670
onContextMenu={(e) => onContextMenu(e, chat.id)}
6771
onSelectChat={onSelectChat}
6872
>
73+
{leading}
6974
<OverflowText label={chat.name} className='flex-1 text-[var(--text-body)]' />
7075
<RowActions
7176
open={isMenuOpen}
@@ -103,6 +108,8 @@ interface ChatsSectionProps {
103108
isLoading: boolean
104109
isCollapsed: boolean
105110
pathname: string | null
111+
/** Renders before each chat's title; the org project view shows the chat's projects. */
112+
leadingFor?: (chat: OrganizationChat) => ReactNode
106113
}
107114

108115
export function ChatsSection({
@@ -111,6 +118,7 @@ export function ChatsSection({
111118
isLoading,
112119
isCollapsed,
113120
pathname,
121+
leadingFor,
114122
}: ChatsSectionProps) {
115123
const actions = useOrganizationChatActions({ organizationId, chats })
116124
const { menu, hover, rename, selectedChat, selectedChats, menuOpenChatId } = actions
@@ -140,7 +148,7 @@ export function ChatsSection({
140148
<CollapsedChatFlyoutItem
141149
key={chat.id}
142150
chat={chat}
143-
isCurrentRoute={pathname === chat.href}
151+
isCurrentRoute={pathname === chat.href.split('?')[0]}
144152
isSelected={selectedChats.size > 1 && selectedChats.has(chat.id)}
145153
onSelectChat={actions.handleChatClick}
146154
isMenuOpen={menuOpenChatId === chat.id}
@@ -184,7 +192,8 @@ export function ChatsSection({
184192
<ChatRow
185193
key={chat.id}
186194
chat={chat}
187-
isCurrentRoute={pathname === chat.href}
195+
leading={leadingFor?.(chat)}
196+
isCurrentRoute={pathname === chat.href.split('?')[0]}
188197
isSelected={selectedChats.size > 1 && selectedChats.has(chat.id)}
189198
isMenuOpen={menuOpenChatId === chat.id}
190199
onSelectChat={actions.handleChatClick}

‎apps/sim/app/o/[organizationId]/components/organization-sidebar/components/projects-section/project-row.tsx‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import {
2323
SquareArrowUpRight,
2424
Trash,
2525
} from '@sim/emcn/icons'
26-
import Link from 'next/link'
2726
import { IdentityTile } from '@/components/identity-tile/identity-tile'
27+
import { SettingsGuardedLink as Link } from '@/components/settings/settings-guarded-link'
2828
import { useProjectActions } from '@/app/o/[organizationId]/components/organization-sidebar/components/projects-section/use-project-actions'
2929
import type { ProjectDragProps } from '@/app/o/[organizationId]/components/organization-sidebar/components/projects-section/use-project-order'
3030
import type { Project } from '@/app/o/[organizationId]/p/hooks/use-projects'
@@ -44,12 +44,9 @@ interface ProjectRowProps {
4444
href: string
4545
newChatHref: string
4646
active: boolean
47-
/** Whether the chats under the row are shown; undefined when there are none to show. */
48-
expanded?: boolean
4947
railCollapsed: boolean
5048
drag: ProjectDragProps
5149
isAnyDragActive: boolean
52-
onToggleExpand: () => void
5350
}
5451

5552
/**
@@ -62,11 +59,9 @@ export function ProjectRow({
6259
href,
6360
newChatHref,
6461
active,
65-
expanded,
6662
railCollapsed,
6763
drag,
6864
isAnyDragActive,
69-
onToggleExpand,
7065
}: ProjectRowProps) {
7166
const actions = useProjectActions()
7267
const pinned = actions.isPinned(project)
@@ -172,13 +167,11 @@ export function ProjectRow({
172167
event.preventDefault()
173168
return
174169
}
175-
onToggleExpand()
176170
}}
177171
onDoubleClick={(event) => {
178172
event.preventDefault()
179173
if (project.canAdminister) rename.handleStartEdit()
180174
}}
181-
aria-expanded={expanded}
182175
className='flex min-w-0 flex-1 items-center gap-2'
183176
>
184177
<IdentityTile initial={project.name[0]} />
Lines changed: 28 additions & 106 deletions

0 commit comments

Comments
 (0)