more refine

This commit is contained in:
Saxon Fletcher committed 2026-08-04 14:21:52 +10:00
1 parent ffe35b95d3
commit 302df2b2f7
3 files changed
+5 -11

No files matched your search

@@ -231,13 +231,13 @@ describe('home launch surface', () => {
})
describe('assistant notebook creation', () => {
it('creates and runs a notebook resource when the Assistant proposal is approved', async () => {
it('creates a notebook resource when the Assistant proposal is approved', () => {
const { result } = customRenderHook(() => useExplorerPrototypeState())
const message = INITIAL_CHATS['chat-2'].messages.find((entry) => 'notebook' in entry)
if (!message || !('notebook' in message)) throw new Error('Expected an assistant notebook')
await act(async () =>
act(() =>
result.current.createNotebookFromChat(
'chat-2',
message.id,
@@ -398,7 +398,7 @@ describe('agent chat surface', () => {
expect(screen.getByText('OAuth signups by provider')).toBeInTheDocument()
expect(screen.getAllByRole('button', { name: 'Hide SQL' })).toHaveLength(2)
expect(screen.getByText('The Assistant wants to create this notebook.')).toBeInTheDocument()
expect(screen.getByRole('button', { name: 'Create and run' })).toBeInTheDocument()
expect(screen.getByRole('button', { name: 'Create notebook' })).toBeInTheDocument()
})
it('runs the query once approved and reports the row count', async () => {
@@ -340,7 +340,7 @@ export const useExplorerPrototypeState = () => {
}
}
const createNotebookFromChat = async (
const createNotebookFromChat = (
chatId: string,
messageId: string,
title: string,
@@ -353,12 +353,6 @@ export const useExplorerPrototypeState = () => {
setChatApproval(chatId, messageId, 'approved')
markModified(resource)
openTab(resource, title)
for (const cell of notebook.cells) {
if (cell.type !== 'query') continue
if (isWriteQuery(cell.query.sql)) break
await runCell(cell, resolveEffectiveRowLimit(cell, notebook.settings))
}
}
return {
@@ -194,7 +194,7 @@ export const ChatView = ({
{isPending && (
<AssistantApprovalBar
prompt="The Assistant wants to create this notebook."
confirmLabel="Create and run"
confirmLabel="Create notebook"
onDeny={() => onDeny(message.id)}
onConfirm={() =>
onApproveNotebook(