fix: brain second sidebar — Reader-style panel between AppShell and content
- Removed AppShell sub-nav items (wrong approach) - Brain page now has its own sidebar column (248px, like Reader) - Layout: [AppShell Nav] | [Brain Sidebar] | [Masonry Grid] - Sidebar shows: All items, Folders section, Tags section (with counts) - Matches Reader page pattern exactly (same CSS, same structure) - Mobile: sidebar hidden Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -367,10 +367,49 @@
|
||||
</section>
|
||||
|
||||
<!-- ═══ Sidebar + Main layout ═══ -->
|
||||
<!-- Main content -->
|
||||
<div>
|
||||
<!-- Active filter indicator -->
|
||||
{#if activeFolder || activeTag}
|
||||
<div class="brain-layout">
|
||||
|
||||
<!-- Second sidebar (like Reader) -->
|
||||
<aside class="brain-sidebar">
|
||||
<div class="sidebar-header">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M12 2L2 7l10 5 10-5-10-5z"/><path d="M2 17l10 5 10-5"/><path d="M2 12l10 5 10-5"/></svg>
|
||||
<span class="sidebar-title">Brain</span>
|
||||
</div>
|
||||
|
||||
<nav class="sidebar-nav">
|
||||
<button class="nav-item" class:active={!activeFolder && !activeTag} onclick={() => { activeFolder = null; activeTag = null; activeFolderId = null; activeTagId = null; loadItems(); }}>
|
||||
<span class="nav-label">All items</span>
|
||||
<span class="nav-count">{total}</span>
|
||||
</button>
|
||||
</nav>
|
||||
|
||||
<div class="sidebar-separator"></div>
|
||||
<div class="sidebar-section-label">Folders</div>
|
||||
<nav class="sidebar-nav">
|
||||
{#each sidebarFolders.filter(f => f.is_active) as folder}
|
||||
<button class="nav-item" class:active={activeFolder === folder.name} onclick={() => { activeFolder = folder.name; activeFolderId = folder.id; activeTag = null; activeTagId = null; loadItems(); }}>
|
||||
<span class="nav-label">{folder.name}</span>
|
||||
{#if folder.item_count > 0}<span class="nav-count">{folder.item_count}</span>{/if}
|
||||
</button>
|
||||
{/each}
|
||||
</nav>
|
||||
|
||||
<div class="sidebar-separator"></div>
|
||||
<div class="sidebar-section-label">Tags</div>
|
||||
<nav class="sidebar-nav">
|
||||
{#each sidebarTags.filter(t => t.is_active && t.item_count > 0) as tag}
|
||||
<button class="nav-item" class:active={activeTag === tag.name} onclick={() => { activeTag = tag.name; activeTagId = tag.id; activeFolder = null; activeFolderId = null; loadItems(); }}>
|
||||
<span class="nav-label">{tag.name}</span>
|
||||
<span class="nav-count">{tag.item_count}</span>
|
||||
</button>
|
||||
{/each}
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="brain-content">
|
||||
<!-- Active filter indicator -->
|
||||
{#if activeFolder || activeTag}
|
||||
<div class="active-filter">
|
||||
<span class="filter-label">Filtered by {activeFolder ? 'folder' : 'tag'}:</span>
|
||||
<span class="filter-tag">{activeFolder || activeTag}</span>
|
||||
@@ -479,7 +518,8 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
</div><!-- main content -->
|
||||
</div><!-- .brain-content -->
|
||||
</div><!-- .brain-layout -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -703,44 +743,50 @@
|
||||
}
|
||||
.capture-btn:hover { opacity: 0.9; }
|
||||
|
||||
/* ═══ Layout: Sidebar + Main ═══ */
|
||||
.brain-layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
|
||||
/* ═══ Layout: Sidebar + Content (Reader pattern) ═══ */
|
||||
.brain-layout {
|
||||
display: flex;
|
||||
min-height: calc(100vh - 60px);
|
||||
margin: 0 -24px;
|
||||
}
|
||||
|
||||
.brain-sidebar {
|
||||
position: sticky; top: 68px;
|
||||
border-radius: 20px; border: 1px solid rgba(35,26,17,0.08);
|
||||
background: rgba(255,252,248,0.72); backdrop-filter: blur(14px);
|
||||
padding: 14px; max-height: calc(100vh - 80px); overflow-y: auto;
|
||||
width: 248px;
|
||||
flex-shrink: 0;
|
||||
min-height: 0;
|
||||
background: rgba(245, 237, 228, 0.82);
|
||||
border-right: 1px solid rgba(35,26,17,0.1);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: auto;
|
||||
padding: 16px 0 12px;
|
||||
backdrop-filter: blur(16px);
|
||||
}
|
||||
.sidebar-tabs { display: flex; gap: 2px; margin-bottom: 10px; background: rgba(35,26,17,0.04); border-radius: 10px; padding: 3px; }
|
||||
.sidebar-tab {
|
||||
flex: 1; padding: 6px 0; border-radius: 8px; font-size: 0.8rem; font-weight: 600;
|
||||
color: #7d6f61; background: none; border: none; font-family: var(--font); transition: all 160ms;
|
||||
.sidebar-header { display: flex; align-items: center; gap: 8px; padding: 0 18px 12px; }
|
||||
.sidebar-header svg { color: #7f5f3d; }
|
||||
.sidebar-title { font-size: 1rem; font-weight: 700; color: #1f1811; letter-spacing: -0.03em; }
|
||||
|
||||
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; padding: 0 12px; }
|
||||
.nav-item {
|
||||
display: flex; align-items: center; gap: 8px;
|
||||
padding: 10px 12px; border-radius: 14px; background: none; border: none;
|
||||
font-size: 0.85rem; color: #65584c; cursor: pointer;
|
||||
transition: all 160ms; text-align: left; width: 100%; font-family: var(--font);
|
||||
}
|
||||
.sidebar-tab.active { background: rgba(255,255,255,0.9); color: #1e1812; box-shadow: 0 1px 3px rgba(35,26,17,0.06); }
|
||||
.nav-item:hover { background: rgba(255,248,241,0.72); color: #1f1811; }
|
||||
.nav-item.active { background: rgba(255,248,241,0.92); color: #1f1811; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(35,26,17,0.08); }
|
||||
.nav-label { flex: 1; }
|
||||
.nav-count { font-size: 0.72rem; color: #8a7a68; font-family: var(--mono); }
|
||||
|
||||
.sidebar-item {
|
||||
display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px;
|
||||
border-radius: 10px; border: none; background: none; font-family: var(--font);
|
||||
font-size: 0.85rem; color: #3d342c; text-align: left; transition: all 160ms;
|
||||
.sidebar-separator { height: 1px; background: rgba(35,26,17,0.08); margin: 12px 18px; }
|
||||
.sidebar-section-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: #8c7b69; padding: 0 18px 6px; }
|
||||
|
||||
.brain-content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding: 0 24px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.sidebar-item:hover { background: rgba(255,255,255,0.6); }
|
||||
.sidebar-item.active { background: linear-gradient(135deg, rgba(255,248,242,0.94), rgba(246,237,227,0.72)); color: #1e1812; font-weight: 600; }
|
||||
.sidebar-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.sidebar-item-count { flex-shrink: 0; font-size: 0.72rem; font-family: var(--mono); color: #8c7b69; background: rgba(35,26,17,0.04); padding: 1px 6px; border-radius: 6px; }
|
||||
.sidebar-item-delete { flex-shrink: 0; width: 20px; height: 20px; border-radius: 6px; border: none; background: none; color: #8c7b69; display: flex; align-items: center; justify-content: center; }
|
||||
.sidebar-item-delete:hover { background: rgba(220,38,38,0.1); color: #DC2626; }
|
||||
|
||||
.sidebar-actions { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(35,26,17,0.06); display: flex; flex-direction: column; gap: 6px; }
|
||||
.sidebar-add { display: flex; gap: 4px; }
|
||||
.sidebar-add-input { flex: 1; padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(35,26,17,0.1); background: rgba(255,255,255,0.7); font-size: 0.8rem; font-family: var(--font); color: #1e1812; outline: none; }
|
||||
.sidebar-add-input:focus { border-color: rgba(179,92,50,0.4); }
|
||||
.sidebar-add-input::placeholder { color: #8c7b69; }
|
||||
.sidebar-add-btn { padding: 6px 10px; border-radius: 8px; border: none; background: #1e1812; color: white; font-size: 0.78rem; font-weight: 600; font-family: var(--font); }
|
||||
.sidebar-manage-toggle { padding: 6px 0; border: none; background: none; font-size: 0.78rem; color: #8c7b69; font-family: var(--font); text-align: center; }
|
||||
.sidebar-manage-toggle:hover { color: #1e1812; }
|
||||
|
||||
.brain-main { min-width: 0; }
|
||||
|
||||
/* ═══ Active filter ═══ */
|
||||
.active-filter {
|
||||
@@ -1170,13 +1216,12 @@
|
||||
/* ═══ Mobile ═══ */
|
||||
@media (max-width: 1100px) {
|
||||
.masonry { columns: 2; }
|
||||
.brain-layout { grid-template-columns: 200px 1fr; }
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.brain-command { display: grid; gap: 14px; }
|
||||
.command-actions { justify-items: start; }
|
||||
.brain-layout { grid-template-columns: 1fr; }
|
||||
.brain-sidebar { position: static; max-height: none; }
|
||||
.brain-sidebar { display: none; }
|
||||
.brain-layout { margin: 0; }
|
||||
.masonry { columns: 1; }
|
||||
.detail-sheet { width: 100%; padding: 20px; }
|
||||
.viewer-overlay { padding: 12px; }
|
||||
|
||||
Reference in New Issue
Block a user