Skip to content

First Run on a restored query tab with parameters only opens the panel #4419

Done

Description

@datlechin

What happened?

A query tab's parameter values come back after a relaunch, but the panel's open state does not. The first Cmd+Return on a restored tab with :name parameters opens the Parameters panel and runs nothing, though every value is already filled in. The second press runs.

Steps to reproduce

  1. On a SQL connection, write SELECT * FROM t WHERE id > :min in a query tab.
  2. Press Cmd+Return, type 0 for :min, press Cmd+Return again. The query runs.
  3. Quit and relaunch TablePro. The tab is restored with the panel closed.
  4. Press Cmd+Return. The panel opens with 0 filled in and nothing runs.

Expected behavior

The restored tab runs on the first press with its saved values, as it did before the relaunch. Restoring the panel as shown would do it.

Code path

  • PersistedTab keeps queryParameters but not isParameterPanelVisible (apple/TablePro/Models/Query/QueryTab.swift:362).
  • The restore builds TabQueryContent from the values only, so the flag starts false (QueryTab.swift:185-190, apple/TablePro/Models/Query/QueryTabState.swift:615).
  • executeResolvedSQL sets the flag and returns without running while it is false (apple/TablePro/Views/Main/MainContentCoordinator.swift:1064-1067).
  • QueryParameterDetectionTests "A SQL :name still opens the parameter panel before anything runs" covers a fresh tab and should keep passing.

Database type

N/A (any SQL connection; seen on PostgreSQL)

TablePro version

main (f67b55a)

Platform

macOS

Found during the 2026-11-22 perf audit: the throughput harness pressed Run once on a restored parameterized tab and the read never started.

Activity

  1. added
    bug
    platform-macos
    on Nov 23, 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

    bugplatform-macos

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions