Description
The notification badge (red/blue dot) displayed on the top-right of sidebar project icons does not disappear after the user views the session or refreshes the page.
Steps to Reproduce
- Open opencode web UI
- Have an active session that receives a response (AI turn completes)
- A red/blue dot appears on the sidebar project icon
- Click into the session to view it
- Expected: Badge disappears
- Actual: Badge remains visible
- Refresh the page
- Expected: Badge disappears (state was viewed)
- Actual: Badge still remains visible
Root Cause (Technical)
markViewed() is only called inside syncSessionRoute() when the session changes (line 1658 in layout.tsx):
if (session !== activeRoute.session) {
activeRoute.session = session
activeRoute.sessionProject = syncSessionRoute(directory, id, root) // markViewed called here
return
}
This means:
- If the user is already on the session when a notification arrives →
markViewed() is never called
- After page refresh, the same session URL is restored →
session !== activeRoute.session is false on first render → markViewed() is never called
- Notification state is persisted to
localStorage with viewed: false, so it survives refresh
Environment
- Platform: Web UI
- Component:
packages/app/src/pages/layout.tsx, packages/app/src/context/notification.tsx
Suggested Fix
- Call
markViewed() on initial page load if the current URL matches a session
- Or add a reactive effect that calls
markViewed() whenever the current session has unseen notifications
Description
The notification badge (red/blue dot) displayed on the top-right of sidebar project icons does not disappear after the user views the session or refreshes the page.
Steps to Reproduce
Root Cause (Technical)
markViewed()is only called insidesyncSessionRoute()when the session changes (line 1658 inlayout.tsx):This means:
markViewed()is never calledsession !== activeRoute.sessionisfalseon first render →markViewed()is never calledlocalStoragewithviewed: false, so it survives refreshEnvironment
packages/app/src/pages/layout.tsx,packages/app/src/context/notification.tsxSuggested Fix
markViewed()on initial page load if the current URL matches a sessionmarkViewed()whenever the current session has unseen notifications