fix(sessions): keep created-session scope through navigation and send (#10)

createSession now stamps the scope directory onto the returned session, and the
create-session navigation passes that directory to the detail screen. Previously
a freshly created home-scoped session was opened/addressed with the default
(CWD) client because the route carried no directory param — the same scope
mismatch class as #10, on the open/send path instead of the list path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
engineer
2026-06-01 23:49:19 -07:00
parent bed0b6f622
commit 66b89f74d4
2 changed files with 14 additions and 3 deletions

View File

@@ -188,7 +188,10 @@ export default function SessionsScreen() {
const onCreateSession = async () => {
const session = await createSession()
if (session) {
router.push(`/session/${session.id}`)
router.push({
pathname: `/session/[id]`,
params: { id: session.id, ...(session.directory ? { directory: session.directory } : {}) },
})
}
}
@@ -227,7 +230,10 @@ export default function SessionsScreen() {
setShowNewSession(false)
setCustomDir("")
if (session) {
router.push(`/session/${session.id}`)
router.push({
pathname: `/session/[id]`,
params: { id: session.id, ...(session.directory ? { directory: session.directory } : {}) },
})
}
}