Summary
Today the focus queue is only populated when the user explicitly clicks the pin button on a session in the sidebar. We want two automatic pinning behaviors so focus mode always reflects what the user is actively working on:
- Pin every newly created session automatically, regardless of whether focus mode is currently active.
- Pin every session the user interacts with (e.g. opens, sends a message to, or navigates into) that is not already pinned.
Motivation
- Focus mode is currently gated on having at least one pinned session (see
client/src/App.tsx: the "Pin a session to use focus mode" toast), which is a poor first-run experience.
- Users naturally assume "the conversation I just started" is part of their focus queue. Forcing an extra manual click on every new session is friction.
- If we auto-pin on interaction, focus mode becomes a faithful picture of what the user is currently doing, with no extra bookkeeping.
Proposed Behavior
Auto-pin on creation
- When a brand-new session is created via
startSession (or the server-side equivalent when a session is first persisted), set focusPinnedAt on the session automatically.
- Resuming an existing session should not change its pinned state.
- A user who explicitly unpins a brand-new session should not have it re-pinned silently on the next interaction. Unpin is treated as a user preference for that session.
Auto-pin on interaction
- The "interact" signal should include at least:
- Opening/navigating into a session (
handleSelectSession, handleNewThread, openFocusItem).
- Sending a message to a session (the
startSession call from SessionView with a non-resume sessionId).
- Interaction-triggered pinning must be a no-op for sessions that are already pinned (
focusPinnedAt set) and must respect an explicit prior unpin for that session (see "edge cases" below).
- Interaction-triggered pinning should work whether or not focus mode is currently active.
Edge cases to think through
- Unpin semantics: if a user unpins session X and later interacts with it, should it be re-pinned? Two reasonable options:
- (a) Yes — "unpin" is a soft action and any new interaction re-pins.
- (b) No — track a per-session "user-unpinned" flag so we don't keep re-pinning against the user's explicit choice.
- Please call out which option you want in the issue comments before implementation; default suggestion: (b), with the flag cleared when the session is archived or when focus mode is exited globally.
- Archived sessions: auto-pin should never resurrect an archived session into the focus queue.
- Plan-mode / resumed sessions: resuming a session is not a "new" session and should not auto-pin; sending a fresh message to a resumed session is an interaction and should.
- Focus mode is off: the auto-pinning still happens; it just populates the queue for whenever the user enables focus mode.
Affected Areas (from a quick code read)
server/lib/sessions.ts — updateSessionFocus already mutates focusPinnedAt; the server-side session-create path will need to set it on first persist.
client/src/api.ts — startSession is the client entry point for new sessions; pinSessionFocus already exists.
client/src/App.tsx — natural place to react to handleNewThread / handleSelectSession / openFocusItem and call pinSessionFocus when appropriate.
client/src/pages/SessionView.tsx — the message-send path; may need to also signal "interaction" for resumed sessions.
client/src/components/sidebar.tsx — pin/unpin button should still reflect effective state, including the "user-unpinned" flag if we go with option (b).
Acceptance Criteria
Open Questions
- Confirm option (a) vs (b) for the unpin-then-interact case (see Edge cases).
- Should the auto-pin be visible to the user via a toast (e.g. "Pinned to focus") or be silent? Default suggestion: silent to avoid noise, with a small "auto-pinned" indicator in the sidebar so it's discoverable.
- Do we want a global setting to opt out of auto-pinning? Default suggestion: not in this issue, revisit later if requested.
Summary
Today the focus queue is only populated when the user explicitly clicks the pin button on a session in the sidebar. We want two automatic pinning behaviors so focus mode always reflects what the user is actively working on:
Motivation
client/src/App.tsx: the "Pin a session to use focus mode" toast), which is a poor first-run experience.Proposed Behavior
Auto-pin on creation
startSession(or the server-side equivalent when a session is first persisted), setfocusPinnedAton the session automatically.Auto-pin on interaction
handleSelectSession,handleNewThread,openFocusItem).startSessioncall fromSessionViewwith a non-resumesessionId).focusPinnedAtset) and must respect an explicit prior unpin for that session (see "edge cases" below).Edge cases to think through
Affected Areas (from a quick code read)
server/lib/sessions.ts—updateSessionFocusalready mutatesfocusPinnedAt; the server-side session-create path will need to set it on first persist.client/src/api.ts—startSessionis the client entry point for new sessions;pinSessionFocusalready exists.client/src/App.tsx— natural place to react tohandleNewThread/handleSelectSession/openFocusItemand callpinSessionFocuswhen appropriate.client/src/pages/SessionView.tsx— the message-send path; may need to also signal "interaction" for resumed sessions.client/src/components/sidebar.tsx— pin/unpin button should still reflect effective state, including the "user-unpinned" flag if we go with option (b).Acceptance Criteria
Open Questions