UX: Clarify document/library creation flow

- Replace direct 'New Document' with modal wizard that asks for library first
- Separate 'New Document' (📄) and 'New Library' (📁) buttons in header
- Update sidebar quick links to show both options with clear icons
- Add modal for library creation with name input
- Add CSS for form-control and modal-close button styling
- Minor improvements to document.js (type=button, event.stopPropagation)
- Keyboard shortcut Ctrl+N now opens document creation modal
This commit is contained in:
Hiro
2026-03-28 12:41:21 +00:00
parent 47e4394433
commit 929c658e45
5 changed files with 221 additions and 14 deletions

View File

@@ -58,7 +58,8 @@ export function renderSidebar({ libraries, tags, selectedLibrary, selectedTag, o
</div>
<div class="quick-links">
<a class="quick-link" data-action="home">📋 All Documents</a>
<a class="quick-link" onclick="window.app.navigate('editor')">+ New Document</a>
<a class="quick-link" onclick="window.showNewDocModal()">📄 New Document</a>
<a class="quick-link" onclick="window.showNewLibraryModal()">📁 New Library</a>
</div>
</div>
</aside>
@@ -66,18 +67,21 @@ export function renderSidebar({ libraries, tags, selectedLibrary, selectedTag, o
(function() {
var callbacks = window.__sidebarCallbacks;
document.querySelectorAll('[data-action="home"]').forEach(function(el) {
el.addEventListener('click', function() {
el.addEventListener('click', function(e) {
e.stopPropagation();
if (callbacks && callbacks.onHome) callbacks.onHome();
});
});
document.querySelectorAll('[data-action="library"]').forEach(function(el) {
el.addEventListener('click', function() {
el.addEventListener('click', function(e) {
e.stopPropagation();
var id = this.getAttribute('data-library-id');
if (callbacks && callbacks.onSelectLibrary) callbacks.onSelectLibrary(id);
});
});
document.querySelectorAll('[data-action="tag"]').forEach(function(el) {
el.addEventListener('click', function() {
el.addEventListener('click', function(e) {
e.stopPropagation();
var tag = this.getAttribute('data-tag');
if (callbacks && callbacks.onSelectTag) callbacks.onSelectTag(tag);
});