Skip to content

feat: implement empty state view when the last empty tab is closed#3795

Closed
astandrik wants to merge 4 commits intomainfrom
astandrik.3767
Closed

feat: implement empty state view when the last empty tab is closed#3795
astandrik wants to merge 4 commits intomainfrom
astandrik.3767

Conversation

@astandrik
Copy link
Copy Markdown
Collaborator

@astandrik astandrik commented Apr 11, 2026

Closes #3767

CI Results

Test Status: ❌ FAILED

📊 Full Report

Total Passed Failed Flaky Skipped
626 617 4 2 3
Test Changes Summary ✨10 🗑️1

✨ New Tests (10)

  1. Close tab action on the last clean tab shows zero-tabs state (tenant/queryEditor/editorTabs.test.ts)
  2. Clicking zero-tabs state creates a new editor tab (tenant/queryEditor/editorTabs.test.ts)
  3. Hotkey creates a new tab from zero-tabs state (tenant/queryEditor/editorTabs.test.ts)
  4. Reload restores zero-tabs state (tenant/queryEditor/editorTabs.test.ts)
  5. Zero-tabs state matches the default view (tenant/queryEditor/editorTabs.test.ts)
  6. Zero-tabs state matches the hover view (tenant/queryEditor/editorTabs.test.ts)
  7. Closing the last dirty tab can end in zero-tabs state (tenant/queryEditor/editorTabs.test.ts)
  8. Closing the last running tab can end in zero-tabs state (tenant/queryEditor/editorTabs.test.ts)
  9. Close all tabs shows zero-tabs state after dont save confirmation (tenant/queryEditor/editorTabs.test.ts)
  10. Single-tab mode recreates the editor after restoring zero-tabs state (tenant/queryEditor/queryEditorModes.test.ts)

🗑️ Deleted Tests (1)

  1. Close all tabs leaves a single cleared tab after dont save confirmation (tenant/queryEditor/editorTabs.test.ts)

Bundle Size: 🔺

Current: 63.41 MB | Main: 63.40 MB
Diff: +7.38 KB (0.01%)

⚠️ Bundle size increased. Please review.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

@astandrik astandrik requested a review from Copilot April 11, 2026 16:56
@astandrik
Copy link
Copy Markdown
Collaborator Author

@codex review
@greptile review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements a “zero tabs” state for the SQL Query Editor so that closing the last tab results in a dedicated empty-state view instead of leaving the user in an undefined UI state (per #3767).

Changes:

  • Updated query tabs reducer/persistence to allow activeTabId to be undefined and represent a true “zero tabs” state.
  • Added a new Query Editor empty-state component and switched QueryEditor rendering to show it when there are no tabs.
  • Expanded unit/E2E coverage (including visual snapshots) and adjusted hotkey/test helpers for the new behavior.

Reviewed changes

Copilot reviewed 17 out of 22 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/utils/queryHotkeys.ts Updates hotkey press helpers (codes/values, platform detection, WebKit rename workaround).
tests/suites/tenant/queryEditor/queryEditorModes.test.ts Adds E2E coverage for restoring from zero-tabs to single-tab mode.
tests/suites/tenant/queryEditor/models/QueryEditor.ts Adds page-model locators/helpers for zero-tabs state and improves active-tab id handling.
tests/suites/tenant/queryEditor/editorTabs.test.ts Adds E2E + screenshot tests for zero-tabs behavior; adjusts several tab-related assertions.
tests/suites/tenant/queryEditor/editorTabs.test.ts-snapshots/query-editor-zero-tabs-state-safari-linux.png New visual snapshot for Safari/Linux empty state.
tests/suites/tenant/queryEditor/editorTabs.test.ts-snapshots/query-editor-zero-tabs-state-hover-safari-linux.png New visual snapshot for Safari/Linux hover state.
tests/suites/tenant/queryEditor/editorTabs.test.ts-snapshots/query-editor-zero-tabs-state-chromium-linux.png New visual snapshot for Chromium/Linux empty state.
tests/suites/tenant/queryEditor/editorTabs.test.ts-snapshots/query-editor-zero-tabs-state-hover-chromium-linux.png New visual snapshot for Chromium/Linux hover state.
src/uiFactory/uiFactory.ts Flips default enableMultiTabQueryEditor to true.
src/types/assets.d.ts Adds TS module declarations for *.scss and *.css imports.
src/store/reducers/query/utils.ts Makes persisted activeTabId optional and updates validator accordingly.
src/store/reducers/query/types.ts Makes reducer activeTabId optional to allow zero-tabs state.
src/store/reducers/query/slice.ts Implements zero-tabs initialization + last-tab close behavior; updates selectors to tolerate missing active tab.
src/store/reducers/query/test/zeroTabsState.test.ts Adds unit tests for zero-tabs state and persistence.
src/store/reducers/query/test/SessionStorageMigration.test.ts Updates migration tests for optional activeTabId.
src/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.tsx Guards stop/abort logic when no active tab exists.
src/containers/Tenant/Query/QueryEditor/YqlEditor/YqlEditor.tsx Adds activeTabId guards in effects and actions to support zero-tabs state.
src/containers/Tenant/Query/QueryEditor/QueryEditorZeroTabsState.tsx New empty-state UI component shown when there are no open tabs.
src/containers/Tenant/Query/QueryEditor/QueryEditorZeroTabsState.scss Styles for the new empty-state component.
src/containers/Tenant/Query/QueryEditor/QueryEditor.tsx Renders empty state when no tabs; adds safeguards around actions requiring an active tab.
src/containers/Tenant/Query/QueryEditor/hooks/useQueryTabsActions.tsx Makes close/duplicate/close-other handlers tolerate undefined tab ids.
src/containers/Tenant/Query/i18n/en.json Adds i18n string for empty-state “Create new query”.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 30ebd8a391

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@astandrik astandrik changed the title feat: implement empty state view when the last empty tab is closed feat: implement empty state view when the last empty tab is closed Apr 12, 2026
@astandrik
Copy link
Copy Markdown
Collaborator Author

@codex review
@greptile review

@chatgpt-codex-connector
Copy link
Copy Markdown

Summary

Testing

  • npm test -- src/store/reducers/query/__test__/zeroTabsState.test.ts src/store/reducers/query/__test__/SessionStorageMigration.test.ts
  • npx eslint src/store/reducers/query/slice.ts src/store/reducers/query/__test__/zeroTabsState.test.ts src/containers/Tenant/Query/QueryEditor/QueryEditor.tsx

Also completed workflow requirements:

  • Committed on the current branch with message: fix: initialize single-tab mode from zero-tabs persistence.
  • Created a follow-up PR via make_pr with title: fix: avoid zero-tabs flash in single-tab mode initialization.

View task →

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 21 changed files in this pull request and generated 1 comment.

@astandrik astandrik closed this Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SQL Editor] Implement empty state view when the last empty tab is closed

2 participants