Skip to content

Commit 07642d7

Browse files
authored
Merge pull request #596 from TableProApp/fix/quick-win-moderate-issues
fix: semantic selected-text colors and proper full-screen CommandGroup
2 parents 8b220f1 + 47384bd commit 07642d7

File tree

5 files changed

+18
-34
lines changed

5 files changed

+18
-34
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
- Fix potential deadlock in SSH host key verification prompts (semaphore → async/await)
1919
- Fix data race in ConnectionStorage, GroupStorage, and TagStorage (added @MainActor isolation)
2020
- Add schema versioning to SQLite databases (query history, favorites) for future migrations
21+
- Use semantic selected-text color instead of hardcoded white in selected rows
22+
- Use proper CommandGroup for full-screen shortcut instead of event monitor
2123

2224
### Added
2325

TablePro/AppDelegate.swift

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -136,24 +136,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
136136
name: .databaseDidConnect, object: nil
137137
)
138138

139-
installFullscreenKeyMonitor()
140-
}
141-
142-
// MARK: - Fullscreen Shortcut
143-
144-
/// macOS maps Globe+F (fn+F) to ⌃⌘F, but SwiftUI lifecycle apps don't
145-
/// create a real NSMenuItem for "Enter Full Screen" — the shortcut shown
146-
/// in the View menu is a visual hint only, with no key equivalent binding.
147-
private var fullscreenKeyMonitor: Any?
148-
149-
private func installFullscreenKeyMonitor() {
150-
fullscreenKeyMonitor = NSEvent.addLocalMonitorForEvents(matching: .keyDown) { event in
151-
let mods = event.modifierFlags.intersection(.deviceIndependentFlagsMask)
152-
guard mods == [.control, .command],
153-
event.keyCode == KeyCode.f.rawValue else { return event }
154-
NSApp.keyWindow?.toggleFullScreen(nil)
155-
return nil
156-
}
157139
}
158140

159141
func applicationDidBecomeActive(_ notification: Notification) {

TablePro/Views/DatabaseSwitcher/DatabaseSwitcherSheet.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,27 +264,27 @@ struct DatabaseSwitcherSheet: View {
264264
Image(systemName: database.icon)
265265
.font(.system(size: 14))
266266
.foregroundStyle(
267-
isSelected ? .white : (database.isSystemDatabase ? Color(nsColor: .systemOrange) : Color(nsColor: .systemBlue)))
267+
isSelected ? Color(nsColor: .alternateSelectedControlTextColor) : (database.isSystemDatabase ? Color(nsColor: .systemOrange) : Color(nsColor: .systemBlue)))
268268

269269
// Name
270270
Text(database.name)
271271
.font(.system(size: 13))
272-
.foregroundStyle(isSelected ? .white : .primary)
272+
.foregroundStyle(isSelected ? Color(nsColor: .alternateSelectedControlTextColor) : .primary)
273273

274274
Spacer()
275275

276276
// Current badge
277277
if isCurrent {
278278
Text("current")
279279
.font(.system(size: 10, weight: .medium))
280-
.foregroundStyle(isSelected ? .white.opacity(0.7) : .secondary)
280+
.foregroundStyle(isSelected ? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.7) : .secondary)
281281
.padding(.horizontal, 6)
282282
.padding(.vertical, 2)
283283
.background(
284284
RoundedRectangle(cornerRadius: 4)
285285
.fill(
286286
isSelected
287-
? Color.white.opacity(0.15)
287+
? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.15)
288288
: Color(nsColor: .quaternaryLabelColor))
289289
)
290290
}

