Skip to content

fix(tabs): dont ask user in reload prompt if data in tabs is not lost#3784

Closed
astandrik wants to merge 3 commits intomainfrom
astandrik.3770
Closed

fix(tabs): dont ask user in reload prompt if data in tabs is not lost#3784
astandrik wants to merge 3 commits intomainfrom
astandrik.3770

Conversation

@astandrik
Copy link
Copy Markdown
Collaborator

@astandrik astandrik commented Apr 9, 2026

Stand

Closes #3770

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
608 601 0 4 3
Test Changes Summary ✨3 🗑️2

✨ New Tests (3)

  1. Reload does not show beforeunload when only a non-active tab is dirty (tenant/queryEditor/queryPageLeave.test.ts)
  2. Page close with runBeforeUnload does not show beforeunload for dirty tabs only (tenant/queryEditor/queryPageLeave.test.ts)
  3. Page close with runBeforeUnload closes page after accept for running query (tenant/queryEditor/queryPageLeave.test.ts)

🗑️ Deleted Tests (2)

  1. Reload shows beforeunload when a non-active tab is dirty (tenant/queryEditor/queryPageLeave.test.ts)
  2. Page close with runBeforeUnload closes page after accept (tenant/queryEditor/queryPageLeave.test.ts)

Bundle Size: ✅

Current: 63.39 MB | Main: 63.39 MB
Diff: 0.03 KB (-0.00%)

✅ Bundle size unchanged.

ℹ️ 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 9, 2026 12:42
@astandrik
Copy link
Copy Markdown
Collaborator Author

@codex review
@greptile review

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: f195f88f3b

ℹ️ 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".

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

Updates Query Editor page-leave guarding so the native beforeunload prompt is shown only when there are running queries (not merely “dirty” tabs), aligning with the goal of avoiding unnecessary reload/close confirmation when tab contents are preserved.

Changes:

  • Adjusted getQueryPageLeaveState to prompt only when at least one tab has a running query.
  • Updated unit tests to reflect the new prompt behavior for dirty tabs without running queries.
  • Updated Playwright e2e coverage to assert no beforeunload dialog on reload/close when only dirty tabs are present, while keeping coverage for running-query prompts.

Reviewed changes

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

File Description
tests/suites/tenant/queryEditor/queryPageLeave.test.ts Updates e2e expectations around beforeunload dialogs for dirty-vs-running tab scenarios.
src/containers/Tenant/Query/QueryEditor/hooks/useQueryPageLeaveGuard.ts Changes prompt condition to depend only on running tabs.
src/containers/Tenant/Query/QueryEditor/hooks/__test__/useQueryPageLeaveGuard.test.ts Updates unit test expectation for dirty tabs when no running tabs exist.

@astandrik astandrik marked this pull request as ready for review April 9, 2026 12:58
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: f195f88f3b

ℹ️ 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".

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: 20e1f587e6

ℹ️ 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".

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: e08930a384

ℹ️ 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
Copy link
Copy Markdown
Collaborator Author

Will implement only after #3791

@astandrik astandrik closed this Apr 10, 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.

fix(tabs): dont ask user in reload prompt if data in tabs is not lost

3 participants