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

Show release notes UI in inbox when notable new features #2473

Merged
merged 2 commits into from Nov 23, 2018
Merged

Conversation

rnystrom
Copy link
Member

cc @BasThomas

simulator screen shot - iphone xs - 2018-11-23 at 00 11 14

simulator screen shot - iphone xs - 2018-11-23 at 00 15 30

) {
self.markdown = markdown
self.owner = owner
self.repo = repo
super.init(nibName: nil, bundle: nil)
title = NSLocalizedString("Preview", comment: "")
self.title = title
if asMenu {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this does/when it is used? What is this ViewController showing again?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previewing markdown


weak var delegate: NewFeaturesCellDelegate?

private let label = UILabel()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a bit more descriptive, I think? 😄

backgroundColor = .white
contentView.backgroundColor = Styles.Colors.Blue.light.color
contentView.layer.cornerRadius = Styles.Sizes.cardCornerRadius
contentView.layer.borderWidth = 1 / UIScreen.main.scale
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be 1 * scale? Not sure what you're trying to achieve here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks to be a 1px thin line rather than a 1pt thin line! I've used this a couple times 😄

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, a borderWidth of 1 would be in points. Interesting 🤔

contentView.addSubview(closeButton)

let tint = Styles.Colors.Blue.medium.color
label.text = NSLocalizedString("View new features!", comment: "")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"View new features in this release" maybe?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd even maybe consider chucking the actual version number in? Makes it look less repetitive!

View new features in v1.24

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might include version, want to keep this short to avoid the risk of truncation


override func layoutSubviews() {
super.layoutSubviews()
contentView.frame = UIEdgeInsetsInsetRect(CGRect(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the same as inset(by:)? That'd be a bit more Swifty and readable :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s for x and y insetting (not UIEdgeInsets)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh TIL!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swift 4.2 (codebase still 4.0)

screen shot 2018-11-23 at 11 23 52 am

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:D

self?.markdown = markdown
self?.update()
case .error(let error):
print(error?.localizedDescription ?? "Error updating new features")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NSLocalizedString?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a print not user facing

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops right

}
}

override func createBinders(from value: String) -> [ListBinder] {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is some... interesting code. Having difficulties parsing/understanding this completely :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Takes some getting used to. Heavy use of generics but result is completely type safe.

private func showChanges(markdown: String) {
viewController?.showContextualMenu(IssuePreviewViewController(
markdown: markdown,
owner: "GitHawkApp",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think someone added the GitHawk owner/repo combination in a constant somewhere? Not sure who/where.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BasThomas Yup I did! But its in the Templates pull request which hasn't been merged

switch result {
case .success(let markdown):
self?.markdown = markdown
self?.update()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does update() do?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates the view 😋

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing bug

markdown: markdown,
owner: "GitHawkApp",
repo: "GitHawk",
title: controller.version,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potentially: What's new in v1.0.1?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s a small window, wanna keep it brief to avoid truncation

)
}

override func accessibilityPerformEscape() -> Bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪

@rnystrom rnystrom merged commit 5021a6c into master Nov 23, 2018
@Huddie Huddie mentioned this pull request Nov 27, 2018
8 tasks
@Huddie
Copy link
Collaborator

Huddie commented Nov 30, 2018

@rnystrom Any chance this could have impacted the inbox zero icon? I'm getting a blank screen

@kocheck kocheck mentioned this pull request Nov 30, 2018
5 tasks
@rnystrom
Copy link
Member Author

@Huddie shoot! Probably

Sent with GitHawk

@rnystrom rnystrom deleted the new-features branch November 30, 2018 15:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants