Official
files
Built-in files UI (JavaScript UI plugin).
The app opens the listing; nothing installs until an agent in your Plugins workspace has read the files and you enable the plugin. In a terminal: dvg install convergence/files@0.2.4
Permissions in 0.2.4
Files
panel.test.ts1.6 KB
// File-panel tree, selection and filtering contracts.
import assert from "node:assert/strict";
import { test } from "node:test";
import { initialState, isOpen, isPending, runFinished, selectedPath, treeItems } from "./panel.ts";
test("the tree holds only listed folders, with ids the whole list would give them", () => {
const listing = { "": { files: ["README.md"], folders: ["src"] }, "src/": { files: ["a.ts"], folders: ["deep"] } };
assert.deepEqual(treeItems(listing), [
{
id: "src/",
label: "src",
children: [
{ id: "src/deep/", label: "deep", children: [{ id: "src/deep/…", label: "Loading…" }] },
{ id: "src/a.ts", label: "a.ts" },
],
},
{ id: "README.md", label: "README.md" },
]);
assert.deepEqual(treeItems({}), [], "nothing before the top is listed");
assert.equal(isPending("src/deep/…"), true);
assert.equal(isPending("src/a.ts"), false);
});
test("panel opens pinned or previewed, and selection is only a file path", () => {
for (const key of ["rightPanel", "rightPanelPreview"]) assert.equal(isOpen({ shared: { [key]: "files" } }), true);
assert.equal(isOpen({}), false);
assert.equal(isOpen({ shared: { rightPanel: "git" } }), false);
assert.equal(selectedPath("src/a.ts"), "src/a.ts");
assert.equal(selectedPath(null), null);
assert.deepEqual(initialState(), {
workspaceId: null,
listing: {},
all: null,
query: "",
results: [],
tabs: undefined,
activePath: null,
follow: undefined,
});
assert.equal(runFinished({ event: "run_finished" }), true);
assert.equal(runFinished({ event: "text_delta" }), false);
});
No comments yet.