feat: implement empty state view when the last empty tab is closed#3795
feat: implement empty state view when the last empty tab is closed#3795
Conversation
|
@codex review |
There was a problem hiding this comment.
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
activeTabIdto beundefinedand represent a true “zero tabs” state. - Added a new Query Editor empty-state component and switched
QueryEditorrendering 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”. |
src/containers/Tenant/Query/QueryEditor/QueryEditorZeroTabsState.tsx
Outdated
Show resolved
Hide resolved
src/containers/Tenant/Query/QueryEditor/QueryEditorZeroTabsState.scss
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
💡 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".
|
@codex review |
Summary
Testing
Also completed workflow requirements:
|
Closes #3767
CI Results
Test Status: ❌ FAILED
📊 Full Report
Test Changes Summary ✨10 🗑️1
✨ New Tests (10)
🗑️ Deleted Tests (1)
Bundle Size: 🔺
Current: 63.41 MB | Main: 63.40 MB
Diff: +7.38 KB (0.01%)
ℹ️ CI Information