Skip to content

Commit a07ca29

Browse files
authored
chore: remove xlsx export pro gate (#1051)
1 parent 8dbf970 commit a07ca29

5 files changed

Lines changed: 4 additions & 81 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4040
### Changed
4141

4242
- Toolbar connection identity now leads with the database engine icon tinted with the connection's color, followed by the connection name, so multiple windows targeting the same database (e.g. `prod-safe`, `prod-unsafe`, `staging`, `local` against the same Postgres) are distinguishable at a glance instead of all reading "PostgreSQL 16.x". The pattern matches Calendar.app and Reminders.app, where a single icon carries both the type (shape) and the user-chosen identity (color). When no custom Connection Color is set, the icon falls back to the database type's brand color via the existing `displayColor` resolver, so the brand identity is preserved by default. The icon scales with Dynamic Type via `@ScaledMetric`. The verbose "PostgreSQL 16.1" text moves to the hover tooltip and the VoiceOver label, which reads "Connection: prod-safe, PostgreSQL 16.1". Both the connection-name and database-name `Text` labels now use `.fixedSize(horizontal: true, vertical: false)` so SwiftUI no longer compresses them inside the `NSHostingController` principal item. Previously a long database name would render truncated as `sep...` even in a 1900pt-wide window because SwiftUI compressed flexible text before NSToolbar got a chance to evaluate intrinsic width. Fixes #1044.
43+
- XLSX export is now free for everyone. Removed the Pro gate from the Export dialog: the `(Pro)` suffix in the format Picker, the orange "XLSX export requires a Pro license." caption, the `Activate License...` link, and the `isExportDisabled` short-circuit on unlicensed Macs are gone. The supporting machinery (`proFormatIds` set, `isProGatedFormat(_:)` predicate, `showActivationSheet` `@State` and its `.sheet` modifier in `ExportDialog`, the `xlsxExport` case in `ProFeature` plus its three switch arms, and the docs Note in `import-export.mdx`) is removed too. License-state changes no longer affect Excel export at all.
4344
- All Safe Mode levels are now free. **Safe Mode** (Touch ID), **Safe Mode (Full)**, and **Read Only** no longer require a Pro license. Removed the Pro gate from `SafeModeGuard` (no more silent downgrade to Silent on unlicensed Macs), the `(Pro)` suffix and license prompt from the Customization pane Picker and toolbar `SafeModeBadgeView`, and the `safeMode` case from `ProFeature`. The `requiresPro` computed property on `SafeModeLevel` is gone along with the unused `showSafeModeProAlert` / `showActivationSheet` flags on `CustomizationPaneViewModel`.
4445
- Favorites sidebar state is now connection-scoped, not window-scoped. Opening a second native tab for the same connection no longer reloads the favorites tree from SQLite or flashes a spinner. The folders/favorites/linked-files cache (`ConnectionDataCache`) is shared across windows of the same connection and refreshes on `.sqlFavoritesDidUpdate` and `.linkedSQLFoldersDidUpdate`. Favorite selection (`ConnectionSidebarState.selectedFavoriteNodeId`) is also shared, so highlighting a favorite in window A reflects in window B and persists across launches via UserDefaults. Favorites search text remains per-window (`WindowSidebarState.favoritesSearchText`), matching Mail/Notes patterns where each window can search independently. The single sidebar `NSSearchField` routes to the connection-shared text on Tables and to the window-local text on Favorites based on the active tab.
4546
- Connection Form rebuilt around macOS HIG sidebar navigation. The old segmented-tab form (~2200 lines across five files) is replaced by a `NavigationSplitView` with five sidebar panes (General, SSH Tunnel, SSL/TLS, Customization, Advanced). State previously held in 30+ flat `@State` vars is now split across six `@Observable` per-pane view models behind a `ConnectionFormCoordinator`. Plugin-driven additional fields auto-route to the right pane by their declared `FieldSection`. The toolbar exposes Cancel, Save, and Save & Connect natively; Test Connection lives inline in the General pane as a Status row. Each sidebar item shows a red warning triangle when its pane has missing required fields.

TablePro/Models/Settings/ProFeature.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import Foundation
1010
/// Features that require a Pro (active) license
1111
internal enum ProFeature: String, CaseIterable {
1212
case iCloudSync
13-
case xlsxExport
1413
case encryptedExport
1514
case envVarReferences
1615
case linkedFolders
@@ -19,8 +18,6 @@ internal enum ProFeature: String, CaseIterable {
1918
switch self {
2019
case .iCloudSync:
2120
return String(localized: "iCloud Sync")
22-
case .xlsxExport:
23-
return String(localized: "XLSX Export")
2421
case .encryptedExport:
2522
return String(localized: "Encrypted Export")
2623
case .envVarReferences:
@@ -34,8 +31,6 @@ internal enum ProFeature: String, CaseIterable {
3431
switch self {
3532
case .iCloudSync:
3633
return "icloud"
37-
case .xlsxExport:
38-
return "tablecells"
3934
case .encryptedExport:
4035
return "lock.doc"
4136
case .envVarReferences:
@@ -49,8 +44,6 @@ internal enum ProFeature: String, CaseIterable {
4944
switch self {
5045
case .iCloudSync:
5146
return String(localized: "Sync connections, settings, and history across your Macs.")
52-
case .xlsxExport:
53-
return String(localized: "Export query results and tables to Excel format.")
5447
case .encryptedExport:
5548
return String(localized: "Export connections with encrypted credentials.")
5649
case .envVarReferences:

TablePro/Resources/Localizable.xcstrings

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -51363,50 +51363,6 @@
5136351363
}
5136451364
}
5136551365
},
51366-
"XLSX Export" : {
51367-
"localizations" : {
51368-
"tr" : {
51369-
"stringUnit" : {
51370-
"state" : "translated",
51371-
"value" : "XLSX Dışa Aktarma"
51372-
}
51373-
},
51374-
"vi" : {
51375-
"stringUnit" : {
51376-
"state" : "translated",
51377-
"value" : "Xuất XLSX"
51378-
}
51379-
},
51380-
"zh-Hans" : {
51381-
"stringUnit" : {
51382-
"state" : "translated",
51383-
"value" : "XLSX 导出"
51384-
}
51385-
}
51386-
}
51387-
},
51388-
"XLSX export requires a Pro license." : {
51389-
"localizations" : {
51390-
"tr" : {
51391-
"stringUnit" : {
51392-
"state" : "translated",
51393-
"value" : "XLSX dışa aktarma için Pro lisans gereklidir."
51394-
}
51395-
},
51396-
"vi" : {
51397-
"stringUnit" : {
51398-
"state" : "translated",
51399-
"value" : "Xuất XLSX yêu cầu giấy phép Pro."
51400-
}
51401-
},
51402-
"zh-Hans" : {
51403-
"stringUnit" : {
51404-
"state" : "translated",
51405-
"value" : "XLSX 导出需要 Pro 许可证。"
51406-
}
51407-
}
51408-
}
51409-
},
5141051366
"XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" : {
5141151367
"localizations" : {
5141251368
"tr" : {

TablePro/Views/Export/ExportDialog.swift

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ struct ExportDialog: View {
2626
@State private var showProgressDialog = false
2727
@State private var showSuccessDialog = false
2828
@State private var exportedFileURL: URL?
29-
@State private var showActivationSheet = false
3029

3130
// MARK: - User Preferences
3231

@@ -94,9 +93,6 @@ struct ExportDialog: View {
9493
}
9594
.frame(width: dialogWidth)
9695
.background(Color(nsColor: .windowBackgroundColor))
97-
.sheet(isPresented: $showActivationSheet) {
98-
LicenseActivationSheet()
99-
}
10096
.onAppear {
10197
let available = availableFormats
10298
if !available.contains(where: { type(of: $0).formatId == config.formatId }) {
@@ -281,11 +277,7 @@ struct ExportDialog: View {
281277
Picker("", selection: $config.formatId) {
282278
ForEach(availableFormatIds, id: \.self) { formatId in
283279
if let plugin = PluginManager.shared.exportPlugin(forFormat: formatId) {
284-
if isProGatedFormat(formatId) {
285-
Text("\(type(of: plugin).formatDisplayName) (Pro)").tag(formatId)
286-
} else {
287-
Text(type(of: plugin).formatDisplayName).tag(formatId)
288-
}
280+
Text(type(of: plugin).formatDisplayName).tag(formatId)
289281
}
290282
}
291283
}
@@ -302,18 +294,8 @@ struct ExportDialog: View {
302294
}
303295
}
304296

305-
// Selection count or Pro gate message
306297
VStack(spacing: 2) {
307-
if isProGatedFormat(config.formatId) {
308-
Text(String(localized: "XLSX export requires a Pro license."))
309-
.font(.subheadline)
310-
.foregroundStyle(Color(nsColor: .systemOrange))
311-
Button(String(localized: "Activate License...")) {
312-
showActivationSheet = true
313-
}
314-
.font(.subheadline)
315-
.buttonStyle(.link)
316-
} else if case .streamingQuery = mode {
298+
if case .streamingQuery = mode {
317299
Text("All rows")
318300
.font(.subheadline)
319301
.foregroundStyle(.secondary)
@@ -450,7 +432,7 @@ struct ExportDialog: View {
450432
}
451433

452434
private var isExportDisabled: Bool {
453-
if isExporting || !isFileNameValid || availableFormats.isEmpty || isProGatedFormat(config.formatId) {
435+
if isExporting || !isFileNameValid || availableFormats.isEmpty {
454436
return true
455437
}
456438
if case .streamingQuery = mode {
@@ -463,7 +445,6 @@ struct ExportDialog: View {
463445
}
464446

465447
private static let formatDisplayOrder = ["csv", "json", "sql", "xlsx", "mql"]
466-
private static let proFormatIds: Set<String> = ["xlsx"]
467448

468449
private func formatDescription(for formatId: String) -> String {
469450
switch formatId {
@@ -476,10 +457,6 @@ struct ExportDialog: View {
476457
}
477458
}
478459

479-
private func isProGatedFormat(_ formatId: String) -> Bool {
480-
Self.proFormatIds.contains(formatId) && !LicenseManager.shared.isFeatureAvailable(.xlsxExport)
481-
}
482-
483460
/// Windows reserved device names (case-insensitive)
484461
private static let windowsReservedNames: Set<String> = [
485462
"CON", "PRN", "AUX", "NUL",

docs/features/import-export.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,6 @@ Export data in five formats (CSV, JSON, SQL, MQL, XLSX), import SQL files with g
134134
```
135135
</Tab>
136136
<Tab title="XLSX">
137-
<Note>
138-
XLSX export requires a **Pro license**.
139-
</Note>
140-
141137
| Option | Default |
142138
|--------|---------|
143139
| Include headers (bold first row) | Yes |

0 commit comments

Comments
 (0)