Skip to content

Commit e2ff47a

Browse files
committed
palette: Build with pi shows the agent's own logo
1 parent c9f8642 commit e2ff47a

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎ui/src/features/palette/AskAi.test.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ describe('Build with pi in the palette', () => {
122122
renderApp('/apps')
123123
const dialog = await search('create a Streamlit app')
124124
const row = await within(dialog).findByRole('option', { name: /Build with pi: create a Streamlit app/ })
125+
// The agent's own logo, as on its app card, not a generic icon.
126+
expect(row.querySelector('.logo img')?.getAttribute('src')).toMatch(/pi/)
125127
await userEvent.click(row)
126128
await vi.waitFor(() => expect(calls.calls.find((c) => c.path === '/api/ai/agent/build')?.body).toEqual({ request: 'create a Streamlit app' }))
127129
await vi.waitFor(() => expect(location()).toBe('/apps/create-a-streamlit-app'))

‎ui/src/features/palette/AskAi.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Bot, CheckCheck, Plus, Server, Sparkles } from 'lucide-react'
22
import { useEffect, useRef, useState, type ReactNode } from 'react'
33
import { useNavigate } from 'react-router'
4+
import { KindLogo } from '../../components/KindLogo'
45
import { useAdminReport, useAgentStatus, useAiFeature, useAiCommand, useAskAdmin, useBuildWithAgent, useDecidePlan } from '../ai/ai'
56
import type { DraftView, Plan } from '../../api'
67
import { Button } from '../../components/Button'
@@ -192,7 +193,7 @@ export function useAskSection(): (query: string) => PaletteSection | undefined {
192193
const items: PaletteItem[] = []
193194
if (builds) {
194195
const name = agent.template
195-
items.push(ask('ai:build', `Build with ${name}: ${text}`, <Bot size={16} />, <BuildPanel text={text} agent={agent.templateName || name} />))
196+
items.push(ask('ai:build', `Build with ${name}: ${text}`, <KindLogo kind={agent.template} />, <BuildPanel text={text} agent={agent.templateName || name} />))
196197
}
197198
if (palette) items.push(ask('ai:ask', `Ask AI: ${text}`, <Sparkles size={16} />, <AskPanel text={text} />))
198199
if (admin) items.push(ask('ai:admin', `Ask about this cluster: ${text}`, <Server size={16} />, <AdminPanel text={text} />))

0 commit comments

Comments
 (0)