From 4acbfb902badd3c94948fcf973eaab9f5c721924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ng=C3=B4=20Qu=E1=BB=91c=20=C4=90=E1=BA=A1t?= Date: Mon, 6 Apr 2026 13:12:22 +0700 Subject: [PATCH 1/4] fix: use alternateSelectedControlTextColor instead of hardcoded .white in selected rows --- .../DatabaseSwitcher/DatabaseSwitcherSheet.swift | 8 ++++---- .../Views/QuickSwitcher/QuickSwitcherView.swift | 10 +++++----- .../Views/Toolbar/ConnectionSwitcherPopover.swift | 14 +++++++------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/TablePro/Views/DatabaseSwitcher/DatabaseSwitcherSheet.swift b/TablePro/Views/DatabaseSwitcher/DatabaseSwitcherSheet.swift index f78e10af9..91366f5c8 100644 --- a/TablePro/Views/DatabaseSwitcher/DatabaseSwitcherSheet.swift +++ b/TablePro/Views/DatabaseSwitcher/DatabaseSwitcherSheet.swift @@ -264,12 +264,12 @@ struct DatabaseSwitcherSheet: View { Image(systemName: database.icon) .font(.system(size: 14)) .foregroundStyle( - isSelected ? .white : (database.isSystemDatabase ? Color(nsColor: .systemOrange) : Color(nsColor: .systemBlue))) + isSelected ? Color(nsColor: .alternateSelectedControlTextColor) : (database.isSystemDatabase ? Color(nsColor: .systemOrange) : Color(nsColor: .systemBlue))) // Name Text(database.name) .font(.system(size: 13)) - .foregroundStyle(isSelected ? .white : .primary) + .foregroundStyle(isSelected ? Color(nsColor: .alternateSelectedControlTextColor) : .primary) Spacer() @@ -277,14 +277,14 @@ struct DatabaseSwitcherSheet: View { if isCurrent { Text("current") .font(.system(size: 10, weight: .medium)) - .foregroundStyle(isSelected ? .white.opacity(0.7) : .secondary) + .foregroundStyle(isSelected ? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.7) : .secondary) .padding(.horizontal, 6) .padding(.vertical, 2) .background( RoundedRectangle(cornerRadius: 4) .fill( isSelected - ? Color.white.opacity(0.15) + ? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.15) : Color(nsColor: .quaternaryLabelColor)) ) } diff --git a/TablePro/Views/QuickSwitcher/QuickSwitcherView.swift b/TablePro/Views/QuickSwitcher/QuickSwitcherView.swift index 8ed23b6f4..8b7a52429 100644 --- a/TablePro/Views/QuickSwitcher/QuickSwitcherView.swift +++ b/TablePro/Views/QuickSwitcher/QuickSwitcherView.swift @@ -163,18 +163,18 @@ internal struct QuickSwitcherSheet: View { return HStack(spacing: 10) { Image(systemName: item.iconName) .font(.system(size: ThemeEngine.shared.activeTheme.iconSizes.default)) - .foregroundStyle(isSelected ? .white : .secondary) + .foregroundStyle(isSelected ? Color(nsColor: .alternateSelectedControlTextColor) : .secondary) Text(item.name) .font(.system(size: ThemeEngine.shared.activeTheme.typography.body)) - .foregroundStyle(isSelected ? .white : .primary) + .foregroundStyle(isSelected ? Color(nsColor: .alternateSelectedControlTextColor) : .primary) .lineLimit(1) .truncationMode(.tail) if !item.subtitle.isEmpty { Text(item.subtitle) .font(.system(size: ThemeEngine.shared.activeTheme.typography.small)) - .foregroundStyle(isSelected ? Color.white.opacity(0.7) : Color.secondary) + .foregroundStyle(isSelected ? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.7) : Color.secondary) .lineLimit(1) } @@ -182,12 +182,12 @@ internal struct QuickSwitcherSheet: View { Text(item.kindLabel) .font(.system(size: ThemeEngine.shared.activeTheme.typography.caption, weight: .medium)) - .foregroundStyle(isSelected ? .white.opacity(0.7) : .secondary) + .foregroundStyle(isSelected ? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.7) : .secondary) .padding(.horizontal, 6) .padding(.vertical, 2) .background( RoundedRectangle(cornerRadius: 4) - .fill(isSelected ? Color.white.opacity(0.15) : Color(nsColor: .quaternaryLabelColor)) + .fill(isSelected ? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.15) : Color(nsColor: .quaternaryLabelColor)) ) } .padding(.vertical, 4) diff --git a/TablePro/Views/Toolbar/ConnectionSwitcherPopover.swift b/TablePro/Views/Toolbar/ConnectionSwitcherPopover.swift index e7f2438d8..27e634c41 100644 --- a/TablePro/Views/Toolbar/ConnectionSwitcherPopover.swift +++ b/TablePro/Views/Toolbar/ConnectionSwitcherPopover.swift @@ -234,19 +234,19 @@ struct ConnectionSwitcherPopover: View { HStack(spacing: 8) { // Color indicator Circle() - .fill(isHighlighted ? Color.white : connection.displayColor) + .fill(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor) : connection.displayColor) .frame(width: 8, height: 8) // Connection info VStack(alignment: .leading, spacing: 1) { Text(connection.name) .font(.system(size: 13, weight: isActive ? .semibold : .regular)) - .foregroundStyle(isHighlighted ? .white : .primary) + .foregroundStyle(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor) : .primary) .lineLimit(1) Text(connectionSubtitle(connection)) .font(.system(size: 11)) - .foregroundStyle(isHighlighted ? .white.opacity(0.7) : .secondary) + .foregroundStyle(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.7) : .secondary) .lineLimit(1) } @@ -258,23 +258,23 @@ struct ConnectionSwitcherPopover: View { .controlSize(.small) } else if isActive { Image(systemName: "checkmark.circle.fill") - .foregroundStyle(isHighlighted ? .white : Color(nsColor: .systemGreen)) + .foregroundStyle(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor) : Color(nsColor: .systemGreen)) .font(.system(size: 14)) } else if isConnected { Circle() - .fill(isHighlighted ? Color.white : Color(nsColor: .systemGreen)) + .fill(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor) : Color(nsColor: .systemGreen)) .frame(width: 6, height: 6) } // Database type badge Text(connection.type.rawValue.uppercased()) .font(.system(size: 9, weight: .medium, design: .monospaced)) - .foregroundStyle(isHighlighted ? .white : .secondary) + .foregroundStyle(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor) : .secondary) .padding(.horizontal, 4) .padding(.vertical, 2) .background( RoundedRectangle(cornerRadius: 3) - .fill(isHighlighted ? Color.white.opacity(0.2) : Color(nsColor: .separatorColor)) + .fill(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.2) : Color(nsColor: .separatorColor)) ) } .padding(.vertical, 2) From 435751e74afbb8e312150de87054807d9264b8f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ng=C3=B4=20Qu=E1=BB=91c=20=C4=90=E1=BA=A1t?= Date: Mon, 6 Apr 2026 13:12:27 +0700 Subject: [PATCH 2/4] fix: replace full-screen event monitor with proper CommandGroup --- TablePro/AppDelegate.swift | 18 ------------------ TablePro/TableProApp.swift | 9 +++++++++ 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/TablePro/AppDelegate.swift b/TablePro/AppDelegate.swift index a23bdc532..db256904d 100644 --- a/TablePro/AppDelegate.swift +++ b/TablePro/AppDelegate.swift @@ -136,24 +136,6 @@ class AppDelegate: NSObject, NSApplicationDelegate { name: .databaseDidConnect, object: nil ) - installFullscreenKeyMonitor() - } - - // MARK: - Fullscreen Shortcut - - /// macOS maps Globe+F (fn+F) to ⌃⌘F, but SwiftUI lifecycle apps don't - /// create a real NSMenuItem for "Enter Full Screen" — the shortcut shown - /// in the View menu is a visual hint only, with no key equivalent binding. - private var fullscreenKeyMonitor: Any? - - private func installFullscreenKeyMonitor() { - fullscreenKeyMonitor = NSEvent.addLocalMonitorForEvents(matching: .keyDown) { event in - let mods = event.modifierFlags.intersection(.deviceIndependentFlagsMask) - guard mods == [.control, .command], - event.keyCode == KeyCode.f.rawValue else { return event } - NSApp.keyWindow?.toggleFullScreen(nil) - return nil - } } func applicationDidBecomeActive(_ notification: Notification) { diff --git a/TablePro/TableProApp.swift b/TablePro/TableProApp.swift index 90c9e40d6..7b6d47733 100644 --- a/TablePro/TableProApp.swift +++ b/TablePro/TableProApp.swift @@ -407,6 +407,15 @@ struct AppMenuCommands: Commands { .keyboardShortcut("-", modifiers: .command) } + CommandGroup(after: .toolbar) { + Button { + NSApp.keyWindow?.toggleFullScreen(nil) + } label: { + Text("Enter Full Screen") + } + .keyboardShortcut("f", modifiers: [.control, .command]) + } + // Tab navigation shortcuts — native macOS window tabs CommandGroup(after: .windowArrangement) { // Tab switching by number (Cmd+1 through Cmd+9) From dd1e839bbe785bba5742fc52d7d64558f2628cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ng=C3=B4=20Qu=E1=BB=91c=20=C4=90=E1=BA=A1t?= Date: Mon, 6 Apr 2026 13:12:33 +0700 Subject: [PATCH 3/4] docs: update CHANGELOG for quick-win moderate fixes --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38601ee00..46b03738f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix potential deadlock in SSH host key verification prompts (semaphore → async/await) - Fix data race in ConnectionStorage, GroupStorage, and TagStorage (added @MainActor isolation) - Add schema versioning to SQLite databases (query history, favorites) for future migrations +- Use semantic selected-text color instead of hardcoded white in selected rows +- Use proper CommandGroup for full-screen shortcut instead of event monitor ### Added From 47384bdbfe13d97831c8809c53451b9d2ba7466a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ng=C3=B4=20Qu=E1=BB=91c=20=C4=90=E1=BA=A1t?= Date: Mon, 6 Apr 2026 13:16:06 +0700 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20remove=20duplicate=20full-screen=20m?= =?UTF-8?q?enu=20item=20=E2=80=94=20system=20already=20provides=20one?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TablePro/TableProApp.swift | 9 --------- 1 file changed, 9 deletions(-) diff --git a/TablePro/TableProApp.swift b/TablePro/TableProApp.swift index 7b6d47733..90c9e40d6 100644 --- a/TablePro/TableProApp.swift +++ b/TablePro/TableProApp.swift @@ -407,15 +407,6 @@ struct AppMenuCommands: Commands { .keyboardShortcut("-", modifiers: .command) } - CommandGroup(after: .toolbar) { - Button { - NSApp.keyWindow?.toggleFullScreen(nil) - } label: { - Text("Enter Full Screen") - } - .keyboardShortcut("f", modifiers: [.control, .command]) - } - // Tab navigation shortcuts — native macOS window tabs CommandGroup(after: .windowArrangement) { // Tab switching by number (Cmd+1 through Cmd+9)