Skip to content

Commit e086410

Browse files
jasonczcclaude
andcommitted
feat(web): wire Rename in sidebar kebab via window.prompt
Calls api.renameSession and invalidates session query on success. Menu now: Rename / Share / — / Archive / Delete. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 89a83b9 commit e086410

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

web/src/router.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,20 @@ function SessionsPage() {
479479
// then delete from the session store. Errors are logged but don't block the UI.
480480
const sidebarQueryClient = useQueryClient()
481481

482+
const renameSessionFromSidebar = useCallback(async (sessionId: string, currentName: string) => {
483+
if (!api) return
484+
const next = window.prompt('Rename session', currentName)
485+
if (next === null) return
486+
const trimmed = next.trim()
487+
if (!trimmed || trimmed === currentName) return
488+
try {
489+
await api.renameSession(sessionId, trimmed)
490+
await sidebarQueryClient.invalidateQueries({ queryKey: queryKeys.sessions })
491+
} catch (err) {
492+
console.error('Failed to rename session from sidebar:', err)
493+
}
494+
}, [api, sidebarQueryClient])
495+
482496
const shareSessionFromSidebar = useCallback(async (sessionId: string) => {
483497
if (typeof window === 'undefined') return
484498
const url = `${window.location.origin}/sessions/${sessionId}`
@@ -707,6 +721,17 @@ function SessionsPage() {
707721
zIndex: 200,
708722
}}
709723
>
724+
<button
725+
className="menu-action"
726+
onClick={(e) => {
727+
e.stopPropagation()
728+
setOpenMenuSessionId(null)
729+
setSessionMenuAnchor(null)
730+
void renameSessionFromSidebar(session.id, title)
731+
}}
732+
>
733+
Rename
734+
</button>
710735
<button
711736
className="menu-action"
712737
onClick={(e) => {

0 commit comments

Comments
 (0)