Skip to content
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

Conversation

damien-rivet
Copy link
Contributor

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:

  • Add a localisation catalog (only English is filled for now)
  • Add a BaseTableViewController to share setup logic with all TableViewVCs
  • Add a dedicated AboutTableViewCell
  • Refactor AboutTabViewController to inherit BaseTableViewController
  • Refactor TableViewTemplateViewController to inherit BaseTableViewController
  • Remove image view from info tableview cell
  • Remove ParentTableViewCell (used native section instead and changed TableViewVCs to use grouped inset)
  • Move interaction logic from info tableview cell to respective screens

Design of the cells might evolve again depending on the needs that may arise.

Screenshots

iPhone iPad
Settings Simulator Screenshot - iPhone 15 Pro - 2023-11-20 at 09 40 44 Simulator Screenshot - iPad Pro (12 9-inch) (6th generation) - 2023-11-20 at 09 38 49
Language settings Simulator Screenshot - iPhone 15 Pro - 2023-11-20 at 09 40 47 Simulator Screenshot - iPad Pro (12 9-inch) (6th generation) - 2023-11-20 at 09 38 53
About Simulator Screenshot - iPhone 15 Pro - 2023-11-20 at 09 40 50 Simulator Screenshot - iPad Pro (12 9-inch) (6th generation) - 2023-11-20 at 09 38 56

Related issue

Copy link

github-actions bot commented Nov 20, 2023

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

  • The commit messages for the remote branch should be checked to make sure the contributor's email is set up correctly so that they receive credit for their contribution

    • The contributor's name and icon in remote commits should be the same as what appears in the PR
    • If there's a mismatch, the contributor needs to make sure that the email they use for GitHub matches what they have for git config user.email in their local Scribe-iOS repo
  • The CHANGELOG has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

@damien-rivet damien-rivet force-pushed the feature/330-add-settings-options-information-tooltips branch from c6d717d to 5bd24f3 Compare November 20, 2023 09:01
@damien-rivet
Copy link
Contributor Author

damien-rivet commented Nov 20, 2023

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 UITableView (when I removed the ParentTableViewCell) 🤔

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))
Copy link
Contributor Author

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.

@damien-rivet damien-rivet force-pushed the feature/330-add-settings-options-information-tooltips branch from 5bd24f3 to 276affd Compare November 20, 2023 13:10
@andrewtavis andrewtavis self-requested a review November 30, 2023 00:57
@andrewtavis
Copy link
Member

Very sorry for the wait on all this, @damien-rivet.

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 UITableView (when I removed the ParentTableViewCell) 🤔

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:

  • The divider lines would ideally not span the whole view and would have an equal-width gap from the view's right side
  • Would you say that we shouldn't do chevrons on the About page options?
    • I was thinking that having them for everything makes sense for consistency as we have Privacy policy and Third-party licenses that go to a sub page in a similar way that elements of Settings do (French and Italian above)
    • As those aforementioned options on About would have the chevron, then including it for all the elements for visible consistency made sense to me
  • A bit of a shadow on the table views would be good
    • Hex for the shadow in the designs is #3F3F46
  • I wrote out an ask for an increase in corner rounding and then tried what you implemented in the designs and I think your version looks much cleaner 😊
    • Designs have been updated :)
  • I also updated the designs to partially reflect what you have for Settings in so far as I don't think we need descriptions for App language, Increase app text size or High color contrast
    • Is it possible to do App settings as the section header and App language with a chevron and default for the field?
    • We can also do a different issue to finalize this 😊
    • Sets it up for some issues for color contrast and text size later

@@ -1,42 +1,47 @@
//
// AboutViewController.swift
// Copyright (C) 2023 Scribe
Copy link
Member

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?

Copy link
Contributor Author

@damien-rivet damien-rivet Dec 15, 2023

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.

Copy link
Member

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 :)

Copy link
Member

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")
Copy link
Member

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 🙌

Copy link
Contributor Author

@damien-rivet damien-rivet Dec 15, 2023

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
Copy link
Member

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 @@
{
Copy link
Member

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!

Copy link
Contributor Author

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 😄

Copy link
Member

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 :)

@andrewtavis
Copy link
Member

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.
@damien-rivet damien-rivet force-pushed the feature/330-add-settings-options-information-tooltips branch from 276affd to 040dbd0 Compare December 15, 2023 07:52
@damien-rivet
Copy link
Contributor Author

Very sorry for the wait on all this, @damien-rivet.

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 UITableView (when I removed the ParentTableViewCell) 🤔

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:

  • The divider lines would ideally not span the whole view and would have an equal-width gap from the view's right side

I'll look into this, it should be a matter of tweaking the separator insets 🤔

  • Would you say that we shouldn't do chevrons on the About page options?

    • I was thinking that having them for everything makes sense for consistency as we have Privacy policy and Third-party licenses that go to a sub page in a similar way that elements of Settings do (French and Italian above)
    • As those aforementioned options on About would have the chevron, then including it for all the elements for visible consistency made sense to me

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.

  • A bit of a shadow on the table views would be good

    • Hex for the shadow in the designs is #3F3F46

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 wrote out an ask for an increase in corner rounding and then tried what you implemented in the designs and I think your version looks much cleaner 😊

    • Designs have been updated :)

I've used a basic corner radius, it can be tweaked if we needed to change it 😉

  • I also updated the designs to partially reflect what you have for Settings in so far as I don't think we need descriptions for App language, Increase app text size or High color contrast

    • Is it possible to do App settings as the section header and App language with a chevron and default for the field?
    • We can also do a different issue to finalize this 😊

Nah I'll do it by updating the table data for the settings screen.

  • Sets it up for some issues for color contrast and text size later

Added separator insets to tableviews.
Added disclosure indicators in About tabs to cells with nested navigation.
Additional cleanups.
@damien-rivet
Copy link
Contributor Author

@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.

@andrewtavis
Copy link
Member

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 :)

@damien-rivet
Copy link
Contributor Author

@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 ^^

@andrewtavis
Copy link
Member

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),
Copy link
Member

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 :)

Copy link
Member

@andrewtavis andrewtavis left a 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!

@andrewtavis andrewtavis merged commit 5087842 into scribe-org:main Jan 13, 2024
@damien-rivet damien-rivet deleted the feature/330-add-settings-options-information-tooltips branch March 22, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants