feat: 10+ améliorations pro — inline rename, raccourcis, métadonnées, badges, etc.
Implémenté depuis la ROADMAP v2.2.0: A3 Inline rename: double-clic → input inline (Enter/escape/blur). Fonctionne sur x-for items et breadcrumb. A2 Raccourcis clavier: F2=rename l'item survolé, Ctrl+C/V=copy/paste items entre dossiers. Layout focusable (tabindex=0, @keydown). A6 Duplicate: méthode duplicateItem(), crée une copie '(copy)'. B3 Métadonnées: child_count ajouté dans l'API tree + sidebar data. B4+D2 Compteur d'enfants: badge '(N)' sur les dossiers dans la page workspace ET la sidebar. B5 Loading skeletons: CSS shimmer animation (.skeleton). C1 Breadcrumb éditable: double-clic sur un segment → rename. D1 Indicateur dossier actif: bordure bleue + highlight bg sur l'item de la sidebar correspondant au dossier courant. D4 Scroll into view: auto-scroll smooth vers le dossier actif dans la sidebar après chargement. child_count ajouté à _build_tree_children (dashboard.py) et _load_workspace_pages/_load_children (board.py).
This commit is contained in:
+14
-1
@@ -111,6 +111,7 @@
|
||||
data-id="{{ page.db_id }}"
|
||||
data-is-folder="{{ 'true' if page.is_folder else 'false' }}"
|
||||
data-depth="{{ depth }}"
|
||||
:class="{ active: activeNodeId === {{ page.db_id }} }"
|
||||
draggable="true"
|
||||
@dragstart="dragStart($event, {{ page.db_id }})"
|
||||
@dragover.prevent="dragOver($event, {{ page.db_id }}, {{ 'true' if page.is_folder else 'false' }})"
|
||||
@@ -134,7 +135,7 @@
|
||||
<span class="page-name tree-folder-link"
|
||||
@click.stop="navigateToFolder({{ page.db_id }})"
|
||||
draggable="false"
|
||||
title="Open folder">{{ page.name }}</span>
|
||||
title="Open folder">{{ page.name }}{% if page.child_count %} <span class="child-count">({{ page.child_count }})</span>{% endif %}</span>
|
||||
{% else %}
|
||||
<a href="/pages/{{ page.db_id }}" class="page-name" draggable="false">{{ page.name }}</a>
|
||||
{% endif %}
|
||||
@@ -522,6 +523,10 @@
|
||||
// ── Workspace tree context menu ──
|
||||
wsCtx: { visible: false, x: 0, y: 0, id: null, name: '', isFolder: false },
|
||||
wsTouchTimer: null,
|
||||
activeNodeId: (function() {
|
||||
var m = window.location.search.match(/[?&]folder=(\d+)/);
|
||||
return m ? parseInt(m[1]) : null;
|
||||
})(),
|
||||
showWsContext(ev, id, name, isFolder) {
|
||||
this.wsCtx = { visible: true, x: ev.clientX, y: ev.clientY, id: id, name: name, isFolder: isFolder };
|
||||
},
|
||||
@@ -951,6 +956,14 @@
|
||||
}
|
||||
} catch(e) {}
|
||||
});
|
||||
|
||||
// Auto-scroll sidebar to active folder
|
||||
document.addEventListener('alpine:initialized', function() {
|
||||
setTimeout(function() {
|
||||
var active = document.querySelector('.sidebar-item.active');
|
||||
if (active) active.scrollIntoView({ block: 'nearest', behavior: 'smooth' });
|
||||
}, 300);
|
||||
});
|
||||
</script>
|
||||
<script src="/static/js/app.js" defer></script>
|
||||
{% block scripts %}{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user