Unify all New Page / New Folder buttons across the app
FlowDeck CI / test (push) Failing after 4s
FlowDeck CI / docker (push) Has been skipped

- Add global window.FlowDeck namespace with createPage() and showCreateFolderModal()
- createPage() creates a Notion-style page via /board/api/pages (same as sidebar bottom-right button)
- showCreateFolderModal() opens a global themed modal (dark/light) instead of browser prompt()
- All New Page buttons now call window.FlowDeck.createPage()
- All New Folder buttons now call window.FlowDeck.showCreateFolderModal()
- Global New Folder modal uses existing .flowdeck-modal CSS classes for theme consistency
- Updated Ctrl+N keyboard shortcut to use unified createPage()
This commit is contained in:
2026-07-19 21:40:39 -04:00
parent 74883688ef
commit 9100da74f3
4 changed files with 101 additions and 20 deletions
+8 -8
View File
@@ -1072,10 +1072,10 @@ window._wsInitData = (function() {
switch(action) {
case 'new-file':
this.openModal('file', {db_id: id, name: name});
window.FlowDeck.createPage();
break;
case 'new-folder':
this.openModal('folder', {db_id: id, name: name});
window.FlowDeck.showCreateFolderModal();
break;
case 'rename':
this.startRename({db_id: id, name: name});
@@ -2183,8 +2183,8 @@ console.log('FLOWDECK v2.4.6 — IIFE done, _wsInitData keys:', Object.keys(wind
</select>
<button class="btn-icon" @click="expandAll()" title="Expand" x-show="viewMode==='tree'">⊞</button>
<button class="btn-icon" @click="collapseAll()" title="Collapse" x-show="viewMode==='tree'">⊟</button>
<button class="btn-icon btn-create" @click="openModal('file')" title="New file">📄</button>
<button class="btn-icon btn-create" @click="openModal('folder')" title="New folder">📁</button>
<button class="btn-icon btn-create" onclick="window.FlowDeck.createPage()" title="New file">📄</button>
<button class="btn-icon btn-create" onclick="window.FlowDeck.showCreateFolderModal()" title="New folder">📁</button>
</div>
<!-- Bulk actions bar -->
@@ -2274,8 +2274,8 @@ console.log('FLOWDECK v2.4.6 — IIFE done, _wsInitData keys:', Object.keys(wind
<div class="actions">
<template x-if="node.is_folder">
<span style="display:flex;gap:2px">
<button class="ws-act" @click.stop="openModal('file',node)" title="New file">📄</button>
<button class="ws-act" @click.stop="openModal('folder',node)" title="New folder">📁</button>
<button class="ws-act" @click.stop="window.FlowDeck.createPage()" title="New file">📄</button>
<button class="ws-act" @click.stop="window.FlowDeck.showCreateFolderModal()" title="New folder">📁</button>
</span>
</template>
<button class="ws-act" @click.stop="startRename(node)" title="Rename">✏️</button>
@@ -2480,8 +2480,8 @@ console.log('FLOWDECK v2.4.6 — IIFE done, _wsInitData keys:', Object.keys(wind
<h2 x-text="currentFolder > 0 ? 'Empty folder' : 'Welcome to your Workspace'"></h2>
<p x-text="currentFolder > 0 ? 'Create a new file or folder to get started' : 'Drag & drop files from your computer, or create new ones.'"></p>
<div class="empty-actions">
<button class="btn-icon" @click="openModal('file')" title="New file">📄</button>
<button class="btn-icon" @click="openModal('folder')" title="New folder">📁</button>
<button class="btn-icon" onclick="window.FlowDeck.createPage()" title="New file">📄</button>
<button class="btn-icon" onclick="window.FlowDeck.showCreateFolderModal()" title="New folder">📁</button>
</div>
</div>