Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit ce80b30

Browse files
authored
MessageViewController update (#1741)
* update action label when value changes, make actions diffable * Update IGListKit swift branch after rebase * Update MessageViewController pod * fix build, update w/ latest fixes
1 parent 52592f2 commit ce80b30

File tree

62 files changed

+5944
-4787
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+5944
-4787
lines changed

Classes/Issues/Managing/IssueManagingActionModel.swift

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ import IGListKit
1111

1212
final class IssueManagingActionModel: ListDiffable {
1313

14+
let key: String
1415
let label: String
1516
let imageName: String
1617
let color: UIColor
1718

18-
init(label: String, imageName: String, color: UIColor) {
19+
init(key: String, label: String, imageName: String, color: UIColor) {
20+
self.key = key
1921
self.label = label
2022
self.imageName = imageName
2123
self.color = color
@@ -24,12 +26,15 @@ final class IssueManagingActionModel: ListDiffable {
2426
// MARK: ListDiffable
2527

2628
func diffIdentifier() -> NSObjectProtocol {
27-
return label as NSObjectProtocol
29+
return key as NSObjectProtocol
2830
}
2931

3032
func isEqual(toDiffableObject object: ListDiffable?) -> Bool {
31-
// keep it simple
32-
return true
33+
if self === object { return true }
34+
guard let object = object as? IssueManagingActionModel else { return false }
35+
return object.label == label
36+
&& object.imageName == imageName
37+
// skip color, for some reason its a pricy comparison
3338
}
3439

3540
}

Classes/Issues/Managing/IssueManagingSectionController.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,49 @@ ContextMenuDelegate {
1818

1919
private enum Action {
2020
static let labels = IssueManagingActionModel(
21+
key: "tag",
2122
label: NSLocalizedString("Labels", comment: ""),
2223
imageName: "tag",
2324
color: "3f88f7".color
2425
)
2526
static let milestone = IssueManagingActionModel(
27+
key: "milestone",
2628
label: NSLocalizedString("Milestone", comment: ""),
2729
imageName: "milestone",
2830
color: "6847ba".color
2931
)
3032
static let assignees = IssueManagingActionModel(
33+
key: "person",
3134
label: NSLocalizedString("Assignees", comment: ""),
3235
imageName: "person",
3336
color: "e77230".color
3437
)
3538
static let reviewers = IssueManagingActionModel(
39+
key: "reviewer",
3640
label: NSLocalizedString("Reviewers", comment: ""),
3741
imageName: "reviewer",
3842
color: "50a451".color
3943
)
4044
static let lock = IssueManagingActionModel(
45+
key: "lock", // share key so lock/unlock just updates cell
4146
label: NSLocalizedString("Lock", comment: ""),
4247
imageName: "lock",
4348
color: Styles.Colors.Gray.dark.color
4449
)
4550
static let unlock = IssueManagingActionModel(
51+
key: "lock", // share key so lock/unlock just updates cell
4652
label: NSLocalizedString("Unlock", comment: ""),
4753
imageName: "key",
4854
color: Styles.Colors.Gray.dark.color
4955
)
5056
static let reopen = IssueManagingActionModel(
57+
key: "open", // share key so open/close just updates cell
5158
label: Constants.Strings.reopen,
5259
imageName: "sync",
5360
color: Styles.Colors.Green.medium.color
5461
)
5562
static let close = IssueManagingActionModel(
63+
key: "open", // share key so open/close just updates cell
5664
label: Constants.Strings.close,
5765
imageName: "x",
5866
color: Styles.Colors.Red.medium.color

Classes/Systems/Autocomplete/UserAutocomplete.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ final class UserAutocomplete: AutocompleteType {
6565

6666
var highlightAttributes: [NSAttributedStringKey : Any]? {
6767
return [
68-
.font: Styles.Text.body.preferredFont,
6968
.foregroundColor: Styles.Colors.Blue.medium.color,
7069
.backgroundColor: Styles.Colors.Blue.medium.color.withAlphaComponent(0.1),
7170
]

Classes/Views/MessageView+Styles.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,18 @@ extension MessageViewController {
1616
borderColor = Styles.Colors.Gray.border.color
1717
messageView.textView.placeholderText = NSLocalizedString("Leave a comment", comment: "")
1818
messageView.textView.placeholderTextColor = Styles.Colors.Gray.light.color
19-
messageView.set(buttonIcon: UIImage(named: "send")?.withRenderingMode(.alwaysTemplate), for: .normal)
20-
messageView.buttonTint = Styles.Colors.Blue.medium.color
19+
messageView.setButton(icon: UIImage(named: "send")?.withRenderingMode(.alwaysTemplate), for: .normal, position: .right)
20+
messageView.rightButtonTint = Styles.Colors.Blue.medium.color
2121
messageView.font = Styles.Text.body.preferredFont
22-
messageView.inset = UIEdgeInsets(
22+
messageView.textViewInset = UIEdgeInsets(
2323
top: Styles.Sizes.gutter,
2424
left: Styles.Sizes.gutter,
25-
bottom: Styles.Sizes.rowSpacing / 2,
26-
right: Styles.Sizes.gutter
25+
bottom: 0,
26+
right: Styles.Sizes.rowSpacing
2727
)
28-
messageView.addButton(target: target, action: action)
28+
messageView.setButton(inset: Styles.Sizes.gutter, position: .right)
29+
messageView.bottomInset = Styles.Sizes.rowSpacing / 2
30+
messageView.addButton(target: target, action: action, position: .right)
2931
}
3032

3133
}

Podfile.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ PODS:
4646
- GoogleToolboxForMac/Defines (= 2.1.3)
4747
- Highlightr (1.1.0)
4848
- HTMLString (4.0.1)
49-
- IGListKit/Default (3.1.1):
49+
- IGListKit/Default (3.3.0):
5050
- IGListKit/Diffing
51-
- IGListKit/Diffing (3.1.1)
52-
- IGListKit/Swift (3.1.1):
51+
- IGListKit/Diffing (3.3.0)
52+
- IGListKit/Swift (3.3.0):
5353
- IGListKit/Default
5454
- leveldb-library (1.20)
55-
- MessageViewController (0.2.0)
55+
- MessageViewController (0.2.1)
5656
- nanopb (0.3.8):
5757
- nanopb/decode (= 0.3.8)
5858
- nanopb/encode (= 0.3.8)
@@ -149,10 +149,10 @@ CHECKOUT OPTIONS:
149149
:commit: 4f7e90477619b8dc4b9e641efd10952c22150c5c
150150
:git: https://github.com/GitHawkApp/Highlightr.git
151151
IGListKit:
152-
:commit: 9e7974d472b61837b69bcc38da150e72d42ca75e
152+
:commit: 894737d8eaa4eb3d357156d0e7e99bcb1099b61a
153153
:git: https://github.com/Instagram/IGListKit.git
154154
MessageViewController:
155-
:commit: e985c533f3dcefcd98dc836c65e141afca2fe23c
155+
:commit: 4fb166245f72e5d47b6c0f3e67351e9a9802ec63
156156
:git: https://github.com/GitHawkApp/MessageViewController.git
157157
StyledText:
158158
:commit: c9c58444decbbe2fac29b8af5741c8ea3a48887e
@@ -180,9 +180,9 @@ SPEC CHECKSUMS:
180180
GoogleToolboxForMac: 2501e2ad72a52eb3dfe7bd9aee7dad11b858bd20
181181
Highlightr: 70c4df19e4aa55aa1b4387fb98182abce1dec9da
182182
HTMLString: 8d9a8a8aaf63dd52c5b8cd9a38e14da52f753210
183-
IGListKit: 2f46c3390be7e0fd70b401abb34b3737d4730c19
183+
IGListKit: 7edb98afdb8401245d8bea0b733ebd4ac5e67caf
184184
leveldb-library: 08cba283675b7ed2d99629a4bc5fd052cd2bb6a5
185-
MessageViewController: a9119bb49a4f6eeeb69ec3c4ab5f1dd7a2ddec02
185+
MessageViewController: 63ef2719d82c91d949ad52e101f049028a5a0611
186186
nanopb: 5601e6bca2dbf1ed831b519092ec110f66982ca3
187187
NYTPhotoViewer: e80e8767f3780d2df37c6f72cbab15d6c7232911
188188
Pageboy: 50db8fffaa6d4d004249b7b6b19e33464dd7505b

Pods/IGListKit/README.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pods/IGListKit/Source/Common/IGListBatchUpdateData.mm

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pods/IGListKit/Source/Common/IGListDiff.mm

Lines changed: 87 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)