Skip to content

Add org workspace tags and combine Files picker - #8304

Closed
BillLeoutsakosvl346 wants to merge 1 commit into
stagingfrom
codex/next-work-20260925
Closed

BillLeoutsakosvl346 wants to merge 1 commit into
stagingfrom
codex/next-work-20260925

Conversation

@BillLeoutsakosvl346

@BillLeoutsakosvl346 BillLeoutsakosvl346 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds workspace tags to organization Mothership chats through the existing + and @ pickers. The tag carries a stable workspace ID through drafts, queued sends, clipboard links, and persisted chat messages. Send-time context resolution authorizes each target through the existing workspace-target path and supplies the agent with the current workspace name and ID as a focus cue.

The organization picker shows files and file folders together in one flat Files submenu and one search section. Each row keeps its own resource kind and ID, with its workspace name alongside it. Workspace chats and other folder categories retain their existing behavior.

Implementation plan

  1. Reuse the organization workspace inventory and existing chip editor to insert workspace contexts.
  2. Extend the current request validation, chat context handling, and persistence path for stable workspace IDs.
  3. Resolve tags with the existing organization chat workspace authorization before building the agent prompt.
  4. Merge the two file resource kinds only in the org picker presentation, keeping selection and resource identity unchanged.

Verification

  • bun run type-check in apps/sim
  • bun run check:api-validation
  • Targeted chat tests: 3 files, 172 passing, including multiple tags, current-name resolution, stale/unauthorized IDs, and persistence.
  • Local org chat on port 3002: selected workspace via + and @, confirmed workspace/file/file-folder clipboard links retain distinct IDs, and confirmed a sent workspace tag persisted with its ID. The local agent response stops at the existing outbound Sim transport requirement (400), after the tag is accepted and stored.

Port 3001 was occupied by another local app, so this worktree ran on 3002. Screenshots use local demo data.

Screenshots

Organization resource menu

Organization resource menu

Combined Files submenu

Combined Files submenu

Workspace chip in composer

Workspace chip in composer

@vercel

vercel Bot commented Sep 25, 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 25, 2026 6:24pm UTC

Request Review

@BillLeoutsakosvl346
BillLeoutsakosvl346 marked this pull request as ready for review September 25, 2026 18:37

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 19 files

Confidence score: 3/5

  • In plus-menu-dropdown.tsx, flattening every foldered resource family removes folder navigation for tables, knowledge bases, and workflows in organization chats; preserve their tree sections.
  • In chip-clipboard-codec.ts, globally recognizing organization workspace links can activate unsupported contexts in ordinary workspace chats and cause send-time errors; scope workspace-link recognition to supported organization chats.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/plus-menu-dropdown/plus-menu-dropdown.tsx">

<violation number="1" location="apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/plus-menu-dropdown/plus-menu-dropdown.tsx:462">
P2: Organization chats now flatten every foldered resource family, so tables, knowledge bases, and workflows lose their existing folder navigation. Preserve their tree sections and apply the flat rendering only to the combined Files family.</violation>
</file>

<file name="apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/chip-clipboard-codec.ts">

<violation number="1" location="apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/chip-clipboard-codec.ts:26">
P2: This global addition lets organization workspace links become active contexts in ordinary workspace chats, where workspace-context processing is not supported and send-time errors are rethrown. Scope workspace-link rehydration to organization composers, or explicitly discard unsupported workspace links before sending.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

groups={
organizationId ? visibleResources.filter(isNativeResourceGroup) : visibleResources
}
flat={Boolean(organizationId)}

@cubic-dev-ai cubic-dev-ai Bot Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Organization chats now flatten every foldered resource family, so tables, knowledge bases, and workflows lose their existing folder navigation. Preserve their tree sections and apply the flat rendering only to the combined Files family.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/plus-menu-dropdown/plus-menu-dropdown.tsx, line 462:

<comment>Organization chats now flatten every foldered resource family, so tables, knowledge bases, and workflows lose their existing folder navigation. Preserve their tree sections and apply the flat rendering only to the combined Files family.</comment>

