From 8a56bed5455625e1514f8d9a5d247f630ac2b8eb Mon Sep 17 00:00:00 2001 From: Ride Control Date: Tue, 4 Aug 2026 19:47:37 -0700 Subject: [PATCH 1/2] Select latest saved session --- src/components/session-history.tsx | 8 +------- src/hooks/use-session-history.ts | 22 ++++++++++++++++------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/components/session-history.tsx b/src/components/session-history.tsx index f613cc4..1cf49d8 100644 --- a/src/components/session-history.tsx +++ b/src/components/session-history.tsx @@ -100,7 +100,7 @@ export function SessionHistory({ selectSession: selectHistorySession, summaries, total, - } = useSessionHistory(open, requestedSessionId); + } = useSessionHistory(open, requestedSessionId, onSelectSessionId); const [storedHistoryView, setStoredHistoryView] = useState(loadSessionHistoryView); const historyView = requestedView ?? storedHistoryView; @@ -128,12 +128,6 @@ export function SessionHistory({ const navigationSummaries = historyView === SESSION_HISTORY_VIEW.CALENDAR ? calendarSummaries : summaries; - useEffect(() => { - if (open && selected) { - onSelectSessionId?.(selected.id); - } - }, [onSelectSessionId, open, selected]); - useEffect(() => { if (!open) { setDeleteConfirmationOpen(false); diff --git a/src/hooks/use-session-history.ts b/src/hooks/use-session-history.ts index bdc2af0..18deaf0 100644 --- a/src/hooks/use-session-history.ts +++ b/src/hooks/use-session-history.ts @@ -19,7 +19,11 @@ import type { SavedSession, SavedSessionSummary } from '../types'; const PAGE_SIZE = 30; -export function useSessionHistory(open: boolean, preferredSessionId?: string) { +export function useSessionHistory( + open: boolean, + preferredSessionId?: string, + onSelectSessionId?: (sessionId: string) => void +) { const [summaries, setSummaries] = useState([]); const [total, setTotal] = useState(0); const [selected, setSelected] = useState(); @@ -40,11 +44,17 @@ export function useSessionHistory(open: boolean, preferredSessionId?: string) { const historyLoadGeneration = useRef(0); const historyInitialized = useRef(false); - const rememberSelectedSession = useCallback((id: string | undefined) => { - selectedIdRef.current = id; - setSelectedId(id); - saveSelectedSessionId(id); - }, []); + const rememberSelectedSession = useCallback( + (id: string | undefined) => { + selectedIdRef.current = id; + setSelectedId(id); + saveSelectedSessionId(id); + if (id) { + onSelectSessionId?.(id); + } + }, + [onSelectSessionId] + ); const selectSession = useCallback( async (id: string) => { From 06f43d8fd8a3bd4a71b7f39c4fc617201be08215 Mon Sep 17 00:00:00 2001 From: Ride Control Date: Tue, 4 Aug 2026 19:47:38 -0700 Subject: [PATCH 2/2] Define release workflow --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index b16984b..b50b60e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -17,6 +17,7 @@ - When the user says "add, commit", group all existing changes into logical sets, stage and commit each group, and repeat until every change is committed and the working tree is clean. - Always make changes on a descriptively named task branch, never on `main`. At the start of every new work request, check the current Git branch before changing any file; if the current branch is `main`, create and switch to the task branch first. - Never push work directly to `main`. If `main` already contains uncommitted changes or commits that have not been pushed, create the task branch from its current state so all of that work moves forward on the new branch, then continue the normal workflow there. +- Treat "release" as exactly equivalent to "add, commit, push, pr, merge" and complete the same full delivery workflow. - When the user says "add, commit, push, pr, merge" or otherwise confirms that the work is ready, complete the delivery workflow in order: group and commit all changes until the tree is clean, run `bun run ci` for the exact commit being delivered, push the task branch, open a pull request targeting `main`, and merge the pull request without depending on GitHub Actions while it is unavailable. If local CI fails or the pull request cannot merge, fix the problem on the same task branch and repeat the relevant steps. - Keep React component modules compatible with Vite Fast Refresh: export only React components from component files, and move non-component runtime exports such as constants, helpers, and metadata into separate modules to avoid incompatible-export invalidations. - Record every new user-facing feature in the README as part of implementing it.