GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(files): folders, multiselect, vfs update by icecrasher321 · Pull Request #4572 · simstudioai/sim

Conversation

@icecrasher321

@icecrasher321 icecrasher321 commented May 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary

Add folders, multiselect for files, update VFS to work with this.

Type of Change

  • New feature

Testing

Tested manually

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)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot] reacted with thumbs up emoji jasonhokinlove-design reacted with laugh emoji
All reactions
  • 👍 1 reaction
  • 😄 1 reaction
@vercel

vercel Bot commented May 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment May 15, 2026 6:02pm

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cursor

cursor Bot commented May 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

PR Summary

Medium Risk
Medium risk: adds new workspace file folder APIs (move/bulk delete/download) and refactors multiple existing routes to call orchestration helpers, which could change behavior/error mapping across files, workflows, schedules, credentials, and MCP server management.

Overview
Adds workspace file folders + multi-select operations: new APIs to create/list/update/delete/restore file folders, move and bulk-archive file/folder selections, and download selected files/folders as a capped ZIP; upload/presign/register flows now accept folderId, and internal file-manage tooling supports path-based folder creation plus a move operation.

Refactors several existing endpoints (credentials, folders, workflows, schedules jobs, tables/knowledge/workflow restore, and mcp server/tool routes) to delegate logic to perform* orchestration functions with standardized error-code-to-HTTP mapping, updating/adding tests accordingly.

Improves UI/accessibility by adding ModalDescription to multiple modals, and enhances the Resource table component with shift/meta selection support, optional row drag/drop hooks, leading header actions, and percentage-based column sizing; adds new files UI components for a floating selection action bar and delete confirmation modal.

Reviewed by Cursor Bugbot for commit 62393f2. Configure here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vercel
vercel Bot deployed to Preview May 12, 2026 21:49
View deployment
@greptile-apps

greptile-apps Bot commented May 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds folder support and multiselect to the workspace files UI, introducing a new workspace_file_folders table, folder CRUD/move/restore API routes, a bulk-archive endpoint, a ZIP download endpoint, and updates the VFS to correctly group files under folder paths.

  • Schema: Adds workspace_file_folders with a self-referential FK (SET NULL on delete) and replaces the flat workspace-file unique-name constraint with a folder-scoped partial unique index.
  • API routes: New endpoints for folder CRUD (/folders, /folders/[folderId], /folders/[folderId]/restore), bulk archive (/bulk-archive), move (/move), and ZIP download (/download); advisory-lock transactions guard all mutation paths.
  • VFS: materializeFiles now embeds folder paths into VFS paths and returns folderPath as a separate field so buildWorkspaceMd grouping works correctly; archived file folders are surfaced in recently-deleted.

Confidence Score: 4/5

The change is broadly well-constructed; one route handler maps a new error thrown by the folder-validation helper to the wrong HTTP status code.

The register route now passes folderId to registerUploadedWorkspaceFile, which calls assertWorkspaceFileFolderTarget. When the folder has been deleted between the presign and register steps, that helper throws 'Target folder not found' — but the catch block only maps 'not found in storage' to 404, so this new error surfaces as a 500. Every other new route in this PR handles the same error class cleanly.

apps/sim/app/api/workspaces/[id]/files/register/route.ts — the catch block needs to cover the new 'Target folder not found' error path introduced by the folder-aware registration flow.

Important Files Changed

