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

Sidebar: Minor Improvements #23611

Merged
merged 11 commits into from
Sep 20, 2024
Merged

Sidebar: Minor Improvements #23611

merged 11 commits into from
Sep 20, 2024

Conversation

kean
Copy link
Contributor

@kean kean commented Sep 18, 2024

1. Tint Color

Revert tint color to black in jpios and find a workaround for Reader sidebar in dark mode on iOS 17 (was showing white on white).

iOS 18

tint-main-ios18-app tint-main-ios18-reader

iOS 17 (Before – Broken)

tint-reader-ios17-dark-before

iOS 17 (Now – Fixed)

tint-reader-ios17-dark tint-reader-ios17-light

2. Pop to Root

Pop current .secondary VC to root when you tap the same sidebar item.

pop-root-reader.mp4

3. Remove Me on wpios

It is now available in the main sidebar.

me-tab-wpios

4. Fix disabled state for buttons

On login screens, the buttons were too dark. New state:

buttons-login-screen

5. Remove focus effect in Site Menu

I'm adding a defect to fix it during the SwiftUI rework.

6. Store sidebar selection

The app will now remember when you open Reader persistently and re-open it authentically when you re-launch the app.

In the future, we probably need to simply persist all selections, but that would requires TaggedObjectId to be Codable or find another way to persist it.

To test:

Regression Notes

  1. Potential unintended areas of impact

  2. What I did to test those areas of impact (or what existing automated tests I relied on)

  3. What automated tests I added (or what prevented me from doing so)

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing checklist:

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • VoiceOver.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • iPhone and iPad.
  • Multi-tasking: Split view and Slide over. (iPad)

@dangermattic
Copy link
Collaborator

dangermattic commented Sep 18, 2024

1 Warning
⚠️ This PR is assigned to the milestone 25.4. This milestone is due in less than 4 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@kean kean added the iPad label Sep 18, 2024
@kean kean added this to the 25.4 milestone Sep 18, 2024
}
}
case .notifications:
// TODO: (wpsidebar) update tab bar item when new notifications arrive
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already do it in SidebarVC

@@ -20,7 +20,6 @@ class SiteSplitViewContent: SiteMenuViewControllerDelegate, SplitViewDisplayable
func displayed(in splitVC: UISplitViewController) {
RecentSitesService().touch(blog: blog)

// TODO: (wpsidebar) Refactor this (initial .secondary vc managed based on the VC presentation)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added to a tech debt list.

// -warning: List occasionally sets the selection to `nil` when switching items.
viewModel.$selection.compactMap { $0 }
.removeDuplicates { [weak self] in
guard $0 == $1 else { return false }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is the easiest way to implement it without introducing any additional state.

Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think implementing it by handing double tap gesture?

At the moment, double tap would lead to selection getting the same value. But selection getting the same value doesn't always mean a double tap.

It's very possible that selection is changed to the same value, programmatically rather than by user interaction. For example, when tapping a reader post deep link while the app is already in the Reader, the code may assign .reader to the selection again.

Copy link
Contributor Author

@kean kean Sep 19, 2024

Choose a reason for hiding this comment

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

What do you think implementing it by handing double tap gesture?

It has to be single tap because that's what Apple apps do.

programmatically rather than by user interaction

That's a good point. I'm not sure how to address it because the way List selection in the sidebar works is also indirect. There is no "user tapped cell X" callback. It's observables all the way down.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's OK to ship it this way because if it's a deep link for let's say "Discover", it should be OK to pop to root. Both the deep links and Split View needs to be revised in the future versions.

Copy link
Contributor

Choose a reason for hiding this comment

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

I only checked out Apple Podcasts app. And it has inconsistent UX. If you tap one of the tabs (i.e. Browse), the app takes you to the root. But if you tap other items (like in the Library section), it doesn't. I feel like Apple apps may piggy pack on UITabBarController's implementation.

I think it's OK to ship it this way because if it's a deep link for let's say "Discover"

Deep link is just one example on top of my head. From the code level, viewModel.selection = ... can be done at any stage, and it's very likely that we would forget this simple assignment may lead to a navigation stack change to the app UI.

I guess it's okay to ship it as the potential issue is limited on the Reader tab only.

@wpmobilebot
Copy link
Contributor

WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr23611-58407bf
Version25.3
Bundle IDorg.wordpress.alpha
Commit58407bf
App Center BuildWPiOS - One-Offs #10701
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot
Copy link
Contributor

Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr23611-58407bf
Version25.3
Bundle IDcom.jetpack.alpha
Commit58407bf
App Center Buildjetpack-installable-builds #9745
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

// -warning: List occasionally sets the selection to `nil` when switching items.
viewModel.$selection.compactMap { $0 }
.removeDuplicates { [weak self] in
guard $0 == $1 else { return false }
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think implementing it by handing double tap gesture?

At the moment, double tap would lead to selection getting the same value. But selection getting the same value doesn't always mean a double tap.

It's very possible that selection is changed to the same value, programmatically rather than by user interaction. For example, when tapping a reader post deep link while the app is already in the Reader, the code may assign .reader to the selection again.

@kean kean added this pull request to the merge queue Sep 20, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 20, 2024
@kean kean merged commit 54da4a2 into trunk Sep 20, 2024
24 checks passed
@kean kean deleted the task/sidebar-minor-fixes branch September 20, 2024 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants