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

[MOB-2846] Apple Navigation appearance same as Widgets settting #761

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

d4r1091
Copy link
Member

@d4r1091 d4r1091 commented Aug 28, 2024

MOB-2846

Context

As noticed by one of our fellow Ecosians, when switching the theme with the settings page opened, the Settings title doesn’t behave correctly.

Approach

Investigated and found out that for the ThemeDefaultNavigationController (why having ThemedNavigationController and this 🤷‍♂️ ) the largeTitleTextAttributes are defined and override the NavigationController's navigation bar appearance.
A recorded simulator with the issue fixed is provided as part of a Jira comment on the ticket.

Before merging

Checklist

  • I performed some relevant testing on a real device and/or simulator
  • I added the // Ecosia: helper comments where needed

@d4r1091 d4r1091 requested a review from a team August 28, 2024 08:19
Copy link

PR Reviewer Guide 🔍

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Key issues to review

Code Consistency
The addition of largeTitleTextAttributes in ThemedNavigationController should be consistent with other controllers. Ensure that similar settings are applied across all navigation controllers to maintain uniformity in UI components.

Copy link

github-actions bot commented Aug 28, 2024

PR Code Suggestions ✨

CategorySuggestion                                                                                                                                    Score
Enhancement
Apply consistent text attributes to all navigation bar appearances

To ensure consistency in the appearance of navigation bars across different
contexts, consider applying the same titleTextAttributes settings to
compactAppearance and scrollEdgeAppearance as well. This will maintain uniformity in
navigation bar appearance during transitions and in compact states.

Client/Frontend/Settings/SettingsNavigationController.swift [50-51]

-standardAppearance.largeTitleTextAttributes = [.foregroundColor: theme.colors.textPrimary]
-standardAppearance.titleTextAttributes = [.foregroundColor: theme.colors.textPrimary]
+let textAttributes = [.foregroundColor: theme.colors.textPrimary]
+standardAppearance.largeTitleTextAttributes = textAttributes
+standardAppearance.titleTextAttributes = textAttributes
+standardAppearance.compactAppearance?.titleTextAttributes = textAttributes
+standardAppearance.scrollEdgeAppearance?.titleTextAttributes = textAttributes
 
Suggestion importance[1-10]: 8

Why: The suggestion improves consistency in the navigation bar's appearance across different contexts, which enhances the user interface's uniformity and visual appeal. It addresses a potential oversight in the original code by ensuring that all navigation bar appearances have consistent text attributes.

8

Copy link

@lucaschifino lucaschifino left a comment

Choose a reason for hiding this comment

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

🙌

Edit: Seems like tests are failing, I guess it's some flaky unrelated test? I've experienced it myself lately

@d4r1091
Copy link
Member Author

d4r1091 commented Aug 28, 2024

Yeah it's related to some of does. I've relaunched them but will dedicate some time to look at those properly

@d4r1091 d4r1091 merged commit be34194 into main Aug 28, 2024
3 checks passed
@d4r1091 d4r1091 deleted the MOB-2846_navigation_bar_theme_fix branch August 28, 2024 11:07
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