chore: update spinner for /btw

This commit is contained in:
Jack Wotherspoon
2026-04-09 10:02:49 -04:00
parent ae433fbef7
commit 2aa95c4d01
2 changed files with 7 additions and 15 deletions
@@ -7,15 +7,8 @@
import { describe, it, expect } from 'vitest';
import { renderWithProviders } from '../../test-utils/render.js';
import { BtwDisplay } from './BtwDisplay.js';
import { StreamingState } from '../types.js';
import type { UIState } from '../contexts/UIStateContext.js';
import { Text } from 'ink';
vi.mock('./GeminiRespondingSpinner.js', () => ({
GeminiRespondingSpinner: () => <Text></Text>,
}));
describe('BtwDisplay', () => {
const defaultMockUiState = {
renderMarkdown: true,
@@ -71,7 +64,7 @@ describe('BtwDisplay', () => {
unmount();
});
it('renders a spinner when streaming', async () => {
it('renders a spinner and "Answering..." when streaming', async () => {
const { lastFrame, unmount } = await renderWithProviders(
<BtwDisplay
query="What is life?"
@@ -81,14 +74,11 @@ describe('BtwDisplay', () => {
terminalWidth={100}
/>,
{
uiState: {
...defaultMockUiState,
streamingState: StreamingState.Responding,
},
uiState: defaultMockUiState,
},
);
const frame = lastFrame();
expect(frame).toContain('⠋'); // Assuming standard spinner frame
expect(frame).toContain('Answering...');
unmount();
});
});
@@ -9,7 +9,7 @@ import { Box, Text } from 'ink';
import { theme } from '../semantic-colors.js';
import { MarkdownDisplay } from '../utils/MarkdownDisplay.js';
import { useUIState } from '../contexts/UIStateContext.js';
import { GeminiRespondingSpinner } from './GeminiRespondingSpinner.js';
import { CliSpinner } from './CliSpinner.js';
interface BtwDisplayProps {
query: string;
@@ -74,7 +74,9 @@ export const BtwDisplay: React.FC<BtwDisplayProps> = ({
{isStreaming && (
<Box marginTop={1}>
<GeminiRespondingSpinner />
<Text color={theme.text.accent}>
<CliSpinner type="dots" /> Answering...
</Text>
</Box>
)}
</Box>