-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#330] Add description texts to cells #384
[#330] Add description texts to cells #384
Conversation
Thank you for the pull request!The Scribe team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :) If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the General and iOS rooms once you're in. It'd be great to have you! Maintainer checklist
|
c6d717d
to
5bd24f3
Compare
I might even be able to shave off some files by using the native UITableViewCell instead of custom cells now that I got rid of the intermediate |
headerView = UIView(frame: CGRect(x: 0, y: 0, width: tableView.bounds.width, height: sectionHeaderHeight)) | ||
} | ||
|
||
let label = UILabel(frame: CGRect(x: 0, y: 0, width: headerView.bounds.width, height: sectionHeaderHeight)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for myself, check that I'm not adding a UILabel
on top of another UILabel
each time the header is requested.
5bd24f3
to
276affd
Compare
Very sorry for the wait on all this, @damien-rivet.
If you're able to simplify things down further this sounds reasonable to me :) Comments on the overall design of the changes, which are expansive and include some things that you doubtless are planning on getting to:
|
@@ -1,42 +1,47 @@ | |||
// | |||
// AboutViewController.swift | |||
// Copyright (C) 2023 Scribe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you suggest putting this copyright notice at the head of each file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the project is based on the GNU license, it is advised by the license itself to add this header on top of each code file.
I'm adding it to new files and files I'm refactoring only, doing a complete pass would add nothing and generate extra commit noise, it can be done over time instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll make an issue for this, @damien-rivet! Thanks for bringing this to my attention :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #391 😊
|
||
let nib = UINib(nibName: "ParentTableViewCell", bundle: nil) | ||
outerTable.register(nib, forCellReuseIdentifier: "ParentTableViewCell") | ||
title = NSLocalizedString("about.title", comment: "The title of the about tab") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really beautiful stuff, and great that you jumped into already using the naming conventions we're planning on 🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 😉 A good thing with this system is that the naming can be changed and it will update the catalog with the new keys (not sure it will move the values accordingly though 🤔 ).
|
||
present(mailComposeViewController, animated: true, completion: nil) | ||
} else { | ||
/// Show alert mentioning the email address |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for nit for period that I can add :)
@@ -0,0 +1,157 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really appreciate the focus on L10n :) We might end up switching this over to a JSON as the general idea is that we'll be linking it to the Android repo as well (see Scribe-i18n#1), but for now this is great and sets us up perfectly for the later switch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm good point 🤔 At least the call sites can be found pretty easily 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made #392 to cover this :)
First sweep is done and I've also gone through and tested the menu options to make sure that everything is being reflected in the keyboard after options are selected. All's working really well, and the code is dramatically easier to follow given the new changes 😊 Let me know how much of the comments above you'd like to implement, @damien-rivet! I'm happy to look those that you feel are out of scope for the current task :) |
Changed static data to constants to avoid unwanted modifications. Added localization catalog to the Scribe App. Added a shortDescription field to cell model.
Add a base table view controller to implement similar logic between screens.
Additional clean up.
276affd
to
040dbd0
Compare
I'll look into this, it should be a matter of tweaking the separator insets 🤔
You're absolutely right, chevron needs to be used whenever there's a nested navigation that comes from the user tapping a cell, so it makes sense to add them whenever it is needed.
I'll check if it possible without changing drastically the code, the tableview itself cover the whole screen and the cells group is not shadowable that easily. Apple's own HIG suggested at some point that subtle shadows should be used but now there's no mention of it at all 🤔
I've used a basic corner radius, it can be tweaked if we needed to change it 😉
Nah I'll do it by updating the table data for the settings screen.
|
Added separator insets to tableviews. Added disclosure indicators in About tabs to cells with nested navigation. Additional cleanups.
@andrewtavis I've fixed most of the comments, there's only the one related to adding back the table's shadow that's still left to do. Once this PR is merged, I'll create an issue for that. |
Thank you, @damien-rivet! Really appreciate your continued efforts here :) I'll get to the review by EOW as it's a bit of a busy one for me :) |
@andrewtavis don't sweat it 😉 There's no rush, end of the year is hard on everyone as there's plenty to handle both personally and professionally. I hope you had a great Christmas (or equivalent) and I hope you'll have a wonderful New Year's eve ^^ |
Thank you for the understanding and the message, @damien-rivet 😊 Really does help with some of the nerves of not being able to context switch over to this given all that's going on. The holidays were relaxed in a good way, and Chaos Communication Congress has been a lot of fun so far! Hoping that you and yours have had a nice Christmas (or equivalent) as well, and wishing you all the best for the end of the year and start of the next! |
], | ||
hasDynamicData: nil | ||
), | ||
ParentTableCellModel( | ||
headingTitle: "Legal", | ||
section: [ | ||
Section(sectionTitle: "Privacy policy", imageString: "lock.shield", hasToggle: false, sectionState: .privacyPolicy), | ||
Section(sectionTitle: "Third-party licenses", imageString: "thirdPartyLicenses", hasToggle: false, sectionState: .licenses), | ||
Section(sectionTitle: "Privacy policy", imageString: "lock.shield", hasNestedNavigation: true, sectionState: .privacyPolicy), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching it to nested navigation as a check makes a lot more sense, @damien-rivet :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very sorry for the wait here, @damien-rivet. Slowly trying to get back into more active maintenance of Scribe, and I really appreciate your patience and support for the project!
All looks good to me here. As stated in the comments, I've made two issues to cover the license requirements and to shift the i18n over to JSONs, but those should be easy enough to achieve :) The last things I'm seeing that are needed here are the shadows under the menu fields and external link icons for those options that link to the web like the Matrix and GitHub options. I'll make issues for those now!
Description
This PR adds the description labels to the settings cells.
Under the hood, it does far more things than that, here's an exhaustive list:
BaseTableViewController
to share setup logic with all TableViewVCsAboutTableViewCell
AboutTabViewController
to inheritBaseTableViewController
TableViewTemplateViewController
to inheritBaseTableViewController
ParentTableViewCell
(used native section instead and changed TableViewVCs to use grouped inset)Design of the cells might evolve again depending on the needs that may arise.
Screenshots
Related issue