Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
9fb41f0
add listentries
esimkowitz Feb 1, 2025
7791512
list entries implemented
esimkowitz Feb 1, 2025
1d804fa
more impls
esimkowitz Feb 2, 2025
91a936c
cat is working!
esimkowitz Feb 2, 2025
eeeedf6
save
esimkowitz Feb 2, 2025
b2ce931
fix "directory" handling for ls and rm
esimkowitz Feb 2, 2025
cd54d9b
save tar copy work
esimkowitz Feb 2, 2025
bafd175
save
esimkowitz Feb 2, 2025
8cb908f
copyremote initial impl, fix for wavefs
esimkowitz Feb 2, 2025
506fd72
save work
esimkowitz Feb 4, 2025
14c51cf
check dir walk error
esimkowitz Feb 4, 2025
09f3bce
save
esimkowitz Feb 4, 2025
92bb98e
add dir mode
esimkowitz Feb 5, 2025
24ac975
lots of fixes
esimkowitz Feb 6, 2025
b7c2444
Merge branch 'main' into evan/s3fs
esimkowitz Feb 6, 2025
4b610d3
add s3 trailing slash test
esimkowitz Feb 6, 2025
5b7cf86
add back quick add for pathtree
esimkowitz Feb 6, 2025
39cd7ce
Update pkg/util/fileutil/fileutil.go
esimkowitz Feb 6, 2025
297f400
fix readstream for s3
esimkowitz Feb 6, 2025
527e31d
Merge branch 'main' into evan/s3fs
esimkowitz Feb 6, 2025
97fdd52
Merge branch 'main' into evan/s3fs
esimkowitz Feb 7, 2025
0ae9ecd
bad merge
esimkowitz Feb 7, 2025
dc951dd
revert wshremote
esimkowitz Feb 7, 2025
c22a560
put back data close
esimkowitz Feb 7, 2025
264ff2d
fix empty file info error with readfilestream
esimkowitz Feb 7, 2025
db84722
Remove recursive from cp, make it default
esimkowitz Feb 8, 2025
5da7740
save
esimkowitz Feb 9, 2025
abb8e0d
save
esimkowitz Feb 9, 2025
e57f869
save
esimkowitz Feb 9, 2025
20badde
fix preceding slashes in tar headers
esimkowitz Feb 9, 2025
ad56f14
handle case where singleFile flag is set twice
esimkowitz Feb 9, 2025
b0ce1c2
update comment
esimkowitz Feb 9, 2025
62de973
Merge branch 'evan/copy-improvements' into evan/s3fs
esimkowitz Feb 9, 2025
b6a67d8
save
esimkowitz Feb 9, 2025
f56e189
remove s3 cp recursive flag, unnecessary context cancel
esimkowitz Feb 9, 2025
3c4aa68
more gracefulclose
esimkowitz Feb 9, 2025
4aa64c4
add traversal error
esimkowitz Feb 9, 2025
03ae872
apply suggestion
esimkowitz Feb 9, 2025
24b26ac
apply suggestion
esimkowitz Feb 9, 2025
5a512f4
apply suggestion
esimkowitz Feb 9, 2025
3102452
Merge branch 'main' into evan/s3fs
esimkowitz Feb 9, 2025
0e45087
add dirmode to wavefs
esimkowitz Feb 9, 2025
6582c63
Merge branch 'main' into evan/s3fs
esimkowitz Feb 9, 2025
4e01482
Merge branch 'main' into evan/s3fs
esimkowitz Feb 10, 2025
3840be3
remove logs, fix trailing slash in normalized filepath in dir preview
esimkowitz Feb 11, 2025
ff62039
save
esimkowitz Feb 11, 2025
6ace12a
save
esimkowitz Feb 11, 2025
c81ef48
Update pkg/remote/fileshare/s3fs/s3fs.go
esimkowitz Feb 11, 2025
afdb44d
Merge branch 'main' into evan/s3fs
esimkowitz Feb 11, 2025
501b79d
save
esimkowitz Feb 11, 2025
abed821
fix putfile
esimkowitz Feb 11, 2025
a74e1eb
fix putfile better
esimkowitz Feb 11, 2025
d75b7cd
fix parent dirs
esimkowitz Feb 12, 2025
c3714b3
Update pkg/remote/fileshare/fsutil/fsutil.go
esimkowitz Feb 12, 2025
9933e12
Update pkg/remote/fileshare/fsutil/fsutil.go
esimkowitz Feb 12, 2025
b63b196
clean up formatRemoteUri
esimkowitz Feb 12, 2025
9a0d3d9
fix local single file copy
esimkowitz Feb 12, 2025
9e1bed9
fix scrollintoview, also add pageup/pagedown handlers
sawka Feb 12, 2025
65fe8b1
save
esimkowitz Feb 12, 2025
efab0bf
fix propagation
sawka Feb 12, 2025
c98ef36
fix branch and drain channel fn
esimkowitz Feb 13, 2025
3ce3c24
more centralizing of the listEntries code
esimkowitz Feb 13, 2025
6111360
more notfound fixes
esimkowitz Feb 13, 2025
69577d2
save
esimkowitz Feb 13, 2025
654db39
save
esimkowitz Feb 13, 2025
73a86d0
save
esimkowitz Feb 14, 2025
59e3fb6
fix wavefs rm
esimkowitz Feb 14, 2025
de2e8e7
fix connparse for multiple slashes
esimkowitz Feb 14, 2025
91b594f
Merge branch 'main' into evan/s3fs
esimkowitz Feb 14, 2025
5091310
fix: revert fileContentAtom
oneirocosm Feb 14, 2025
70c23a8
test: fix behavior of test026
oneirocosm Feb 14, 2025
5470f9a
fix: copy dir behavior with target dir
oneirocosm Feb 14, 2025
c979dce
test: split up test 48 and 49
oneirocosm Feb 14, 2025
ecbb9b0
feat: add additional merge button for failed copy
oneirocosm Feb 14, 2025
4383b36
merge branch 'main' into sylvie/copymergeui
oneirocosm Feb 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 31 additions & 16 deletions frontend/app/view/preview/directorypreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type FileCopyStatus = {
copyData: CommandFileCopyData;
copyError: string;
allowRetry: boolean;
isDir: boolean;
};

