Skip to content

feat(file): pair the Move File operand with a workspace file picker - #7459

Closed
icecrasher321 wants to merge 1 commit into
stagingfrom
file-move-picker
Closed

feat(file): pair the Move File operand with a workspace file picker#7459
icecrasher321 wants to merge 1 commit into
stagingfrom
file-move-picker

Conversation

@icecrasher321

Copy link
Copy Markdown
Collaborator

Summary

  • File block: the Move File operand is now a basic/advanced pair like every other single-file field on the block. Pick a workspace file, or switch to advanced and type a canonical file ID or a reference from an earlier block.
  • A picked file resolves to its ID inside the block, since every picker selection and in-place upload carries one. The move tool and its contract are unchanged. A file object without an ID, or more than one file, is refused with a message that names the remedy.
  • The typed field keeps its existing id, so saved workflows resolve to the advanced half unchanged.

Type of Change

  • New feature

Testing

  • type-check (apps/sim), lint, check:audits, check-block-registry, and docs-manifest:check pass
  • Added tests: the pair's shape, a picked file moving by its ID, a serialized single-ID list, refusal of multiple files, of an object without an ID, and of an empty operand. Block suites pass: 3 files, 195 tests

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)

🤖 Generated with Claude Code

@vercel

vercel Bot commented Sep 3, 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 3, 2026 9:46pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds a basic workspace-file picker alongside the advanced Move File ID field and normalizes the selected value to one canonical file ID. It also adds focused mapper and validation tests, but the new mapper key is not populated from the retained stored field id.

  • Adds a basic/advanced Move File operand pair.
  • Resolves picker objects and serialized single-ID lists while rejecting empty, ID-less, and multi-file values.
  • Updates the block input contract, canvas sentence, documentation, and tests.

Confidence Score: 4/5

This PR should not merge until saved and advanced-mode Move File values are mapped from moveFileId to the key consumed by the execution mapper.

The executor preserves stored parameter keys, while the changed mapper reads only moveFileInput, so existing Move File workflows carrying moveFileId fail before invoking the move operation.

Files Needing Attention: apps/sim/blocks/blocks/file.ts, apps/sim/blocks/blocks/file-folders.test.ts

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/file.ts Adds the paired Move File input and normalization, but breaks persisted and advanced-mode moveFileId values by reading only moveFileInput during execution.
apps/sim/blocks/blocks/file-folders.test.ts Adds useful shape and validation coverage, but bypasses persisted member-key serialization by passing moveFileInput directly.

Reviews (1): Last reviewed commit: "feat(file): pair the Move File operand w..." | Re-trigger Greptile

Comment on lines +2063 to +2065
const moveInput = params.moveFileInput
if (!moveInput) {
throw new Error('File is required for move')

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 Persisted move key is ignored

When a Move File value is stored under the retained moveFileId field, input resolution preserves that key but this mapper reads only moveFileInput, causing saved and advanced-mode workflows to throw “File is required for move” instead of moving the file.

Knowledge Base Used: Workflow authoring and rendering

@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 2 files

Confidence score: 3/5

  • In apps/sim/blocks/blocks/file.ts, moveFileInput silently moves only the first string ID when given a mixed array of IDs and file objects, so multi-file moves can be incomplete without an error; update the parser to reject mixed entries or count and process all normalized files.
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/blocks/blocks/file.ts">

<violation number="1" location="apps/sim/blocks/blocks/file.ts:2074">
P2: When `moveFileInput` contains a mixed array of IDs and file objects, this mapper silently moves only the first string ID instead of refusing multiple files. Make the array parser reject mixed entries or count all normalized file members before selecting an ID.</violation>
</file>

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

Fix all with cubic | Re-trigger cubic

* A file object without one is refused with the remedy rather than
* forwarded as a shape the contract rejects.
*/
const fileIds = parseReadFileIds(moveInput)

@cubic-dev-ai cubic-dev-ai Bot Sep 3, 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: When moveFileInput contains a mixed array of IDs and file objects, this mapper silently moves only the first string ID instead of refusing multiple files. Make the array parser reject mixed entries or count all normalized file members before selecting an ID.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/sim/blocks/blocks/file.ts, line 2074:

<comment>When `moveFileInput` contains a mixed array of IDs and file objects, this mapper silently moves only the first string ID instead of refusing multiple files. Make the array parser reject mixed entries or count all normalized file members before selecting an ID.</comment>

<file context>
@@ -2045,8 +2060,35 @@ export const FileV5Block: BlockConfig<FileParserV3Output> = {
+           * A file object without one is refused with the remedy rather than
+           * forwarded as a shape the contract rejects.
+           */
+          const fileIds = parseReadFileIds(moveInput)
+          if (Array.isArray(fileIds)) {
+            throw new Error('Move File accepts a single file at a time')
</file context>
Fix with cubic

@icecrasher321
icecrasher321 deleted the file-move-picker branch September 3, 2026 22:04
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