<file context>
@@ -405,21 +433,36 @@ export const PlusMenuDropdown = React.memo(
-                groups={
-                  organizationId ? visibleResources.filter(isNativeResourceGroup) : visibleResources
-                }
+                flat={Boolean(organizationId)}
+                combineFileFolders={Boolean(organizationId)}
+                sections={organizationId ? [] : treeSections}
</file context>
Fix with cubic

* no single portable id (an array / two ids / none) and degrade to plain text.
*/
const PORTABLE_KIND_TO_ID_FIELD = {
workspace: 'workspaceId',

@cubic-dev-ai cubic-dev-ai Bot Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This global addition lets organization workspace links become active contexts in ordinary workspace chats, where workspace-context processing is not supported and send-time errors are rethrown. Scope workspace-link rehydration to organization composers, or explicitly discard unsupported workspace links before sending.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/chip-clipboard-codec.ts, line 26:

<comment>This global addition lets organization workspace links become active contexts in ordinary workspace chats, where workspace-context processing is not supported and send-time errors are rethrown. Scope workspace-link rehydration to organization composers, or explicitly discard unsupported workspace links before sending.</comment>

<file context>
@@ -23,6 +23,7 @@ const CHIP_LINK_SCHEME = 'sim'
  * no single portable id (an array / two ids / none) and degrade to plain text.
  */
 const PORTABLE_KIND_TO_ID_FIELD = {
+  workspace: 'workspaceId',
   table: 'tableId',
   file: 'fileId',
</file context>
Fix with cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator

superseded by #8302

@greptile-apps

greptile-apps Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Adds workspace tags to chat contexts across the application.

The PR should not merge until pasted workspace tags no longer cause workspace-scoped sends to fail and the explicit menu-label requirement is satisfied.

Findings

  1. P1 Pasted tag blocks sending ▶
  2. P2 Other folder trees disappear ▶
  3. P2 Short searches match every workspace ▶
  4. P2 Workspace label bypasses menu component ▶

Summary

The PR adds ID-backed workspace mentions to organization chat, resolves their names and access at send time, and combines files with file folders in the organization picker.

  • Workspace IDs now round-trip through chips, handoffs, and persisted messages.
  • The picker changes also flatten other folder categories and produce overly broad short workspace searches.
  • A pasted workspace chip can block sending from a workspace-scoped chat.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Picker[Org picker or clipboard] --> Chip[Workspace chip with ID]
  Chip --> Send[Chat request]
  Send --> Resolve[Authorize workspace and load current name]
  Resolve --> Agent[Agent focus cue]
  Send --> Persist[Persisted message context]
Loading

Reviews (1) · Last reviewed commit: "feat(chat): add organization workspace t..."

Comment on lines +141 to +142
if (!organizationId || !chatId)
throw new OrchestrationError('validation', 'Workspace tags require an organization chat')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Pasted tag blocks sending

A workspace chip copied from an organization chat can be pasted into a workspace-scoped chat, where it appears as a valid chip. Sending that message then fails with “Workspace tags require an organization chat” because paste accepts the chip in any chat, but this server path rejects the entire turn. Reject the chip on paste or make the unsupported scope clear before send.

Knowledge Base Used: Web application and product surfaces

Comment on lines 461 to +465
<ResourceMenuSections
sections={treeSections}
groups={
organizationId ? visibleResources.filter(isNativeResourceGroup) : visibleResources
}
flat={Boolean(organizationId)}
combineFileFolders={Boolean(organizationId)}
sections={organizationId ? [] : treeSections}
groups={visibleResources}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Other folder trees disappear

The organization picker now passes no folder-tree sections for Tables, Knowledge bases, or Workflows. Browsing those categories shows flat items instead, so users lose the folder hierarchy and must look in a separate Folders list to select a folder. Preserve those categories’ folder browsing while combining the two file kinds.

Knowledge Base Used: Web application and product surfaces

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +214 to +217
.filter(
(workspace) =>
!q || workspace.name.toLowerCase().includes(q) || 'workspaces'.includes(q)
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Short searches match every workspace

Typing @w or @s matches every workspace because each letter occurs in “workspaces,” even when the workspace name does not match. Those unrelated rows appear before matching resources, making keyboard selection less reliable. Limit workspace matches to relevant names or a more precise category query.

) : (
<>
<Workspaces className='size-[14px] shrink-0 text-[var(--text-icon)]' />
<span className='truncate'>{item.name}</span>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Workspace label bypasses menu component

The new search row uses a truncated span for the workspace name beside its icon. The repository requires DropdownMenuItemLabel for ordinary menu labels beside icons, as the browse row already uses. Please satisfy that requirement before merging so long names also retain the shared label treatment.

Suggested change
<span className='truncate'>{item.name}</span>
<DropdownMenuItemLabel label={item.name} />

Context Used: Tailwind CSS and styling conventions (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@waleedlatif1
waleedlatif1 deleted the codex/next-work-20260925 branch September 25, 2026 23:06

This branch was previously deployed

1 inactive deployment
Preview — d489f795 Deployed Sep 25, 2026 by vercel[bot]
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.

2 participants