Note
Grok responding on behalf of Julius.
Triage
Thanks @WarutC for the clear repro. Reading current main (b38aa18365), which matches the 0.0.45 build in the report, I don't see a duplicate. navigation.back / navigation.forward only call history.back() / history.forward() (NavigationHistoryShortcuts in apps/web/src/components/AppSidebarLayout.tsx). Highlight is route-driven: a row that is actually rendered gets the active style whenever its key matches the route, including after history navigation.
What I found
- Some cases already follow the route.
- Default sidebar (legacy sidebar off): a settled thread past "Show more" is inserted into the visible tail when it is the open route, and a collapsed Working, Snoozed, or Settled shelf still renders the open thread's row.
sidebarThreadPreviewCount(default 6) is unused here; the settled page starts at 10. - Legacy sidebar (Settings → Legacy features → Sidebar): a collapsed project still renders the open thread as that project's only row. The project header stays collapsed.
- Default sidebar (legacy sidebar off): a settled thread past "Show more" is inserted into the visible tail when it is the open route, and a collapsed Working, Snoozed, or Settled shelf still renders the open thread's row.
- Two gaps are real, and they're shared by every route change, including the command palette. A click only looks correct when that row was already on screen.
- Default sidebar project scope.
filterSidebarV2VisibleThreadsdrops every thread outside the scoped project, with no exception for the open route.setSidebarProjectScopeKeyruns from the scope menu, the "filter by project" context-menu item, and when a saved scope's project disappears. Going back to a thread in another project leaves the filter in place, so the row isn't rendered and there's nothing to highlight. Pinning doesn't bypass that filter. - Legacy sidebar, project expanded, thread past the preview count, "show more" not opened. The rendered list is the preview slice (
sidebarThreadPreviewCount, default 6). The open thread isn't added.
- Default sidebar project scope.
- No scroll-into-view. Neither sidebar scrolls the active row into view. The only
scrollIntoViewin the thread sidebar is for search results, so a row that exists below the fold stays off screen after history navigation.
Likely fix area
Sidebar route follow / filterSidebarV2VisibleThreads and the legacy preview slice. Some options:
- For a scoped project filter, either widen the scope when the open thread is outside it, or keep the filter and still show the open row (what the shelves already do).
- In the legacy sidebar, include the open thread in the preview list when it sits past
sidebarThreadPreviewCount. - Scroll the active row into view on route change, not only for search results.
Which sidebar was on, and which of those two gaps you hit, would help pin the fix.
A maintainer will decide on the fix direction.