Skip to content

Commit bf11d43

Browse files
authored
fix: column visibility UX — count badge, wider popover, lower search threshold (#778) (#798)
1 parent 4f59dee commit bf11d43

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

TablePro/Views/Main/Child/MainStatusBarView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ struct MainStatusBarView: View {
119119
: "eye.circle")
120120
Text("Columns")
121121
if columnVisibilityManager.hasHiddenColumns {
122-
Text("(\(columnVisibilityManager.hiddenCount) hidden)")
122+
let visible = allColumns.count - columnVisibilityManager.hiddenCount
123+
Text("(\(visible)/\(allColumns.count))")
123124
.foregroundStyle(.secondary)
124125
}
125126
}

TablePro/Views/Results/ColumnVisibilityPopover.swift

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,28 @@ struct ColumnVisibilityPopover: View {
2424

2525
Divider()
2626

27-
if columns.count > 10 {
27+
if columns.count > 5 {
2828
searchField
2929
Divider()
3030
}
3131

3232
columnList
3333
}
34-
.frame(width: 220)
35-
.frame(maxHeight: 350)
34+
.frame(width: 260)
35+
.frame(maxHeight: 420)
36+
}
37+
38+
private var headerTitle: String {
39+
let visible = columns.count - columnVisibilityManager.hiddenCount
40+
if columnVisibilityManager.hasHiddenColumns {
41+
return "\(visible) of \(columns.count)"
42+
}
43+
return String(localized: "Columns")
3644
}
3745

3846
private var header: some View {
3947
HStack {
40-
Text("Columns")
48+
Text(headerTitle)
4149
.font(.headline)
4250
.foregroundStyle(.primary)
4351

0 commit comments

Comments
 (0)