fix(rnotes): create notebook instantly without browser prompt

Skip the browser prompt() dialog — clicking "+ New Notebook" now
immediately creates an "Untitled Notebook" and opens it for editing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-03-09 13:32:03 -07:00
parent 6173e17bb9
commit 79f0ebb538
1 changed files with 9 additions and 5 deletions

View File

@ -740,16 +740,20 @@ Gear: EUR 400 (10%)</code></pre><p><em>Maya is tracking expenses in rF
}
private async createNotebook() {
const title = prompt("Notebook name:");
if (!title?.trim()) return;
try {
const base = this.getApiBase();
await fetch(`${base}/api/notebooks`, {
const res = await fetch(`${base}/api/notebooks`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ title }),
body: JSON.stringify({ title: "Untitled Notebook" }),
});
await this.loadNotebooks();
const nb = await res.json();
if (nb?.id) {
this.view = "notebook";
await this.loadNotebook(nb.id);
} else {
await this.loadNotebooks();
}
} catch {
this.error = "Failed to create notebook";
this.render();