@miphamai/cli 0.24.9 → 0.24.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/agent-view/dashboard.tsx +45 -3
package/package.json
CHANGED
|
@@ -31,6 +31,13 @@ export function AgentViewDashboard({ manager, onAttach, onExit }: DashboardProps
|
|
|
31
31
|
const [selectedIndex, setSelectedIndex] = useState(0)
|
|
32
32
|
const [peekingSessionId, setPeekingSessionId] = useState<string | null>(null)
|
|
33
33
|
const [_groupBy, setGroupBy] = useState<'status' | 'directory'>('status')
|
|
34
|
+
const [feedback, setFeedback] = useState<string | null>(null)
|
|
35
|
+
|
|
36
|
+
// Flash a brief feedback message that auto-clears
|
|
37
|
+
const showFeedback = useCallback((msg: string) => {
|
|
38
|
+
setFeedback(msg)
|
|
39
|
+
setTimeout(() => setFeedback(null), 1800)
|
|
40
|
+
}, [])
|
|
34
41
|
|
|
35
42
|
// Build a flat list of sessions in group order, with group headers
|
|
36
43
|
const flatList = useMemo(() => {
|
|
@@ -99,26 +106,39 @@ export function AgentViewDashboard({ manager, onAttach, onExit }: DashboardProps
|
|
|
99
106
|
// Ctrl+S — toggle group by (status ↔ directory)
|
|
100
107
|
if (input === '\x13') {
|
|
101
108
|
setGroupBy((prev) => (prev === 'status' ? 'directory' : 'status'))
|
|
109
|
+
showFeedback(`Grouped by ${_groupBy === 'status' ? 'directory' : 'status'}`)
|
|
102
110
|
return
|
|
103
111
|
}
|
|
104
112
|
|
|
105
113
|
// Ctrl+R — rename selected session
|
|
106
114
|
if (input === '\x12') {
|
|
107
|
-
if (sessionsOnly.length === 0)
|
|
115
|
+
if (sessionsOnly.length === 0) {
|
|
116
|
+
showFeedback('No sessions to rename')
|
|
117
|
+
return
|
|
118
|
+
}
|
|
108
119
|
const current = sessionsOnly[selectedIndex]
|
|
109
120
|
if (!current) return
|
|
110
121
|
const newTitle = `session-${Date.now().toString(36)}`
|
|
111
122
|
manager.rename(current.session.id, newTitle)
|
|
123
|
+
showFeedback(`Renamed to ${newTitle}`)
|
|
112
124
|
return
|
|
113
125
|
}
|
|
114
126
|
|
|
115
127
|
if (input === 'j') {
|
|
128
|
+
if (sessionsOnly.length === 0) {
|
|
129
|
+
showFeedback('No sessions to navigate — spawn a background agent first')
|
|
130
|
+
return
|
|
131
|
+
}
|
|
116
132
|
setSelectedIndex((prev) => Math.min(prev + 1, sessionsOnly.length - 1))
|
|
117
133
|
setPeekingSessionId(null)
|
|
118
134
|
return
|
|
119
135
|
}
|
|
120
136
|
|
|
121
137
|
if (input === 'k') {
|
|
138
|
+
if (sessionsOnly.length === 0) {
|
|
139
|
+
showFeedback('No sessions to navigate — spawn a background agent first')
|
|
140
|
+
return
|
|
141
|
+
}
|
|
122
142
|
setSelectedIndex((prev) => Math.max(prev - 1, 0))
|
|
123
143
|
setPeekingSessionId(null)
|
|
124
144
|
return
|
|
@@ -126,7 +146,10 @@ export function AgentViewDashboard({ manager, onAttach, onExit }: DashboardProps
|
|
|
126
146
|
|
|
127
147
|
// Space — toggle peek
|
|
128
148
|
if (input === ' ') {
|
|
129
|
-
if (sessionsOnly.length === 0)
|
|
149
|
+
if (sessionsOnly.length === 0) {
|
|
150
|
+
showFeedback('No sessions to peek')
|
|
151
|
+
return
|
|
152
|
+
}
|
|
130
153
|
const current = sessionsOnly[selectedIndex]
|
|
131
154
|
if (!current) return
|
|
132
155
|
setPeekingSessionId(peekingSessionId === current.session.id ? null : current.session.id)
|
|
@@ -135,7 +158,10 @@ export function AgentViewDashboard({ manager, onAttach, onExit }: DashboardProps
|
|
|
135
158
|
|
|
136
159
|
// Enter — attach to selected session
|
|
137
160
|
if (key.return) {
|
|
138
|
-
if (sessionsOnly.length === 0)
|
|
161
|
+
if (sessionsOnly.length === 0) {
|
|
162
|
+
showFeedback('No sessions to attach — spawn a background agent first')
|
|
163
|
+
return
|
|
164
|
+
}
|
|
139
165
|
const current = sessionsOnly[selectedIndex]
|
|
140
166
|
if (!current) return
|
|
141
167
|
if (peekingSessionId) {
|
|
@@ -198,6 +224,13 @@ export function AgentViewDashboard({ manager, onAttach, onExit }: DashboardProps
|
|
|
198
224
|
<Text dimColor>
|
|
199
225
|
Use the Agent tool or type "run this in background" to spawn one.
|
|
200
226
|
</Text>
|
|
227
|
+
{feedback && (
|
|
228
|
+
<Box marginTop={1}>
|
|
229
|
+
<Text color="yellow" dimColor>
|
|
230
|
+
⚡ {feedback}
|
|
231
|
+
</Text>
|
|
232
|
+
</Box>
|
|
233
|
+
)}
|
|
201
234
|
</Box>
|
|
202
235
|
) : (
|
|
203
236
|
<Box flexDirection="column">
|
|
@@ -232,6 +265,15 @@ export function AgentViewDashboard({ manager, onAttach, onExit }: DashboardProps
|
|
|
232
265
|
{peekData && (
|
|
233
266
|
<SessionPeek session={peekData.session} recentMessages={peekData.recentMessages} />
|
|
234
267
|
)}
|
|
268
|
+
|
|
269
|
+
{/* Feedback toast — flashes briefly on action */}
|
|
270
|
+
{feedback && (
|
|
271
|
+
<Box marginTop={1}>
|
|
272
|
+
<Text color="yellow" dimColor>
|
|
273
|
+
⚡ {feedback}
|
|
274
|
+
</Text>
|
|
275
|
+
</Box>
|
|
276
|
+
)}
|
|
235
277
|
</Box>
|
|
236
278
|
)
|
|
237
279
|
}
|