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.