Repository navigation
fix(web): dropped folders become path chips on the local environment and are refused on remote ones #12001
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
Merged
juliusmarminge
merged 11 commits into
pingdotgg:main
from
SunkenInTime:devin/1789516908-skip-folder-drops
Sep 16, 2026
Merged
fix(web): dropped folders become path chips on the local environment and are refused on remote ones #12001
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
486a1b7
fix(web): skip dropped folders instead of staging failed attachments
SunkenInTime b410b97
fix(web): dropped folders become path chips locally and are refused o…
SunkenInTime 801ee7c
fix(web): tolerate desktop builds without getPathForFile
SunkenInTime d411e74
fix(web): terminate dropped folder link so it renders as a chip
SunkenInTime fd560a7
test(desktop): update preload verifier fixture for file paths
SunkenInTime de6143a
fix(web): keep folder-drop environment values fresh in composer handle
SunkenInTime b105cf3
test(web): cover remaining remote folder-drop conditions
SunkenInTime 5b9c90a
fix(web): resolve dropped folders in local environments
SunkenInTime 584f546
fix(web): keep dropped folders bound to their draft
SunkenInTime cb1ecc4
fix(web): plain remote folder-drop message
SunkenInTime 98515c4
fix(web): never guess a dropped folder's path in the browser
SunkenInTime 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
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
|
macroscopeapp[bot] marked this conversation as resolved.
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| import { describe, expect, it } from "@effect/vitest"; | ||
| import { EnvironmentId } from "@t3tools/contracts"; | ||
| import { folderDropTarget, resolveDroppedFolderPath } from "./folderDrop"; | ||
|
|
||
| const environmentId = EnvironmentId.make("environment-1"); | ||
|
|
||
| describe("folderDropTarget", () => { | ||
| it("targets local when the thread is on the primary environment", () => { | ||
| expect( | ||
| folderDropTarget({ | ||
| localEnvironmentDisabled: false, | ||
| environmentId, | ||
| primaryEnvironmentId: environmentId, | ||
| }), | ||
| ).toBe("local"); | ||
| }); | ||
|
|
||
| it("targets remote when Electron has no local environment", () => { | ||
| expect( | ||
| folderDropTarget({ | ||
| localEnvironmentDisabled: true, | ||
| environmentId, | ||
| primaryEnvironmentId: environmentId, | ||
| }), | ||
| ).toBe("remote"); | ||
| }); | ||
|
|
||
| it("targets remote when the thread lives on another environment", () => { | ||
| expect( | ||
| folderDropTarget({ | ||
| localEnvironmentDisabled: false, | ||
| environmentId: EnvironmentId.make("environment-2"), | ||
| primaryEnvironmentId: environmentId, | ||
| }), | ||
| ).toBe("remote"); | ||
| }); | ||
|
|
||
| it("targets remote when no primary environment is known", () => { | ||
| expect( | ||
| folderDropTarget({ | ||
| localEnvironmentDisabled: false, | ||
| environmentId, | ||
| primaryEnvironmentId: null, | ||
| }), | ||
| ).toBe("remote"); | ||
| }); | ||
| }); | ||
|
|
||
| describe("resolveDroppedFolderPath", () => { | ||
| it("returns the native path when the bridge provides it", () => { | ||
| const folder = new File([], "contracts"); | ||
| expect(resolveDroppedFolderPath(folder, () => "/tmp/project/contracts")).toBe( | ||
| "/tmp/project/contracts", | ||
| ); | ||
| }); | ||
|
|
||
| it("returns null for an outside-folder drop even when the folder name matches a project directory", () => { | ||
| const folder = new File([], "contracts"); | ||
| expect(resolveDroppedFolderPath(folder, undefined)).toBeNull(); | ||
| }); | ||
|
|
||
| it("returns null when the bridge returns an empty path", () => { | ||
| const folder = new File([], "contracts"); | ||
| expect(resolveDroppedFolderPath(folder, () => "")).toBeNull(); | ||
| }); | ||
| }); |
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,24 @@ | ||
| import type { EnvironmentId } from "@t3tools/contracts"; | ||
|
|
||
| export function folderDropTarget(input: { | ||
| localEnvironmentDisabled: boolean; | ||
| environmentId: EnvironmentId; | ||
| primaryEnvironmentId: EnvironmentId | null; | ||
| }): "local" | "remote" { | ||
| if ( | ||
| input.localEnvironmentDisabled || | ||
| input.primaryEnvironmentId === null || | ||
| input.environmentId !== input.primaryEnvironmentId | ||
| ) { | ||
| return "remote"; | ||
| } | ||
| return "local"; | ||
| } | ||
|
|
||
| export function resolveDroppedFolderPath( | ||
| folder: File, | ||
| getPathForFile: ((file: File) => string) | undefined, | ||
| ): string | null { | ||
| const path = getPathForFile?.(folder); | ||
| return typeof path === "string" && path.length > 0 ? path : null; | ||
| } |
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
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.