Open
Conversation
5da7d20 to
e78b0aa
Compare
e78b0aa to
ef27359
Compare
kazcw
reviewed
Apr 10, 2026
|
|
||
| function onDragover(event: DragEvent) { | ||
| for (const item of event.dataTransfer?.items ?? []) { | ||
| if (acceptedDragTypes.value.find((type) => type === item.type)) { |
Comment on lines
+91
to
+93
| payloads[0]?.items.length === 1 && firstItem != null ? | ||
| getText('deleteSelectedAssetActionText', firstItem.title) | ||
| : getText('deleteSelectedAssetsActionText', payloads.flatMap(({ items }) => items).length), |
Contributor
There was a problem hiding this comment.
firstItem != null seems redundant, as there's a guard above.
Why is the length computation in the the condition different from how the number is computed in the plural case? This looks like it could use the plural message when the count is 1.
app/gui/src/providers/category.ts
Outdated
|
|
||
| function addLocalDirectory(path: Path) { | ||
| const state = localDirectoryStore.getState() | ||
| if (!state.localDirectories.find((p) => p === path)) { |
app/gui/src/providers/category.ts
Outdated
Comment on lines
+255
to
+258
| const index = state.localDirectories.findIndex((p) => p === path) | ||
| if (index >= 0) { | ||
| const newList = [...state.localDirectories] | ||
| newList.splice(index, 1) |
app/gui/src/providers/category.ts
Outdated
Comment on lines
+308
to
+309
| if (isCloudCategory(from) || isCloudCategory(to)) { | ||
| if (isLocalCategory(from) || isLocalCategory(to)) { |
Contributor
There was a problem hiding this comment.
isCloudCategory(from) !== isCloudCategory(to)?
app/gui/src/providers/category.ts
Outdated
| return 'move' | ||
| case 'local': | ||
| case 'localDirectory': | ||
| return isCloudCategory(to) ? 'copy' : 'move' |
Contributor
There was a problem hiding this comment.
Is the copy case here not already covered by the cloud/local check above?
| refetchInterval: null, | ||
| }), | ||
| ) | ||
| return [...nonDeletedAssets.assets, ...deletedAssets.assets] as const |
Contributor
There was a problem hiding this comment.
These could be pipelined with Promise.all
| type AssetId, | ||
| type DirectoryId, | ||
| } from 'enso-common/src/services/Backend' | ||
| // import { parseDirectoriesPath } from 'enso-common/src/services/Backend/utilities' |
Comment on lines
37
to
47
| const targetDirectoryIndex = finalPath.findIndex(({ id }) => id === targetDirectory) | ||
| const targetDirectoryInfo = finalPath[targetDirectoryIndex] | ||
| if (targetDirectoryIndex === -1 || !targetDirectoryInfo) { | ||
| return | ||
| } | ||
| const pathToDirectory = finalPath | ||
| .slice(0, targetDirectoryIndex + 1) | ||
| .map(({ id, categoryId }) => ({ id, categoryId })) | ||
| .map(({ id, category }) => ({ id, category })) | ||
| const rootDirectoryInThePath = pathToDirectory[0] | ||
| // This should never happen, as we always have the root directory in the path. | ||
| invariant(rootDirectoryInThePath, 'Root directory id is null') |
Contributor
There was a problem hiding this comment.
Most of this logic seems unused since we only use one field of the first element of pathToDirectory
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull Request Description
Fixes #14880
Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
[ ] If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,or the Snowflake database integration, a run of the Extra Tests has been scheduled.