Show branch starts in commit history
This commit is contained in:
@@ -1509,6 +1509,7 @@ public struct CommitRow: Equatable, Hashable {
|
||||
public var sha: String
|
||||
public var title: String
|
||||
public var detail: String
|
||||
public var branchLabel: String?
|
||||
public var topLanes: [UInt32]
|
||||
public var bottomLanes: [UInt32]
|
||||
public var nodeLane: UInt32?
|
||||
@@ -1517,10 +1518,11 @@ public struct CommitRow: Equatable, Hashable {
|
||||
|
||||
// Default memberwise initializers are never public by default, so we
|
||||
// declare one manually.
|
||||
public init(sha: String, title: String, detail: String, topLanes: [UInt32], bottomLanes: [UInt32], nodeLane: UInt32?, topConnections: [UInt32], bottomConnections: [UInt32]) {
|
||||
public init(sha: String, title: String, detail: String, branchLabel: String?, topLanes: [UInt32], bottomLanes: [UInt32], nodeLane: UInt32?, topConnections: [UInt32], bottomConnections: [UInt32]) {
|
||||
self.sha = sha
|
||||
self.title = title
|
||||
self.detail = detail
|
||||
self.branchLabel = branchLabel
|
||||
self.topLanes = topLanes
|
||||
self.bottomLanes = bottomLanes
|
||||
self.nodeLane = nodeLane
|
||||
@@ -1547,6 +1549,7 @@ public struct FfiConverterTypeCommitRow: FfiConverterRustBuffer {
|
||||
sha: FfiConverterString.read(from: &buf),
|
||||
title: FfiConverterString.read(from: &buf),
|
||||
detail: FfiConverterString.read(from: &buf),
|
||||
branchLabel: FfiConverterOptionString.read(from: &buf),
|
||||
topLanes: FfiConverterSequenceUInt32.read(from: &buf),
|
||||
bottomLanes: FfiConverterSequenceUInt32.read(from: &buf),
|
||||
nodeLane: FfiConverterOptionUInt32.read(from: &buf),
|
||||
@@ -1559,6 +1562,7 @@ public struct FfiConverterTypeCommitRow: FfiConverterRustBuffer {
|
||||
FfiConverterString.write(value.sha, into: &buf)
|
||||
FfiConverterString.write(value.title, into: &buf)
|
||||
FfiConverterString.write(value.detail, into: &buf)
|
||||
FfiConverterOptionString.write(value.branchLabel, into: &buf)
|
||||
FfiConverterSequenceUInt32.write(value.topLanes, into: &buf)
|
||||
FfiConverterSequenceUInt32.write(value.bottomLanes, into: &buf)
|
||||
FfiConverterOptionUInt32.write(value.nodeLane, into: &buf)
|
||||
|
||||
@@ -1309,7 +1309,17 @@ final class CommitCell: UITableViewCell {
|
||||
? 0
|
||||
: CGFloat(laneCount) * Self.laneSpacing + 10
|
||||
content.text = row.title
|
||||
content.secondaryText = row.detail
|
||||
if let branch = row.branchLabel {
|
||||
let text = NSMutableAttributedString(string: "\(branch)\n\(row.detail)")
|
||||
text.addAttribute(
|
||||
.foregroundColor,
|
||||
value: UIColor.tintColor,
|
||||
range: NSRange(location: 0, length: (branch as NSString).length)
|
||||
)
|
||||
content.secondaryAttributedText = text
|
||||
} else {
|
||||
content.secondaryText = row.detail
|
||||
}
|
||||
content.secondaryTextProperties.numberOfLines = 2
|
||||
contentConfiguration = content
|
||||
setNeedsDisplay()
|
||||
|
||||
Reference in New Issue
Block a user