mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-16 04:45:33 -08:00
Seed new notepad tabs with their name as a heading and focus under it, show Learning switch on/off as working right away, and stop the Tauri window from taking file drops
AI Assisted
This commit is contained in:
1 parent
bb5bd5986d
commit
1516b25ea3
10 files changed
+75
-7
No files matched your search
@@ -821,6 +821,7 @@ test("GET /notepad answers a two-tab notepad, one tab at a time, and refuses an
|
||||
assert.equal(a.ok, true);
|
||||
assert.match(a.id, store.TAB_ID_RE);
|
||||
assert.equal(a.name, "Ideas");
|
||||
assert.equal((await getJson(s, `/notepad?tab=${a.id}`)).body.tab.text, "## Ideas\n\n\n", "a tab made through the route opens with its name as a heading");
|
||||
assert.equal((await s.send(`/notepad/text?tab=${a.id}`, { text: "about ideas" })).status, 200);
|
||||
assert.equal((await s.send(`/notepad/text?tab=${b.id}`, { text: "about chores" })).status, 200);
|
||||
const dflt = await getJson(s, "/notepad");
|
||||
|
||||
@@ -510,8 +510,11 @@ test("New tab asks for a name, refuses a bad or duplicate one, and Escape backs
|
||||
await newTab(s, " Big ideas ", "Big ideas");
|
||||
assert.deepEqual(await tabNames(s), ["Notes", "Big ideas"]);
|
||||
assert.deepEqual(await selectedName(s), ["Big ideas"]);
|
||||
assert.equal(await docText(s), "", "the new tab starts empty");
|
||||
assert.equal(readNotepad(s.project, idOf(s, "Big ideas")).text, "## Big ideas\n\n\n", "the new tab opens with its name as a heading");
|
||||
assert.equal(await input(s).getAttribute("aria-readonly"), null, "and can be typed in");
|
||||
// The editor has the focus, the caret under the heading and one blank line.
|
||||
await s.page.keyboard.type("hello");
|
||||
await until(() => readNotepad(s.project, idOf(s, "Big ideas")).text === "## Big ideas\n\nhello\n\n", 4000);
|
||||
assert.deepEqual(listTabs(s.project).tabs.map((tab) => tab.name), ["Notes", "Big ideas"]);
|
||||
assert.deepEqual(await violations(), []);
|
||||
});
|
||||
@@ -524,7 +527,10 @@ test("each tab keeps its own text and pictures, and switching never saves into t
|
||||
await newTab(s, "Ideas");
|
||||
const notes = idOf(s, "Notes");
|
||||
const ideas = idOf(s, "Ideas");
|
||||
await until(() => readNotepad(s.project, notes).text === "notes text", 4000);
|
||||
// The new tab opens with its heading and the editor focused: clear it to start from empty.
|
||||
await s.page.keyboard.press("Control+a");
|
||||
await s.page.keyboard.press("Delete");
|
||||
await until(() => readNotepad(s.project, notes).text === "notes text" && readNotepad(s.project, ideas).text === "", 4000);
|
||||
await typeInto(s, "ideas text");
|
||||
// Switch at once, before the debounce: the text still goes to Ideas.
|
||||
await tabNamed(s, "Notes").click();
|
||||
|
||||
Reference in new issue
Block a user