mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
## What The Explorer results area showed its idle and no-rows states as a small line in the top-left corner, which was easy to miss, and showed nothing while a query ran. These states now sit in the center of the results area, with an icon above the label: - **Before a run:** "Run the query to see results" - **While running:** "Running query…" (new). When a re-run has previous rows, they stay on screen, dimmed, under the running state, so notebook cells don't collapse and grow back. - **No rows:** "Success. No rows returned" Assistant query cells also show the running state after you approve a query, since that run happens outside the editor. ## Testing Enable the `explorer` flag and open Explorer. 1. Open a new query tab and check that "Run the query to see results" is centered. 2. Run `select pg_sleep(2)`. "Running query…" shows while it runs, then the result appears. 3. Run `select 1 where false` and check that "Success. No rows returned" is centered. 4. Run `select * from pg_tables`, then re-run it. The rows stay visible, dimmed, under the running state. 5. In a notebook with several cells, click **Run notebook**. Cells keep their height while they run. 6. Ask the Assistant to run a query and approve it. The cell shows "Running query…" until the result arrives. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
19 lines
770 B
TypeScript
19 lines
770 B
TypeScript
import { screen } from '@testing-library/react'
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
import { QueryResultRenderer } from './QueryResultRenderer'
|
|
import { customRender } from '@/tests/lib/custom-render'
|
|
|
|
describe('QueryResultRenderer while a query runs', () => {
|
|
// Notebook cells size to their results; unmounting the rows on every re-run would make
|
|
// each cell collapse and grow back during "Run notebook".
|
|
it('keeps previous rows on screen under the running state', () => {
|
|
customRender(
|
|
<QueryResultRenderer isExecuting view="table" result={{ rows: [{ previous_column: 1 }] }} />
|
|
)
|
|
|
|
expect(screen.getByRole('status')).toHaveTextContent('Running query…')
|
|
expect(screen.getByText('previous_column')).toBeInTheDocument()
|
|
})
|
|
})
|