Filename Overview
apps/sim/app/api/workspaces/[id]/files/register/route.ts Added folderId passthrough to registerUploadedWorkspaceFile, but the catch block does not map the new 'Target folder not found' error to a 400/404 — instead it falls through to 500.
apps/sim/lib/uploads/contexts/workspace/workspace-file-folder-manager.ts New core manager for workspace file folders; implements advisory-lock-protected transactions for create/move/archive/restore with well-structured path resolution via buildWorkspaceFileFolderPathMap.
apps/sim/app/api/workspaces/[id]/files/download/route.ts New ZIP download endpoint with path deduplication, size/file-count guards, and sanitized zip paths; catch block correctly returns a hardcoded 'Internal server error'.
apps/sim/lib/workspace-files/orchestration/file-folder-lifecycle.ts New orchestration layer for folder CRUD/move/restore operations with consistent typed-error-to-HTTP-code mapping; 23505 and domain error types all handled cleanly.
packages/db/schema.ts Adds workspace_file_folders table with self-referential FK (SET NULL on delete), partial unique index on active folders, and replaces the workspace-scoped file name unique constraint with a folder-scoped one.
apps/sim/app/api/workspaces/[id]/files/move/route.ts New move endpoint; delegates to performMoveWorkspaceFileItems which catches conflict/not-found/validation errors and maps them to correct HTTP status codes.
apps/sim/lib/copilot/vfs/workspace-vfs.ts VFS now materializes files under folder-path prefixes and exposes folderPath as a separate field so buildWorkspaceMd grouping logic works correctly; archived file folders are also included in recently-deleted.

Comments Outside Diff (1)

  1. apps/sim/app/api/workspaces/[id]/files/register/route.ts, line 90-100 (link)

    P1 Invalid folderId returns 500 instead of 400

    registerUploadedWorkspaceFile now calls assertWorkspaceFileFolderTarget, which throws new Error('Target folder not found') when the folder ID doesn't exist or was deleted between the presign and register steps. The catch block only matches isMissing on 'not found in storage', so 'Target folder not found' falls through to status = 500, returning an internal error code for what is a client-supplied bad value. A status: 400 (or 404) with that message is the correct response here.

Reviews (18): Last reviewed commit: "fix mcp server error code" | Re-trigger Greptile

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot]
greptile-apps Bot reviewed May 12, 2026
View reviewed changes
Comment thread apps/sim/lib/uploads/contexts/workspace/workspace-file-folder-manager.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/lib/uploads/contexts/workspace/workspace-file-folder-manager.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/app/api/workspaces/[id]/files/move/route.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/lib/uploads/contexts/workspace/workspace-file-folder-manager.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/lib/uploads/contexts/workspace/workspace-file-folder-manager.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/db/schema.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed May 12, 2026
View reviewed changes
Comment thread apps/sim/app/workspace/[workspaceId]/files/files.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/app/workspace/[workspaceId]/files/files.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

@icecrasher321

icecrasher321 commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@icecrasher321

icecrasher321 commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

bugbot run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vercel
vercel Bot deployed to Preview May 12, 2026 22:24
View deployment
greptile-apps[bot]
greptile-apps Bot reviewed May 12, 2026
View reviewed changes
Comment thread apps/sim/lib/uploads/contexts/workspace/workspace-file-folder-manager.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed May 12, 2026
View reviewed changes
Comment thread apps/sim/app/workspace/[workspaceId]/files/files.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/hooks/queries/workspace-file-folders.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/lib/uploads/client/download.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@vercel
vercel Bot temporarily deployed to Preview May 12, 2026 22:38 Inactive
@icecrasher321

icecrasher321 commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@icecrasher321

icecrasher321 commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

bugbot run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed May 12, 2026
View reviewed changes
Comment thread apps/sim/lib/uploads/contexts/workspace/workspace-file-manager.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot]
greptile-apps Bot reviewed May 12, 2026
View reviewed changes
Comment thread apps/sim/lib/uploads/contexts/workspace/workspace-file-folder-manager.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/app/api/workspaces/[id]/files/folders/[folderId]/route.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@vercel
vercel Bot temporarily deployed to Preview May 12, 2026 23:51 Inactive
@icecrasher321

icecrasher321 commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@icecrasher321

icecrasher321 commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

bugbot run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed May 13, 2026
View reviewed changes
Comment thread apps/sim/app/workspace/[workspaceId]/files/files.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/app/api/workspaces/[id]/files/download/route.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/lib/uploads/contexts/workspace/workspace-file-manager.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@vercel
vercel Bot temporarily deployed to Preview May 13, 2026 01:54 Inactive
@icecrasher321

