diff --git a/frontend/app.js b/frontend/app.js index b55c0a4..e602b9c 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -85,7 +85,10 @@ function noteApp() { // Mobile sidebar state mobileSidebarOpen: false, - + + // Desktop sidebar state + sidebarHidden: false, + // Split view resize state editorWidth: 50, // percentage isResizingSplit: false, @@ -116,6 +119,7 @@ function noteApp() { this.loadSidebarWidth(); this.loadEditorWidth(); this.loadViewMode(); + this.loadSidebarHiddenState(); // Parse URL and load specific note if provided this.loadNoteFromURL(); @@ -2545,6 +2549,25 @@ function noteApp() { saveEditorWidth() { localStorage.setItem('editorWidth', this.editorWidth.toString()); }, + + // Load sidebar hidden state from localStorage + loadSidebarHiddenState() { + const saved = localStorage.getItem('sidebarHidden'); + if (saved) { + this.sidebarHidden = saved === 'true'; + } + }, + + // Toggle sidebar visibility + toggleSidebar() { + this.sidebarHidden = !this.sidebarHidden; + localStorage.setItem('sidebarHidden', this.sidebarHidden.toString()); + + // When showing sidebar, ensure it has the proper width + if (!this.sidebarHidden && this.sidebarWidth < 200) { + this.sidebarWidth = CONFIG.DEFAULT_SIDEBAR_WIDTH; + } + }, // Scroll to top of editor and preview scrollToTop() { diff --git a/frontend/index.html b/frontend/index.html index 8a4b366..997fc51 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -700,6 +700,19 @@ } } + /* Sidebar visibility */ + .sidebar-hidden { + width: 0px !important; + min-width: 0px !important; + max-width: 0px !important; + overflow: hidden; + border-right: none !important; + } + + .sidebar-resize-handle-hidden { + display: none !important; + } + /* Hide mobile menu button on desktop */ @media (min-width: 769px) { .mobile-menu-button { @@ -721,10 +734,10 @@
-
@@ -995,9 +1008,10 @@

+ + + + - -