declare module "@tanstack/react-table" {
Expand Down Expand Up @@ -731,6 +732,7 @@ const TableRow = React.forwardRef(function ({
relName: row.getValue("name") as string,
absParent: dirPath,
uri: formatRemoteUri(row.getValue("path") as string, connection),
isDir: row.original.isdir,
};
const [_, drag] = useDrag(
() => ({
Expand Down Expand Up @@ -898,18 +900,21 @@ function DirectoryPreview({ model }: DirectoryPreviewProps) {
});

const handleDropCopy = useCallback(
async (data: CommandFileCopyData) => {
async (data: CommandFileCopyData, isDir) => {
try {
await RpcApi.FileCopyCommand(TabRpcClient, data, { timeout: data.opts.timeout });
setCopyStatus(null);
} catch (e) {
console.log("copy failed:", e);
const copyError = `${e}`;
const allowRetry = copyError.endsWith("overwrite not specified");
const allowRetry =
copyError.endsWith("overwrite not specified") ||
copyError.endsWith("neither overwrite nor merge specified");
const copyStatus: FileCopyStatus = {
copyError,
copyData: data,
allowRetry,
isDir: isDir,
};
setCopyStatus(copyStatus);
}
Expand Down Expand Up @@ -943,7 +948,7 @@ function DirectoryPreview({ model }: DirectoryPreviewProps) {
desturi,
opts,
};
await handleDropCopy(data);
await handleDropCopy(data, draggedFile.isDir);
}
},
// TODO: mabe add a hover option?
Expand Down Expand Up @@ -1104,21 +1109,26 @@ const CopyErrorOverlay = React.memo(
}: {
copyStatus: FileCopyStatus;
setCopyStatus: (_: FileCopyStatus) => void;
handleDropCopy: (data: CommandFileCopyData) => Promise<void>;
handleDropCopy: (data: CommandFileCopyData, isDir: boolean) => Promise<void>;
}) => {
const [overlayRefCallback, _, domRect] = useDimensionsWithCallbackRef(30);
const width = domRect?.width;

const handleRetryCopy = React.useCallback(async () => {
if (!copyStatus) {
return;
}
const updatedData = {
...copyStatus.copyData,
opts: { ...copyStatus.copyData.opts, overwrite: true },
};
await handleDropCopy(updatedData);
}, [copyStatus.copyData]);
const handleRetryCopy = React.useCallback(
async (copyOpt?: string) => {
if (!copyStatus) {
return;
}
let overwrite = copyOpt == "overwrite";
let merge = copyOpt == "merge";
const updatedData = {
...copyStatus.copyData,
opts: { ...copyStatus.copyData.opts, overwrite, merge },
};
await handleDropCopy(updatedData, copyStatus.isDir);
},
[copyStatus.copyData]
);

let statusText = "Copy Error";
let errorMsg = `error: ${copyStatus?.copyError}`;
Expand Down Expand Up @@ -1169,9 +1179,14 @@ const CopyErrorOverlay = React.memo(

{copyStatus?.allowRetry && (
<div className="flex flex-row gap-1.5">
<Button className={buttonClassName} onClick={handleRetryCopy}>
Override
<Button className={buttonClassName} onClick={() => handleRetryCopy("overwrite")}>
Delete Then Copy
</Button>
{copyStatus.isDir && (
<Button className={buttonClassName} onClick={() => handleRetryCopy("merge")}>
Sync
</Button>
)}
<Button className={buttonClassName} onClick={handleRemoveCopyError}>
Cancel
</Button>
Expand Down
18 changes: 10 additions & 8 deletions frontend/app/view/preview/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -584,10 +584,11 @@ export class PreviewModel implements ViewModel {
}

async getParentInfo(fileInfo: FileInfo): Promise<FileInfo | undefined> {
const conn = await globalStore.get(this.connection);
try {
const parentFileInfo = await RpcApi.RemoteFileJoinCommand(TabRpcClient, [fileInfo.path, ".."], {
route: makeConnRoute(conn),
const parentFileInfo = await RpcApi.FileInfoCommand(TabRpcClient, {
info: {
path: await this.formatRemoteUri(fileInfo.dir, globalStore.get),
},
});
console.log("parent file info", parentFileInfo);
return parentFileInfo;
Expand All @@ -606,13 +607,14 @@ export class PreviewModel implements ViewModel {
this.updateOpenFileModalAndError(false);
return true;
}
const conn = await globalStore.get(this.connection);
try {
const newFileInfo = await RpcApi.RemoteFileJoinCommand(TabRpcClient, [fileInfo.path, ".."], {
route: makeConnRoute(conn),
const newFileInfo = await RpcApi.FileInfoCommand(TabRpcClient, {
info: {
path: await this.formatRemoteUri(fileInfo.dir, globalStore.get),
},
});
if (newFileInfo.path != "" && newFileInfo.notfound) {
console.log("does not exist, ", newFileInfo.path);
console.log("parent does not exist, ", newFileInfo.path);
this.goParentDirectory({ fileInfo: newFileInfo });
return;
}
Expand All @@ -621,7 +623,7 @@ export class PreviewModel implements ViewModel {
refocusNode(this.blockId);
} catch (e) {
globalStore.set(this.openFileError, e.message);
console.error("Error opening file", [fileInfo.dir, ".."], e);
console.error("Error opening file", fileInfo.dir, e);
}
}

Expand Down
1 change: 1 addition & 0 deletions frontend/types/custom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ declare global {
uri: string;
absParent: string;
relName: string;
isDir: boolean;
};

type ErrorButtonDef = {
Expand Down
Loading