icecrasher321 commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

bugbot run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@icecrasher321

icecrasher321 commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed May 13, 2026
View reviewed changes
Comment thread apps/sim/app/workspace/[workspaceId]/files/files.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/app/workspace/[workspaceId]/files/files.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/app/api/workspaces/[id]/files/download/route.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@vercel
vercel Bot temporarily deployed to Preview May 13, 2026 02:10 Inactive
@icecrasher321

icecrasher321 commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

bugbot run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@icecrasher321

icecrasher321 commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed May 13, 2026
View reviewed changes
Comment thread apps/sim/app/workspace/[workspaceId]/files/files.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/lib/uploads/contexts/workspace/workspace-file-manager.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@icecrasher321

icecrasher321 commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

bugbot run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vercel
vercel Bot temporarily deployed to Preview May 13, 2026 02:21 Inactive
greptile-apps[bot]
greptile-apps Bot reviewed May 15, 2026
View reviewed changes
Comment thread apps/sim/app/api/workspaces/[id]/files/download/route.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed May 15, 2026
View reviewed changes
Comment thread apps/sim/app/api/mcp/servers/route.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/app/api/folders/route.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Vikhyath Mondreti
address comments
c1ee62f
@vercel
vercel Bot temporarily deployed to Preview May 15, 2026 06:13 Inactive
@icecrasher321

icecrasher321 commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

bugbot run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@icecrasher321

icecrasher321 commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed May 15, 2026
View reviewed changes
Comment thread apps/sim/app/workspace/[workspaceId]/components/resource/resource.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/app/api/folders/route.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Vikhyath Mondreti
improve error codes
a3d1010
@vercel
vercel Bot temporarily deployed to Preview May 15, 2026 06:30 Inactive
@icecrasher321

icecrasher321 commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

bugbot run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@icecrasher321

icecrasher321 commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed May 15, 2026
View reviewed changes
Comment thread apps/sim/app/api/workspaces/[id]/files/folders/[folderId]/restore/route.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Vikhyath Mondreti
address comments
b468c00
@vercel
vercel Bot temporarily deployed to Preview May 15, 2026 16:48 Inactive
@icecrasher321

icecrasher321 commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

bugbot run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@icecrasher321

icecrasher321 commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed May 15, 2026
View reviewed changes
Comment thread apps/sim/app/api/schedules/[id]/route.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/app/workspace/[workspaceId]/components/resource/resource.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Vikhyath Mondreti
address more nits
b1f1881
@vercel
vercel Bot temporarily deployed to Preview May 15, 2026 17:10 Inactive
@icecrasher321

icecrasher321 commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

bugbot run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed May 15, 2026
View reviewed changes
Comment thread apps/sim/app/api/mcp/servers/route.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Vikhyath Mondreti
fix mcp server error code
62393f2
@vercel
vercel Bot temporarily deployed to Preview May 15, 2026 17:21 Inactive
@icecrasher321

icecrasher321 commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

bugbot run

cursor[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@icecrasher321

icecrasher321 commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed May 15, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 62393f2. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Vikhyath Mondreti
Merge branch 'staging' into feat/workspace-files-folders
78b2fed
@vercel
vercel Bot deployed to Preview May 15, 2026 18:02
View deployment
@icecrasher321
icecrasher321 merged commit c9118e7 into staging May 15, 2026
13 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1
waleedlatif1 deleted the feat/workspace-files-folders branch May 15, 2026 20:09

This branch was successfully deployed

1 active deployment
Preview — 78b2fed2 Deployed May 15, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@waleedlatif1 waleedlatif1 waleedlatif1 left review comments
@greptile-apps greptile-apps[bot] greptile-apps[bot] left review comments
@cursor cursor[bot] cursor[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@icecrasher321 @waleedlatif1 @TheodoreSpeaks
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.