fix(#198): commit-on-success streaming for the detached Data view#204
Merged
BorisTyshkevich merged 1 commit intoJul 13, 2026
Merged
Conversation
Changing a filter or clicking Refresh in the detached Data view repainted the in-flight result on every network chunk. That flashed "Query returned 0 rows." whenever a chunk carried column metadata before any data rows, and it destroyed + recreated the Panel's Chart.js instance per chunk. Follow the same commit-on-success policy as dashboard tiles: onChunk now updates a lightweight `Running… <n> rows read` status only — it never paints the in-flight result and never touches current/stat/view/chart. The previously committed Table/JSON/Panel (and its chart) stays on screen untouched; the new result is committed and repainted exactly once after a successful current-generation completion. Failure, cancellation, supersession, and close all keep the previous committed result — and because the in-flight result is never painted, the old failure-time restore repaint (`paint(current)`) is removed. Winning bound params are still recorded once; the committed toolbar row count no longer changes mid-stream. Adds tests for previous-result retention (incl. the metadata-only chunk), commit-once Copy/recents targeting, no per-chunk chart churn, current-gen cancellation, and stale-chunk status suppression. Dashboard and workbench streaming behavior are unchanged; no new runtime dependency. Closes #198 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BVnHwXECf4dYtfLWy4wHcA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Fixes #198. In the detached Data view, changing a filter or clicking Refresh reran the captured query through the shared streaming seam and repainted the in-flight result on every network chunk. Two visible problems:
columns.length > 0,rows.length === 0), so the shared renderer momentarily showedQuery returned 0 rows.even though rows arrived on the next chunk.This adopts the same commit-on-success UI policy already used for dashboard tiles (#193).
Change (
src/ui/results.js)onChunkis now progress-only:Running… <n> rows read(elseRunning…). It never callspaint()and never touchescurrent/statEl/view/sort/widths/panelState/chartInstance.Running…and disables Refresh.runReadInto()(current generation only):cancelled → settle(''),error → settle(err), else commitcurrent = result, record bound params once,settle(''),paint()— exactly one repaint.paint(current)restore: the in-flight result is never painted, so the committed result is already on screen on every non-success path.Everything else (parameter analysis, prepared batch, token preflight, captured session, generation guard, AbortController, success-only recent recording) is unchanged. No generic "refreshable surface" abstraction introduced — detached and dashboard presentation semantics stay distinct, per the issue.
Tests (
tests/unit/results.test.js)New coverage via a controllable
runReadIntoseam: previous-result retention through a metadata-only chunk + a data chunk (no0 rowsflash, committed count unchanged, status text), commit-once Copy/recents targeting (old before, new after), no per-chunk chart churn (old chart destroyed once + one replacement on success), current-generation cancellation, and stale-chunk status suppression.Verification
npm test— 2353 passed;src/ui/results.jsholds the gate (br 95.04 / fn 97.26 / lines 100).npm run buildclean.0 rows/ churns the chart).Checklist
src/ui/results.js[Unreleased]updatedCloses #198
🤖 Generated with Claude Code