Skip to content

feat(sql-editor): improve result history controls - #2344

Merged
openai0229 merged 1 commit into
mainfrom
feat/2343-result-history-controls
Jul 28, 2026
Merged

feat(sql-editor): improve result history controls#2344
openai0229 merged 1 commit into
mainfrom
feat/2343-result-history-controls

Conversation

@openai0229

Copy link
Copy Markdown
Contributor

Related issue

Closes #2343

Summary

Separate SQL Output retention from result-tab retention and keep retained execution results in one flat tab strip. Add persisted result ordering and Keep existing results settings, stable execution-batch identity, replacement barriers for late Web/Desktop events, and uniform 200 px result tabs with the standard table icon.

Harden the execution lifecycle so each editor owns at most one pending or running request, busy submissions reject explicitly, pre-ID Desktop cancellation is reconciled, and synchronous bridge failures cannot leave the editor permanently busy. Centralize result-tab close-shortcut ownership so one Cmd/Ctrl+W action closes at most one visible result.

Affected surfaces

  • Frontend / Web
  • Backend / API / Storage
  • Database plugin / Driver
  • JCEF / Desktop packaging
  • CI / Build / Release
  • Documentation only

Verification

  • Commands and results:
    • yarn lint - passed ESLint and Stylelint with zero warnings.
    • yarn test:result-tab-preferences - passed result preference and close-shortcut ownership contracts.
    • yarn test:execution-console - passed.
    • yarn test:sql-execution-log - passed.
    • yarn test:sql-execution-batch - passed.
    • yarn test:sql-execution-request-tracker - passed.
    • yarn test:sql-execution-stream - passed.
    • yarn test:result-inspector - passed result inspector and tab-selection contracts.
    • yarn tsx src/blocks/SearchResult/components/SQLPreviewExecute/updateSql.test.ts - passed.
    • yarn test:i18n - passed.
    • yarn build:web:community --app_version=5.3.0 - passed Community production build.
    • git diff --check - passed.
  • Manual verification: Maintainer iteratively reviewed result-tab layout, table icons, hover treatment, settings placement, ordering, and retention transitions in the local Community UI during implementation.
  • UI evidence: N/A - no standalone screenshot artifact is attached to this PR.

Risk and compatibility

  • Public API or stored data: No public API changes. Adds versioned local preference keys for result ordering and retention; missing or invalid values fall back to existing defaults.
  • Database or driver compatibility: N/A - no SQL dialect, driver, or backend execution changes.
  • Network, privacy, or security: No new network requests or data collection. Desktop cancellation continues to use the existing JCEF bridge.
  • Community / Local / Pro boundary: Community frontend only; no Enterprise source is changed.
  • Backward compatibility: Existing Output preference keys remain unchanged. Result history defaults to enabled, current results are not relabeled on preference-only changes, and no data migration is required.

Reviewer map

  • Start here: chat2db-community-client/src/pages/main/workspace/components/SQLExecute/index.tsx, then src/service/sqlExecutionBatch.ts, src/blocks/SearchResult/index.tsx, and src/hooks/useSqlExecutor.ts.
  • Failure condition: Output and result retention affect each other, statement order changes inside a batch, late events recreate replaced/closed results, a second execution is accepted while busy, cancellation leaves the editor stuck, or one close shortcut closes multiple result tabs.
  • Rollback or disable path: Revert commit 90a883d0; the change has no server schema or stored-data migration.

Contributor declaration

  • I linked the Issue that defines this change.
  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below, or this PR contains no substantial AI-generated code.

AI assistance: Substantial AI assistance was used for implementation, regression-test design, and final code review. The maintainer directed the product behavior and reviewed the UI throughout the implementation.

@openai0229 openai0229 moved this to In Review in Chat2DB Community Jul 28, 2026
@openai0229
openai0229 merged commit cb0394e into main Jul 28, 2026
14 of 15 checks passed
@openai0229
openai0229 deleted the feat/2343-result-history-controls branch July 28, 2026 11:29
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Improve SQL execution result history controls

2 participants