mirror of
https://github.com/humanlayer/humanlayer.git
synced 2025-08-20 19:01:22 +03:00
Merge pull request #416 from dexhorthy/dexter/eng-1735-shiftr-hotkey-to-rename-session
dexter/eng 1735 shiftr hotkey to rename session
This commit is contained in:
@@ -37,6 +37,7 @@ const hotkeyData = [
|
||||
{ category: 'Session List', key: 'Shift+K', description: 'Select upward' },
|
||||
{ category: 'Session List', key: 'Enter', description: 'Open session' },
|
||||
{ category: 'Session List', key: 'E', description: 'Archive/unarchive' },
|
||||
{ category: 'Session List', key: '⌘+R', description: 'Rename session' },
|
||||
{ category: 'Session List', key: 'Tab', description: 'Toggle normal/archived view' },
|
||||
{ category: 'Session List', key: 'Escape', description: 'Exit archived view' },
|
||||
|
||||
@@ -50,6 +51,7 @@ const hotkeyData = [
|
||||
{ category: 'Session Detail', key: 'A', description: 'Approve' },
|
||||
{ category: 'Session Detail', key: 'D', description: 'Deny' },
|
||||
{ category: 'Session Detail', key: 'E', description: 'Archive session' },
|
||||
{ category: 'Session Detail', key: '⌘+R', description: 'Rename session' },
|
||||
{ category: 'Session Detail', key: 'Ctrl+X', description: 'Interrupt session' },
|
||||
{ category: 'Session Detail', key: 'P', description: 'Go to parent session' },
|
||||
{ category: 'Session Detail', key: '⌘+Y', description: 'Toggle fork view' },
|
||||
|
||||
@@ -692,6 +692,21 @@ function SessionDetail({ session, onClose }: SessionDetailProps) {
|
||||
},
|
||||
)
|
||||
|
||||
// Rename session hotkey
|
||||
useHotkeys(
|
||||
'meta+r',
|
||||
() => {
|
||||
startEditTitle()
|
||||
},
|
||||
{
|
||||
scopes: SessionDetailHotkeysScope,
|
||||
enabled: !isEditingTitle,
|
||||
preventDefault: true,
|
||||
enableOnFormTags: false,
|
||||
},
|
||||
[startEditTitle, isEditingTitle],
|
||||
)
|
||||
|
||||
useStealHotkeyScope(SessionDetailHotkeysScope)
|
||||
|
||||
// Note: Most hotkeys are handled by the hooks (ctrl+x, r, p, i, a, d)
|
||||
|
||||
@@ -360,6 +360,23 @@ export default function SessionTable({
|
||||
[focusedSession, toggleSessionSelection],
|
||||
)
|
||||
|
||||
// Rename session hotkey
|
||||
useHotkeys(
|
||||
'meta+r',
|
||||
() => {
|
||||
if (focusedSession) {
|
||||
startEdit(focusedSession.id, focusedSession.title || '', focusedSession.summary || '')
|
||||
}
|
||||
},
|
||||
{
|
||||
scopes: SessionTableHotkeysScope,
|
||||
enabled: !isSessionLauncherOpen && focusedSession !== null && editingSessionId === null,
|
||||
preventDefault: true,
|
||||
enableOnFormTags: false,
|
||||
},
|
||||
[focusedSession, startEdit, editingSessionId],
|
||||
)
|
||||
|
||||
return (
|
||||
<>
|
||||
{sessions.length > 0 ? (
|
||||
|
||||
Reference in New Issue
Block a user