TablePro/Views/QuickSwitcher/QuickSwitcherView.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,31 +163,31 @@ internal struct QuickSwitcherSheet: View {
163163
return HStack(spacing: 10) {
164164
Image(systemName: item.iconName)
165165
.font(.system(size: ThemeEngine.shared.activeTheme.iconSizes.default))
166-
.foregroundStyle(isSelected ? .white : .secondary)
166+
.foregroundStyle(isSelected ? Color(nsColor: .alternateSelectedControlTextColor) : .secondary)
167167

168168
Text(item.name)
169169
.font(.system(size: ThemeEngine.shared.activeTheme.typography.body))
170-
.foregroundStyle(isSelected ? .white : .primary)
170+
.foregroundStyle(isSelected ? Color(nsColor: .alternateSelectedControlTextColor) : .primary)
171171
.lineLimit(1)
172172
.truncationMode(.tail)
173173

174174
if !item.subtitle.isEmpty {
175175
Text(item.subtitle)
176176
.font(.system(size: ThemeEngine.shared.activeTheme.typography.small))
177-
.foregroundStyle(isSelected ? Color.white.opacity(0.7) : Color.secondary)
177+
.foregroundStyle(isSelected ? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.7) : Color.secondary)
178178
.lineLimit(1)
179179
}
180180

181181
Spacer()
182182

183183
Text(item.kindLabel)
184184
.font(.system(size: ThemeEngine.shared.activeTheme.typography.caption, weight: .medium))
185-
.foregroundStyle(isSelected ? .white.opacity(0.7) : .secondary)
185+
.foregroundStyle(isSelected ? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.7) : .secondary)
186186
.padding(.horizontal, 6)
187187
.padding(.vertical, 2)
188188
.background(
189189
RoundedRectangle(cornerRadius: 4)
190-
.fill(isSelected ? Color.white.opacity(0.15) : Color(nsColor: .quaternaryLabelColor))
190+
.fill(isSelected ? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.15) : Color(nsColor: .quaternaryLabelColor))
191191
)
192192
}
193193
.padding(.vertical, 4)

TablePro/Views/Toolbar/ConnectionSwitcherPopover.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,19 +234,19 @@ struct ConnectionSwitcherPopover: View {
234234
HStack(spacing: 8) {
235235
// Color indicator
236236
Circle()
237-
.fill(isHighlighted ? Color.white : connection.displayColor)
237+
.fill(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor) : connection.displayColor)
238238
.frame(width: 8, height: 8)
239239

240240
// Connection info
241241
VStack(alignment: .leading, spacing: 1) {
242242
Text(connection.name)
243243
.font(.system(size: 13, weight: isActive ? .semibold : .regular))
244-
.foregroundStyle(isHighlighted ? .white : .primary)
244+
.foregroundStyle(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor) : .primary)
245245
.lineLimit(1)
246246

247247
Text(connectionSubtitle(connection))
248248
.font(.system(size: 11))
249-
.foregroundStyle(isHighlighted ? .white.opacity(0.7) : .secondary)
249+
.foregroundStyle(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.7) : .secondary)
250250
.lineLimit(1)
251251
}
252252

@@ -258,23 +258,23 @@ struct ConnectionSwitcherPopover: View {
258258
.controlSize(.small)
259259
} else if isActive {
260260
Image(systemName: "checkmark.circle.fill")
261-
.foregroundStyle(isHighlighted ? .white : Color(nsColor: .systemGreen))
261+
.foregroundStyle(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor) : Color(nsColor: .systemGreen))
262262
.font(.system(size: 14))
263263
} else if isConnected {
264264
Circle()
265-
.fill(isHighlighted ? Color.white : Color(nsColor: .systemGreen))
265+
.fill(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor) : Color(nsColor: .systemGreen))
266266
.frame(width: 6, height: 6)
267267
}
268268

269269
// Database type badge
270270
Text(connection.type.rawValue.uppercased())
271271
.font(.system(size: 9, weight: .medium, design: .monospaced))
272-
.foregroundStyle(isHighlighted ? .white : .secondary)
272+
.foregroundStyle(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor) : .secondary)
273273
.padding(.horizontal, 4)
274274
.padding(.vertical, 2)
275275
.background(
276276
RoundedRectangle(cornerRadius: 3)
277-
.fill(isHighlighted ? Color.white.opacity(0.2) : Color(nsColor: .separatorColor))
277+
.fill(isHighlighted ? Color(nsColor: .alternateSelectedControlTextColor).opacity(0.2) : Color(nsColor: .separatorColor))
278278
)
279279
}
280280
.padding(.vertical, 2)

0 commit comments

Comments
 (0)