From 7dd836f53908f3ad1c9b7e8cf56008f96c268f58 Mon Sep 17 00:00:00 2001 From: Gamosoft Date: Mon, 23 Feb 2026 10:59:58 +0100 Subject: [PATCH] added toggle to hide system folders/consistent hover styles --- documentation/FEATURES.md | 1 + frontend/app.js | 20 ++++++++++++++------ frontend/index.html | 24 +++++++++++++++++++++++- locales/de-DE.json | 4 +++- locales/en-GB.json | 4 +++- locales/en-US.json | 4 +++- locales/es-ES.json | 4 +++- locales/fr-FR.json | 4 +++- locales/hu-HU.json | 4 +++- locales/it-IT.json | 4 +++- locales/ja-JP.json | 4 +++- locales/ru-RU.json | 4 +++- locales/sl-SI.json | 4 +++- locales/zh-CN.json | 4 +++- 14 files changed, 71 insertions(+), 18 deletions(-) diff --git a/documentation/FEATURES.md b/documentation/FEATURES.md index bbd1e65..b1d8833 100644 --- a/documentation/FEATURES.md +++ b/documentation/FEATURES.md @@ -31,6 +31,7 @@ - **Alphabetical sorting** - Find notes quickly - **Rename anything** - Files and folders, instantly - **Visual tree view** - Expandable/collapsible navigation +- **Hide system folders** - Toggle to hide `_attachments`, `_templates` and other underscore-prefixed folders from sidebar ## 🔗 Linking & Discovery diff --git a/frontend/app.js b/frontend/app.js index 5c28ad5..e210f63 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -18,6 +18,7 @@ const LOCAL_SETTINGS = { readableLineLength: { key: 'readableLineLength', type: 'boolean', default: true }, favoritesExpanded: { key: 'favoritesExpanded', type: 'boolean', default: true }, tagsExpanded: { key: 'tagsExpanded', type: 'boolean', default: false }, + hideUnderscoreFolders: { key: 'hideUnderscoreFolders', type: 'boolean', default: false }, // Number settings with validation sidebarWidth: { key: 'sidebarWidth', type: 'number', default: CONFIG.DEFAULT_SIDEBAR_WIDTH, min: 200, max: 600 }, editorWidth: { key: 'editorWidth', type: 'number', default: 50, min: 20, max: 80 }, @@ -209,6 +210,9 @@ function noteApp() { // Readable line length (preview max-width) readableLineLength: true, + // Hide underscore-prefixed folders (_attachments, _templates) from sidebar + hideUnderscoreFolders: false, + // Icon rail / panel state activePanel: 'files', // 'files', 'search', 'tags', 'settings' @@ -807,6 +811,12 @@ function noteApp() { localStorage.setItem('readableLineLength', this.readableLineLength); }, + // Hide underscore folders toggle (hides _attachments, _templates, etc. from sidebar) + toggleHideUnderscoreFolders() { + this.hideUnderscoreFolders = !this.hideUnderscoreFolders; + localStorage.setItem('hideUnderscoreFolders', this.hideUnderscoreFolders); + }, + // Update syntax highlight overlay (debounced, called on input) updateSyntaxHighlight() { if (!this.syntaxHighlightEnabled) return; @@ -1852,9 +1862,7 @@ function noteApp() { ondragleave="window.$root.handleFolderDragLeave(this)" ondrop="window.$root.handleFolderDrop(this, event)" onclick="window.$root.handleFolderClick(this)" - onmouseover="if(!window.$root.draggedItem) this.style.backgroundColor='var(--bg-hover)'" - onmouseout="if(!window.$root.draggedItem) this.style.backgroundColor='transparent'" - class="folder-item px-2 py-1 text-sm relative" + class="folder-item hover-accent px-2 py-1 text-sm relative" style="color: var(--text-primary); cursor: pointer;" >
@@ -1909,9 +1917,9 @@ function noteApp() { // First, render child folders (if any) if (folder.children && Object.keys(folder.children).length > 0) { - const children = Object.entries(folder.children).sort((a, b) => - a[1].name.toLowerCase().localeCompare(b[1].name.toLowerCase()) - ); + const children = Object.entries(folder.children) + .filter(([k, v]) => !this.hideUnderscoreFolders || !v.name.startsWith('_')) + .sort((a, b) => a[1].name.toLowerCase().localeCompare(b[1].name.toLowerCase())); children.forEach(([childKey, childFolder]) => { html += this.renderFolderRecursive(childFolder, 0, false); diff --git a/frontend/index.html b/frontend/index.html index b9c4330..1b7c1b6 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -763,6 +763,10 @@ border-left-color: var(--accent-primary); } + .hover-accent.active:hover { + transform: translateX(2px); + } + /* Tag chip - same effect but no margin */ .tag-chip { border-left: 3px solid transparent; @@ -1586,7 +1590,7 @@
-