Count the drawer's edge row, let the drawer shrink in the conversation's place, and name clicked files from the workspace
This commit is contained in:
1 parent
0d7a5cc051
commit
2e531df11b
4 files changed
+44
-6
No files matched your search
@@ -63,7 +63,7 @@ describe("links and paths in replies", () => {
|
||||
expect(opened()).toEqual(["https://example.com/docs", "https://bare.example.org/x"]);
|
||||
});
|
||||
|
||||
test("a click on a workspace file's path opens it in the editor pane", async () => {
|
||||
test("a click on a workspace file's path opens it in the column's editor, named from the workspace", async () => {
|
||||
delete process.env.VISUAL;
|
||||
process.env.EDITOR = "sleep 3; :";
|
||||
const { snapshot } = workspace();
|
||||
@@ -73,8 +73,8 @@ describe("links and paths in replies", () => {
|
||||
expect(app.frame()).not.toContain("Editing");
|
||||
const path = app.find("a.ts:3");
|
||||
await app.click(path.x, path.y);
|
||||
expect(app.frame()).toContain("Editing ");
|
||||
expect(app.frame()).toContain("src/a.ts");
|
||||
expect(app.frame()).toContain("Details Editor");
|
||||
expect(app.frame()).toContain("Editing src/a.ts ");
|
||||
});
|
||||
|
||||
test("a drag over a link selects it rather than opening it", async () => {
|
||||
|
||||
@@ -230,4 +230,30 @@ describe("editing a changed file", () => {
|
||||
restoreEditor(previous);
|
||||
}
|
||||
});
|
||||
|
||||
test("on a narrow window the column, editor and all, takes the conversation's place", async () => {
|
||||
const root = mkdtempSync(join(tmpdir(), "t3tui-edit-"));
|
||||
writeFileSync(join(root, "README.md"), "hello\n");
|
||||
const project = { ...v2ShellSnapshot.projects[0]!, workspaceRoot: root };
|
||||
const previous = { visual: process.env.VISUAL, editor: process.env.EDITOR };
|
||||
delete process.env.VISUAL;
|
||||
process.env.EDITOR = "sleep 3; true";
|
||||
try {
|
||||
const app = await open({ width: 100, session: fakeSession({ vcs, snapshot: { ...v2ShellSnapshot, projects: [project] }, projection: withReply("The reply under the column.", false) }) });
|
||||
await app.press("d");
|
||||
await app.press("l");
|
||||
await app.press("o");
|
||||
expect(app.find("Editing README.md").x).toBeLessThan(50);
|
||||
expect(app.frame()).not.toContain("The reply under");
|
||||
expect(app.frame()).toContain("Press i to type");
|
||||
// d hides the column, editor and all, and brings it back with the editor still running.
|
||||
await app.press("\\", { ctrl: true });
|
||||
await app.press("d");
|
||||
expect(app.frame()).toContain("The reply under");
|
||||
await app.press("d");
|
||||
expect(app.frame()).toContain("Editing README.md");
|
||||
} finally {
|
||||
restoreEditor(previous);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user