Skip to content

Conversation

@jelly
Copy link
Member

@jelly jelly commented May 7, 2024

Some research upfront would be nice:

  • selected state is in App which means every selection re-renders all children, is there a better way?
  • Sorting memozises the state, so any fsinfo update re-renders

@allisonkarlitskaya allisonkarlitskaya self-requested a review May 7, 2024 12:30
@jelly jelly force-pushed the object-files-state branch from 50859c6 to 89a1618 Compare May 7, 2024 13:18
@jelly jelly changed the title Try out Directly use fsinfo state May 7, 2024
@jelly jelly force-pushed the object-files-state branch from 89a1618 to 4a41c54 Compare May 7, 2024 13:24
} else if (fileInfo?.type === "lnk") {
modalTitle = cockpit.format(
forceDelete ? _("Force delete link $0?") : _("Delete link $0?"), selectedItem.name
forceDelete ? _("Force delete link $0?") : _("Delete link $0?"), selected[0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test.

} else if (fileInfo?.type === "dir") {
modalTitle = cockpit.format(
forceDelete ? _("Force delete directory $0?") : _("Delete directory $0?"), selectedItem.name
forceDelete ? _("Force delete directory $0?") : _("Delete directory $0?"), selected[0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test.

);
} else {
modalTitle = cockpit.format(forceDelete ? _("Force delete $0") : _("Delete $0?"), selectedItem.name);
modalTitle = cockpit.format(forceDelete ? _("Force delete $0") : _("Delete $0?"), selected[0]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test.

Comment on lines +200 to +202
} else if (fileInfo?.type === "lnk") {
title = cockpit.format(_("Rename link $0"), selected);
} else if (fileInfo?.type === "dir") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 3 added lines are not executed by any test.

title = cockpit.format(_("Rename directory $0"), selected);
} else {
title = _("Rename $0", selected.name);
title = _("Rename $0", selected);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test.

id: "copy-item",
title: _("Copy"),
onClick: () => setClipboard([currentPath + selected[0].name]),
onClick: () => setClipboard([currentPath + selected[0]]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test.

id: "paste-into-directory",
title: _("Paste into directory"),
onClick: () => spawnPaste(clipboard, [currentPath + selected[0].name]),
onClick: () => spawnPaste(clipboard, [currentPath + selected[0]]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test.

id: "copy-item",
title: _("Copy"),
onClick: () => setClipboard(selected.map(s => path.join("/") + "/" + s.name)),
onClick: () => setClipboard(selected.map(s => path.join("/") + "/" + s)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test.

const onDoubleClickNavigate = useCallback((filename) => {
const newPath = [...path, filename].join("/");
const file = files[filename];
if (files && (file.type === "dir" || file.to === "dir")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test.

return "directory-item";
} else if (file.type === "lnk" && file?.to === "dir") {
// TODO: info.target(name)?.type
} else if (file.type === "lnk" && cwdInfo?.targets[filename]?.type === "dir") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants