Skip to content

Commit 18f5bf8

Browse files
committed
fix(datagrid): address code review issues
1 parent 8d2703e commit 18f5bf8

4 files changed

Lines changed: 12 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4646
- Opening a `.sql` file names the tab after the file instead of showing "SQL Query". (#1220)
4747
- Data grid row context menus now copy the clicked or focused cell value for Copy, while Copy Rows still keeps the full-row TSV action.
4848
- Opening a table in a new tab now restores saved hidden columns before the first load, so the initial query matches the visible column set.
49+
- The JSON detail popover now shows long string values up to 300 characters in the tree view instead of cutting them off at 80.
4950

5051
## [0.45.0] - 2026-05-26
5152

TablePro/Core/Coordinators/FilterCoordinator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ final class FilterCoordinator {
423423

424424
func clearFilterState() {
425425
mutateSelectedTabFilterState { state in
426-
state.isVisible = false
426+
state.isVisible = true
427427
state.filters = []
428428
state.appliedFilters = []
429429
}

TablePro/Models/UI/JSONTreeNode.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ internal enum JSONTreeParseError: Error {
5757
internal enum JSONTreeParser {
5858
private static let maxNodes = 5_000
5959
private static let maxInputLength = 100_000
60+
private static let maxDisplayLength = 300
6061

6162
static func parse(_ jsonString: String) -> Result<JSONTreeNode, JSONTreeParseError> {
6263
guard (jsonString as NSString).length <= maxInputLength else {
@@ -108,9 +109,15 @@ internal enum JSONTreeParser {
108109
case .string(let raw):
109110
let decoded = JsonSyntaxParser.decodeStringLiteral(raw)
110111
let escaped = decoded.replacingOccurrences(of: "\"", with: "\\\"")
112+
let display: String
113+
if (escaped as NSString).length > maxDisplayLength {
114+
display = "\"\((escaped as NSString).substring(to: maxDisplayLength))...\""
115+
} else {
116+
display = "\"\(escaped)\""
117+
}
111118
return JSONTreeNode(
112119
key: key, keyPath: keyPath, valueType: .string,
113-
displayValue: "\"\(escaped)\"", rawValue: decoded, children: []
120+
displayValue: display, rawValue: decoded, children: []
114121
)
115122

116123
case .number(let raw):

TablePro/Views/Main/Extensions/MainContentView+Setup.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ extension MainContentView {
6767
selectedTab.tableContext.databaseName != session.activeDatabase
6868
{
6969
await coordinator.switchDatabase(to: selectedTab.tableContext.databaseName)
70+
} else if coordinator.selectedTabHiddenColumns.isEmpty {
71+
coordinator.runQuery()
7072
} else {
7173
coordinator.lazyLoadCurrentTabIfNeeded()
7274
}

0 commit comments

Comments
 (0)