feat: Add dynamic slash commands from Claude with UI improvements
- Load available commands from Claude at session start (control_initialized event) - Display commands in autocomplete dropdown with search in name and description - Group commands into "UI Commands" and "Claude Commands" sections - Shorten display names by removing common prefixes (taches-cc-resources:, claude-mem:) - Blacklist TUI-only commands (vim, terminal-setup, ide, etc.) - Add max-height with scrollbar for long command lists - Implement auto-scroll to keep selected command visible during keyboard navigation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,7 @@ function createSessionState(id, host = 'neko', project = '/home/sumdex/projects'
|
||||
},
|
||||
permissionMode: 'default',
|
||||
controlInitialized: false,
|
||||
availableCommands: [], // Slash commands from Claude
|
||||
pendingPermission: null,
|
||||
unreadCount: 0,
|
||||
currentContext: null, // For dynamic tab naming
|
||||
@@ -156,11 +157,12 @@ export function SessionProvider({ children }) {
|
||||
const updateSession = useCallback((sessionId, updates) => {
|
||||
setSessions(prev => {
|
||||
if (!prev[sessionId]) return prev;
|
||||
const newUpdates = typeof updates === 'function' ? updates(prev[sessionId]) : updates;
|
||||
return {
|
||||
...prev,
|
||||
[sessionId]: {
|
||||
...prev[sessionId],
|
||||
...(typeof updates === 'function' ? updates(prev[sessionId]) : updates),
|
||||
...newUpdates,
|
||||
},
|
||||
};
|
||||
});
|
||||
@@ -444,6 +446,7 @@ export function SessionProvider({ children }) {
|
||||
case 'control_initialized': {
|
||||
updateSession(sessionId, {
|
||||
controlInitialized: true,
|
||||
availableCommands: data.commands || [],
|
||||
});
|
||||
// Restore saved permission mode after control is initialized
|
||||
// Read from localStorage since sessions state may be stale in this callback
|
||||
|
||||
Reference in New Issue
Block a user