From a6c4888e92b15b36517a024440fdf1e7a5d49c7d Mon Sep 17 00:00:00 2001 From: npeter83 Date: Tue, 30 Jun 2026 04:47:54 +0200 Subject: [PATCH] fix(channel): let the nav rail navigate away from a channel page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The channel page overlays the content column via channelView, which setPage didn't clear — so clicking a rail item did nothing (and the next===page early-return blocked 'Feed' when a channel was opened from the feed). setPage now clears channelView and proceeds even when the underlying page is unchanged. --- frontend/src/App.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 882b168..62cd479 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -208,14 +208,17 @@ export default function App() { } function setPage(next: Page) { - if (next === page) return; + // While a channel page is open it overlays the content column, so a nav click must close it + // even when the underlying page is unchanged (e.g. "Feed" while a channel opened from the feed). + if (next === page && !channelView) return; const go = () => { + setChannelView(null); // leave any open channel page when navigating via the rail setPageState(next); localStorage.setItem(PAGE_KEY, next); // Push an in-app history entry so the browser/mouse Back button steps through pages // instead of leaving the app (e.g. back to the OAuth redirect). The URL stays clean — // the page rides in history.state, not the query string (filters never go in the URL). - // A fresh { sfPage } (no carried-over _sub/_ov markers) so each page starts at its root. + // A fresh { sfPage } (no carried-over _sub/_ov/_chan markers) so each page starts at its root. window.history.pushState({ sfPage: next }, ""); }; // Guard leaving the Settings page with unsaved preference changes.