Matt Toohey 7ff4d2a6a4 fix: highlight project row in sidebar for new conversations, clear for standalone drafts (#116)
* fix: highlight project row in sidebar when starting new chat in a project

When starting a new conversation with a project selected, the sidebar
now highlights the project row instead of leaving the previous session
highlighted (or showing no highlight at all).

The root cause: draft sessions are excluded from the sidebar's session
list, so the activeSessionRefCallback never fires for them. The
highlight useEffect would early-return when activeSessionId was set,
leaving a stale highlight.

The fix computes an activeProjectId when the active session is a draft
belonging to a project, and uses an activeProjectRefCallback to position
the sliding highlight on the parent project row.

* Clear sidebar highlight for standalone draft sessions

When starting a new conversation without a project, the sidebar now
shows no highlight instead of keeping the previous selection.

The highlight logic now distinguishes three draft cases:
- Draft in project → highlight the project row (previous commit)
- Standalone draft → clear the highlight entirely (this commit)
- Non-draft session → ref callback positions the highlight as before
2026-04-08 14:26:21 +10:00
S
Description
an open-source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Apache-2.0 2 GiB
Languages
Rust 63.6%
TypeScript 29.6%
JavaScript 1.7%
Shell 1.6%
Python 1.5%
Other 1.8%