Skip to content

fix: opening a favorite marks the tab unsaved #909

Closed

Description

@EVWorth

After #908 a tab counts as dirty only while its content differs from savedContent (#855). openFavorite in src/components/favorites/QueryFavorites.tsx calls updateTabContent(fav.sql) but never sets that baseline. So a freshly opened favorite shows the dirty dot, and closing the tab asks about unsaved work that is already saved.

Reproduce

  1. Open ?mock=connected and save a query as a favorite.
  2. Open the favorite from the Favorites panel.
  3. The tab shows the unsaved dot.

Fix

Call useEditorStore.getState().markTabSaved(tabId, fav.sql) after updateTabContent. Add a test in QueryFavorites.test.tsx.

Activity

  1. added
    bug
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions