Skip to content

feat(files): add folder uploads, content search, and sharing - #8819

Open
waleedlatif1 wants to merge 6 commits into
stagingfrom
codex/files-folders-search-sharing
Open

waleedlatif1 wants to merge 6 commits into
stagingfrom
codex/files-folders-search-sharing

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add folder uploads through the picker and drag-and-drop, preserving nested paths and empty dropped folders with bounded, cancellable uploads.
  • Add indexed content search and public folder sharing with a paginated viewer, current-subtree access checks, and existing password, email, and SSO protection.
  • Add searchable child-folder navigation, collapse long paths, preserve ancestor drop targets, and keep header actions stable. Extend File v5 with folder sharing while preserving earlier block versions.
  • Harden cancellation on access changes, live share-policy and file checks, cached-view authorization, and shared input limits. Preserve rename drafts while navigating nested folders.

Type of Change

  • New feature
  • Bug fix

Testing

  • The earlier feature revision passed 39 real-browser checks across upload/navigation, search/workflows, and sharing, with JSON reports and Playwright traces.
  • Review fixes passed 72 PostgreSQL integration tests and 44 focused tests. Seven negative controls demonstrated the intended failures before restoring the guards. One optional search benchmark was skipped.
  • All current tests run in CI. CI has passed 13 Files browser checks on an earlier head, including directory round trips, queue cancellation, stable headers, and ancestor drops. Browser setup now waits for permission-backed readiness and instruments the actual native directory reader. The latest run exposed a disabled-to-enabled transition during the pixel baseline; baseline capture now waits for the control to be enabled while preserving the exact hover comparison. The complete browser run remains pending. Interrupted local runs are not counted as passing.
  • Lint, all 58 static audits, all 26 workspace type checks, generated artifacts, docs manifest, block registry, and pinned actionlint passed.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate; final CI pending)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@waleedlatif1
waleedlatif1 requested a review from a team as a code owner October 9, 2026 01:02
@vercel

vercel Bot commented Oct 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 Oct 9, 2026 3:40am UTC

Request Review

@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.

1 issue found across 82 files

Confidence score: 5/5

  • chunks.integration.ts doesn’t distinguish metadata from returned matches from metadata from all in-scope matched files, since only file-2 matches inside the folder scope. Add a case with another in-scope matched file that isn’t returned.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/lib/workspace-files/search/chunks.integration.ts">

<violation number="1" location="apps/sim/lib/workspace-files/search/chunks.integration.ts:611">
P3: This test never exercises the "only for returned matches" part of its claim: only file-2 has matches inside the folder scope, so projecting metadata from all in-scope matched files would produce the same `files` array as projecting from the single returned match. A regression that computes `files` from all matched rows (not `slice(0, maxResults)`) would pass this test. Add a second in-scope file (same workspace and folder) whose matches fall beyond `maxResults` and assert its metadata is absent; the probe orders candidates by `fileName`/`fileId`, so naming it e.g. `Z-Other.md` keeps file-2's matches returned first deterministically.</violation>
</file>

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/public-shares/access.ts Outdated
Comment thread apps/sim/app/workspace/[workspaceId]/files/hooks/use-file-uploads.ts Outdated
Comment thread packages/testing/src/mocks/public-shares.mock.ts Outdated
Comment thread apps/sim/lib/api/contracts/workspace-file-folder-upload.ts Outdated
Comment thread apps/sim/lib/public-shares/folder-reader.ts Outdated
Comment thread apps/sim/lib/api/contracts/tools/file.ts Outdated
Comment thread apps/sim/scripts/files-e2e/sharing.ts Outdated
Comment thread apps/sim/app/workspace/[workspaceId]/files/components/upload-menu.tsx Outdated
Comment thread .github/workflows/checks.yml
Comment thread apps/sim/lib/workspace-files/search/chunks.integration.ts Outdated
@greptile-apps

greptile-apps Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[High impact] Adds folder uploads, content search, and public folder sharing.

Add the required documentation on the new public-share APIs before merging.

Findings

  1. P2 Public APIs lack documentation ▶

Summary

This PR adds folder uploads, indexed content search, and public folder sharing. The latest revision waits for the upload menu to become enabled before comparing header screenshots.

  • The prior root picker, ancestor drop targets, canceled directory reads, and UploadMenu documentation are addressed in the current code.
  • waleedlatif1 retained the executor allowlist as an independent security check. greptile-apps[bot] accepted that explanation and withdrew the registry-test finding.
  • Add the missing TSDoc on the new public-share APIs before merging.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Picker[File or folder selection] --> Queue[Cancellable upload queue]
  Queue --> Prepare[Create folder tree]
  Prepare --> Upload[Upload files]
  Search[Content search] --> Index[Workspace file index]
  Visitor[Shared folder visitor] --> Auth[Check share access]
  Auth --> Scope[Check current folder scope]
  Scope --> Listing[Read one page or file]
Loading

Reviews (6) · Last reviewed commit: "fix(files): capture header baseline afte..." · Reviewed by Greptile

Comment thread apps/sim/lib/workspace-files/application/operations.test.ts Outdated
@waleedlatif1
waleedlatif1 force-pushed the codex/files-folders-search-sharing branch from 0cdff92 to 65e0eeb Compare October 9, 2026 01:47
@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 Oct 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.

@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.

All reported issues were addressed across 93 files

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

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/scripts/files-e2e/upload-lifecycle.ts
Comment thread apps/sim/lib/api/contracts/tools/file.ts Outdated
Comment thread apps/sim/lib/public-shares/folder-reader.ts Outdated
Comment thread .github/workflows/checks.yml Outdated
Comment thread apps/sim/lib/workspace-files/upload-folders.integration.ts Outdated
@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 Oct 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.

@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.

All reported issues were addressed across 93 files

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

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/scripts/files-e2e/sharing.ts
@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 Oct 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.

@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.

No issues found across 93 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@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 Oct 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.

@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.

No issues found across 93 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Turn on auto-fix | Re-trigger cubic

@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 Oct 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.

@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.

No issues found across 93 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Turn on auto-fix | Re-trigger cubic

})
}

export function usePublicSharedFile(token: string, fileId: string | null) {

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 Public APIs lack documentation

The new exported usePublicSharedFile hook has no TSDoc. CLAUDE.md requires TSDoc for exported APIs. Add a short declaration comment explaining the token-scoped file lookup and when it runs. The new exported PublicShareAccessError class in access.ts also needs a declaration comment. This repository requirement must be satisfied before merging.

Context Used: CLAUDE.md (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!

This branch was previously deployed

1 inactive deployment
Preview — 10169828 Deployed Oct 9, 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.

1 participant