Skip to content

fix: preview tab double-click detection and promotion#844

Open
datlechin wants to merge 1 commit intomainfrom
fix/preview-tab-double-click
Open

fix: preview tab double-click detection and promotion#844
datlechin wants to merge 1 commit intomainfrom
fix/preview-tab-double-click

Conversation

@datlechin
Copy link
Copy Markdown
Collaborator

Summary

  • Fix DoubleClickDetector bounds check: walk up to NSTableRowView instead of checking tiny overlay text bounds
  • Add asPreview parameter to openTableTab so double-click can force non-preview mode
  • Double-click now correctly promotes existing preview or opens permanent tab

Root Cause

The SharedDoubleClickMonitor detected clickCount == 2 events correctly, but the bounds check failed because the SidebarDoubleClickView overlay was sized to the text label width (67-156px), not the full row width. Clicks in the right portion of the row fell outside the overlay bounds.

Changes

DoubleClickDetector.swift: Walk up the view hierarchy to the nearest NSTableRowView and check bounds against the full row, not the overlay.

MainContentCoordinator+Navigation.swift: Added asPreview: Bool? = nil parameter. nil = use setting (default), false = force permanent (double-click).

MainSplitViewController.swift: Double-click handler passes asPreview: false.

Test plan

  • Single-click table: opens as preview (subtitle shows "Preview")
  • Single-click another table: replaces preview (still 1 tab)
  • Double-click table: promotes preview to permanent (subtitle drops "Preview")
  • Double-click different table from permanent: opens new permanent tab
  • Edit/sort/filter in preview: auto-promotes to permanent
  • Query tabs are never preview
  • Preview tabs not persisted on close
  • "Enable preview tabs" OFF: all clicks open permanent tabs

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.

1 participant