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

use modern UIMenu #2545

Merged
merged 13 commits into from
Jan 28, 2025
Merged

use modern UIMenu #2545

merged 13 commits into from
Jan 28, 2025

Conversation

r10s
Copy link
Member

@r10s r10s commented Jan 22, 2025

this PR replaces some all of the old "actionSheet" menus with the more modern ones available since iOS 13/14.

it is all pretty much straight-forward. greater refactorings, renamings are not done, to keep the changed lines small.

see commit messages for more details, this is what it looks like:



















@r10s r10s requested a review from Amzd January 22, 2025 18:00
@r10s r10s force-pushed the r10s/more-modern-menus branch 2 times, most recently from 3ea1034 to 128e657 Compare January 22, 2025 23:58
@r10s r10s force-pushed the r10s/more-modern-menus branch from 128e657 to cec2555 Compare January 23, 2025 13:06
@r10s r10s changed the title use modern UIMenu for the help screen use modern UIMenu for help screen, instant onboarding Jan 23, 2025
@r10s r10s force-pushed the r10s/more-modern-menus branch from cec2555 to 216d509 Compare January 23, 2025 13:26
@r10s r10s changed the title use modern UIMenu for help screen, instant onboarding use modern UIMenu for help screen, instant onboarding, second device Jan 23, 2025
@r10s r10s force-pushed the r10s/more-modern-menus branch from 3bc7bc9 to e320c98 Compare January 23, 2025 15:14
@r10s r10s changed the title use modern UIMenu for help screen, instant onboarding, second device use modern UIMenu for help screen, instant onboarding, second device, action bars Jan 23, 2025
@r10s r10s changed the title use modern UIMenu for help screen, instant onboarding, second device, action bars use modern UIMenu Jan 23, 2025
@r10s r10s removed the request for review from Amzd January 23, 2025 15:26
@r10s r10s marked this pull request as draft January 23, 2025 15:26
@r10s r10s requested a review from Amzd January 23, 2025 16:12
@r10s r10s marked this pull request as ready for review January 23, 2025 16:13
@r10s r10s force-pushed the r10s/more-modern-menus branch 5 times, most recently from 48945d9 to fb8b53d Compare January 24, 2025 16:44
@r10s r10s requested a review from zeitschlag January 24, 2025 17:39
@r10s
Copy link
Member Author

r10s commented Jan 24, 2025

puh, was a little bit more than expected - but now we have all drop-down-menus modernised :) (context menus and attach menu were modernised already before)

@r10s r10s force-pushed the r10s/more-modern-menus branch from 0f14436 to 52b88ab Compare January 24, 2025 17:45
@r10s r10s added the enhancement actually in development, user visible enhancement label Jan 24, 2025
it is not an action that is useful during usage (as 'add to widget'),
and if, 'forward' should also be there.
instead, just point to 'show in chat'
where meanwhile both are available (which was not always the case)
guard let self else { return }
viewModel.pinChatsToggle(indexPaths: tableView.indexPathsForSelectedRows)
setLongTapEditing(false)
})

if viewModel.hasAnyUnmutedChatSelected(in: tableView.indexPathsForSelectedRows) {
alert.addAction(UIAlertAction(title: String.localized("menu_mute"), style: .default) { [weak self] _ in
actions.append(UIAction(title: String.localized("menu_mute"), image: UIImage(systemName: "speaker.slash")) { [weak self] _ in
guard let self else { return }
MuteDialog.show(viewController: self) { [weak self] duration in
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 return a sub-menu instead maybe?

Copy link
Member Author

Choose a reason for hiding this comment

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

i also thouht about that, but the mute dialog is also available at other places, so it seems better to have the same UI everywhere

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe those other places could use the menu too? 🤔 But can be another PR, this already addresses a lot of them.

Copy link
Member Author

@r10s r10s Jan 27, 2025

Choose a reason for hiding this comment

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

hm, at least whatsapp and signal also use an actionSheet for the concrete setting. i also have rarely seen a UIMenu in response to a swipe-to-action gesture (where mute is also available)

but yes, if, then it anyway would be another pr, so this is no blocker

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah yeah I don't think swipe action is a great place for it.

Copy link
Collaborator

@zeitschlag zeitschlag left a comment

Choose a reason for hiding this comment

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

LGTM, just some UX and self-related questions/suggestions :)

Comment on lines +223 to +225
UIAction(title: String.localized("proxy_use_proxy"), image: UIImage(systemName: "shield")) { [weak self] _ in
self?.showProxySettings()
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably more of a UX-thing, but if we only have one entry a menu, does it make a lot of sense to show that menu -- and not the menu-entry itself? In other words: Why does the BarButtonItem show a menu and not the Proxy-button?

It feels like an extra step for the user to access the proxy-settings.

Copy link
Member Author

Choose a reason for hiding this comment

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

but if we only have one entry a menu, does it make a lot of sense to show that menu

yes - as the symbol is not self-explaining for most users. therefore, an additional descriptive text is better.

when proxy is then enabled, the icon is shown directly - this is also what is done in the main app.

@r10s r10s merged commit 42f6ff8 into main Jan 28, 2025
2 checks passed
@r10s r10s deleted the r10s/more-modern-menus branch January 28, 2025 11:35
@r10s
Copy link
Member Author

r10s commented Jan 28, 2025

thanks for review, @zeitschlag and @Amzd ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement actually in development, user visible enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants