From 6ebfc245f15cccfd4cba39a37f9025d7c6f75d30 Mon Sep 17 00:00:00 2001 From: bruno Date: Wed, 22 Jul 2026 17:02:14 -0400 Subject: [PATCH] fix(database): remove prompt popup, create database inline with default name Clicking Database button now creates the table directly in the page without asking for a name (uses 'Database' as default). Same pattern as Notion: one click, inline embed, no popup. --- app/templates/_page_editor_scripts.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/templates/_page_editor_scripts.html b/app/templates/_page_editor_scripts.html index 6fe1600..781c07f 100644 --- a/app/templates/_page_editor_scripts.html +++ b/app/templates/_page_editor_scripts.html @@ -325,21 +325,20 @@ // ── v4.6.0: Get Started actions ── async createDatabase(){ - const name=prompt('Database name:',this.pageTitle||'New Database'); - if(!name||!name.trim())return; const csrf=document.cookie.match(/csrf_token=([^;]+)/); try{ + const name='Database'; // Create collection via API const r=await fetch('/db/api',{ method:'POST',headers:{'Content-Type':'application/json','X-CSRF-Token':csrf?csrf[1]:''}, - body:JSON.stringify({name:name.trim()}) + body:JSON.stringify({name:name}) }); const d=await r.json(); if(d.id){ // Add inline database embed block to the page this.blocks.push(this.mkB('embed','',{embed_type:'collection',collection_id:d.id})); this.render(); this.dirty=true; this.autoSave(); - this.showToast('Database created: '+d.name); + this.showToast('Database created'); }else{ this.showToast('Failed to create database'); }