refactor(servers): remove timestamp table columns

This commit is contained in:
Qiu Yuzhou
2026-10-14 17:15:04 +08:00
parent d5f32ec83d
commit 287cc5d5d5
@@ -166,14 +166,6 @@ struct ServersView: View {
}
}
.width(min: 50, ideal: 60)
TableColumn("创建时间", sortUsing: ServerTableSort(.createdAt)) { node in
timestampCell(node.createdAt)
}
.width(min: 100, ideal: timestampColumnWidth)
TableColumn("修改时间", sortUsing: ServerTableSort(.updatedAt)) { node in
timestampCell(node.updatedAt)
}
.width(min: 100, ideal: timestampColumnWidth)
} rows: {
ForEach(rows) { row in
TableRow(row.node)
@@ -225,25 +217,6 @@ struct ServersView: View {
}
}
private func timestampCell(_ date: Date?) -> some View {
Text(date.map { Self.timestampFormatter.string(from: $0) } ?? "—")
.lineLimit(1)
.foregroundStyle(.secondary)
}
private static let timestampFormatter: DateFormatter = {
let formatter = DateFormatter()
formatter.dateStyle = .short
formatter.timeStyle = .short
return formatter
}()
private var timestampColumnWidth: CGFloat {
let text = Self.timestampFormatter.string(from: Date())
return ceil(
(text as NSString).size(withAttributes: [.font: NSFont.systemFont(ofSize: 13)]).width) + 24
}
/// 删除结果 → selection invalidation:仅清除失效选择,不自动
/// 改选相邻节点。
private func clearSelectionIfInvalidated(_ removed: Set<NodeID>) {