From 9fbc6bf2a4492d55ca5c80530ecc69cbcbee2323 Mon Sep 17 00:00:00 2001 From: Jared Wolff Date: Tue, 10 Mar 2026 21:22:53 -0400 Subject: [PATCH] fix(ui): photos view bleeding into trash view The trash nav handler manually set view flags instead of calling setCurrentSection('trash'), which meant the photos container was never hidden when switching to trash. Use the central view-switching function so all other views (photos, shared) are properly cleaned up. Co-Authored-By: Claude Opus 4.6 --- static/js/app/main.js | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/static/js/app/main.js b/static/js/app/main.js index d51f856a..bc7a984d 100755 --- a/static/js/app/main.js +++ b/static/js/app/main.js @@ -445,42 +445,20 @@ function setupEventListeners() { // Check if this is the trash item if (item === elements.trashBtn) { - // Hide shared view if active - if (app.isSharedView) { - // Hide shared view - if (window.sharedView) { - window.sharedView.hide(); - } - - // Reset shared view flag - app.isSharedView = false; - - // Clean up shared containers if they exist - const sharedContainer = document.getElementById('shared-container'); - if (sharedContainer) { - sharedContainer.style.display = 'none'; - } - } - + setCurrentSection('trash'); + // Hide breadcrumb (only shown in Files view) const breadcrumb = document.querySelector('.breadcrumb'); if (breadcrumb) breadcrumb.style.display = 'none'; - - // Show trash view - app.isTrashView = true; - app.currentSection = 'trash'; - + // Show files containers (to be filled with trash) const filesGrid = document.getElementById('files-grid'); const filesListView = document.getElementById('files-list-view'); if (filesGrid) { filesGrid.style.display = app.currentView === 'grid' ? 'grid' : 'none'; filesGrid.classList.toggle('hidden', app.currentView !== 'grid'); } if (filesListView) { filesListView.style.display = app.currentView === 'list' ? 'flex' : 'none'; filesListView.classList.toggle('hidden', app.currentView !== 'list'); } - - // Update UI - elements.pageTitle.textContent = window.i18n ? window.i18n.t('nav.trash') : 'Trash'; - elements.pageTitle.setAttribute('data-i18n', 'nav.trash'); + setActionsBarMode('trash'); - + // Load trash items window.loadTrashItems(); } else {