feat: compact breadcrumb menu + 'X more' Notion-style in workspace
1. Compact breadcrumb hover menu: - Reduced font-size: header-breadcrumb 14→13px, breadcrumb-link 14→13px - Dropdown menus: fd-nav-menu min-width 240→200px, padding reduced - fd-nav-item: padding 6px8→4px6, font 14→13px, gap 8→6px - fd-nav-section: font 11→10px, padding reduced - fd-nav-ico: size 16→14px, width 20→18px - fd-nav-arrow: size 16→14px, margin-left 4→2px 2. 'X more' Notion-style (tree view): - Shows first 5 items in displayTree, hides rest - 6th item shows 'X more...' with count of remaining items - Click to expand and show all items - 'Show less' button to collapse back to 5 - showAll state auto-resets on folder navigation, sort, filter - Styling: semi-transparent hover effect on ws-more-item
This commit is contained in:
@@ -74,6 +74,10 @@
|
||||
.ws-tree-item:hover .pin-icon{opacity:1;}
|
||||
.pin-icon.pinned{opacity:1;color:var(--accent);}
|
||||
|
||||
/* "X more" toggle in tree view */
|
||||
.ws-more-item{cursor:pointer;opacity:.7;transition:opacity 150ms;}
|
||||
.ws-more-item:hover{opacity:1;background:var(--bg-tertiary);}
|
||||
|
||||
/* Multi-select */
|
||||
.item-checkbox{width:14px;height:14px;flex-shrink:0;cursor:pointer;accent-color:var(--accent);opacity:0;transition:opacity 150ms;}
|
||||
.ws-tree-item:hover .item-checkbox,.ws-tree-item.selected .item-checkbox{opacity:1;}
|
||||
@@ -339,6 +343,7 @@ window._wsInitData = (function() {
|
||||
showCreate:false,
|
||||
showRename:false,
|
||||
showDelete:false,
|
||||
showAll:false,
|
||||
createType:'file',
|
||||
newName:'',
|
||||
parentFolder:null,
|
||||
@@ -1070,6 +1075,7 @@ window._wsInitData = (function() {
|
||||
this._markTree(roots, 0);
|
||||
this.tree = roots;
|
||||
this.displayTree = [...roots];
|
||||
this.showAll = false;
|
||||
this.breadcrumb = d.breadcrumb || [];
|
||||
this.currentFolder = folderId || 0;
|
||||
this._saveExpandedState();
|
||||
@@ -1192,7 +1198,7 @@ window._wsInitData = (function() {
|
||||
// ── Sort ──
|
||||
doSort() {
|
||||
var s = this.sortBy;
|
||||
if (!s) { this.displayTree = [...this.tree]; return; }
|
||||
if (!s) { this.displayTree = [...this.tree]; this.showAll = false; return; }
|
||||
var sorted = this.tree.slice();
|
||||
if (s === 'name-asc') sorted.sort(function(a,b) { return (a.name||'').localeCompare(b.name||''); });
|
||||
else if (s === 'name-desc') sorted.sort(function(a,b) { return (b.name||'').localeCompare(a.name||''); });
|
||||
@@ -1429,7 +1435,7 @@ window._wsInitData = (function() {
|
||||
doFilter() {
|
||||
var q = (this.searchQuery || '').toLowerCase().trim();
|
||||
var ft = this.filterType || '';
|
||||
if (!q && !ft && !this.tagFilter) { this.displayTree = [...this.tree]; this._computeFilteredTableItems(); return; }
|
||||
if (!q && !ft && !this.tagFilter) { this.displayTree = [...this.tree]; this.showAll = false; this._computeFilteredTableItems(); return; }
|
||||
if (this.tagFilter) {
|
||||
// Filter tree by tag
|
||||
this.displayTree = this._filterTreeByTag([...this.tree], this.tagFilter);
|
||||
@@ -2147,7 +2153,7 @@ console.log('FLOWDECK v2.4.6 — IIFE done, _wsInitData keys:', Object.keys(wind
|
||||
<span class="name folder" style="font-weight:600;">..</span>
|
||||
</div>
|
||||
</li>
|
||||
<template x-for="node in displayTree" :key="node.id">
|
||||
<template x-for="node in (showAll ? displayTree : displayTree.slice(0, 5))" :key="node.id">
|
||||
<li>
|
||||
<div class="ws-tree-item" :style="{paddingLeft:(node.depth||0)*20+'px'}"
|
||||
draggable="true"
|
||||
@@ -2212,6 +2218,23 @@ console.log('FLOWDECK v2.4.6 — IIFE done, _wsInitData keys:', Object.keys(wind
|
||||
</ul>
|
||||
</li>
|
||||
</template>
|
||||
<!-- "X more" toggle -->
|
||||
<li x-show="displayTree.length > 5 && !showAll" style="list-style:none;">
|
||||
<div class="ws-tree-item ws-more-item" @click="showAll = true" style="padding-left:4px;cursor:pointer;">
|
||||
<span style="width:16px;flex-shrink:0;"></span>
|
||||
<span class="icon">⋯</span>
|
||||
<span class="name folder" style="color:var(--text-secondary);font-style:italic;"
|
||||
x-text="displayTree.length - 5 + ' more...'"></span>
|
||||
</div>
|
||||
</li>
|
||||
<!-- "Show less" toggle -->
|
||||
<li x-show="displayTree.length > 5 && showAll" style="list-style:none;">
|
||||
<div class="ws-tree-item ws-more-item" @click="showAll = false" style="padding-left:4px;cursor:pointer;">
|
||||
<span style="width:16px;flex-shrink:0;"></span>
|
||||
<span class="icon">🔼</span>
|
||||
<span class="name folder" style="color:var(--text-secondary);">Show less</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user