Skip to content

Fix: always prompt when closing a single SQL tab with unsaved content…#4141

Open
Negi2110 wants to merge 1 commit into
sqlitebrowser:masterfrom
Negi2110:fix/prompt-on-tab-close-in-project
Open

Fix: always prompt when closing a single SQL tab with unsaved content…#4141
Negi2110 wants to merge 1 commit into
sqlitebrowser:masterfrom
Negi2110:fix/prompt-on-tab-close-in-project

Conversation

@Negi2110
Copy link
Copy Markdown

Fixes #4128

Problem

When closing an individual SQL tab that belongs to a saved project,
the save prompt was gated behind the promptsqltabsinnewproject
preference setting. If a user had that setting disabled, closing a
single tab would silently discard its content with no warning.

The root cause: askSaveSqlTab() was called the same way whether
closing the entire app (bulk path via closeFiles()) or closing a
single tab (via closeSqlTab()). The preference makes sense for
the bulk path but not for a deliberate single-tab close.

Fix

Added a singleTabClose parameter (default false) to
askSaveSqlTab(). When closeSqlTab() calls it, it passes true,
bypassing the preference check and always prompting if the tab
has unsaved content. The closeFiles() bulk path is unchanged.

How to test

  1. Open a database → Execute SQL tab → type any query
  2. File → Save Project → save as test.sqbpro
  3. Type new content in the SQL tab
  4. Click ✕ to close the tab
  5. ✅ "Do you want to save?" prompt appears
  6. Repeat but close the entire app after saving → ✅ no prompt

…sqlitebrowser#4128)

When closing an individual SQL tab that belongs to a project, the save
prompt was gated behind the 'promptsqltabsinnewproject' preference.
This meant users with that setting disabled could accidentally close
tabs and lose work silently.

Fix: pass singleTabClose=true from closeSqlTab() to askSaveSqlTab(),
bypassing the preference check for individual tab closes. The preference
still applies when closing the whole app/project (closeFiles path).
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.

[Bug]: UI/UX - Show "Save?" prompt for tabs in an unmodified project

1 participant