-
Notifications
You must be signed in to change notification settings - Fork 3.8k
feat(files): folder operations for the File block, and folders as scope #7377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c7d6a91
feat(files): folder operations for the File block, and folders as scope
mzxchandra ef927b1
Merge remote-tracking branch 'origin/staging' into feat/agent-folder-…
mzxchandra b5a77e3
test(files): cover the directory listing selector
mzxchandra e889505
fix(files): scope the single-file picker, and restore the v2 route
mzxchandra 35198ea
fix(files): reconnect folder scope to the operation that runs it
mzxchandra b9aeda4
fix(files): name folders in a workflow diff, and bound depth at the b…
mzxchandra 0878ae6
Merge remote-tracking branch 'origin/staging' into feat/agent-folder-…
mzxchandra d7388c6
fix(files): import the folder picker from the components barrel
mzxchandra e3de9a0
fix(files): resolve a named append inside the chosen folder
mzxchandra 94176fc
Merge remote-tracking branch 'origin/staging' into feat/agent-folder-…
mzxchandra 81e052d
fix(files): resolve an overwrite target by id, not a joined reference
mzxchandra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...l/components/editor/components/sub-block/components/sim-folder-tree-selector/selection.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| /** | ||
| * Reads a stored folder value into a canonical percent-encoded path. | ||
| * | ||
| * The picker stores a plain string, but the manual half of the pair is a text | ||
| * field, so a reference like `<block.folderPath>` resolves to a string before it | ||
| * gets here. A JSON array is tolerated because an earlier revision of this | ||
| * control stored one, and reading only its first entry is closer to the intent | ||
| * than discarding the value. | ||
| */ | ||
| export function readFolderPath(value: unknown): string { | ||
| if (typeof value === 'string') { | ||
| const trimmed = value.trim() | ||
| if (!trimmed) return '' | ||
| if (trimmed.startsWith('[')) { | ||
| try { | ||
| return readFolderPath(JSON.parse(trimmed)) | ||
| } catch { | ||
| return trimmed | ||
| } | ||
| } | ||
| return trimmed | ||
| } | ||
| if (Array.isArray(value)) { | ||
| const first = value.find((entry) => typeof entry === 'string' && entry.length > 0) | ||
| return typeof first === 'string' ? first : '' | ||
| } | ||
| return '' | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.