-
-
Notifications
You must be signed in to change notification settings - Fork 869
feat: Show tooltip for unobvious elements #2637
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
base: compose-dev
Are you sure you want to change the base?
Conversation
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 thought the contentDescription
of the icon was enough for accessibility purposes but I assume there is a good reason for it. The pattern of wrapping an IconButton
in a TooltipWrap
appears a lot. Consider making a new composable to handle it.
Agree, willco on Sunday weekends. |
# Conflicts: # app/src/main/java/app/revanced/manager/ui/component/ExceptionViewerDialog.kt
Done™️! |
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.
Pull Request Overview
This PR adds a set of reusable tooltip wrappers (TooltipWrap
, TooltipIconButton
, TooltipFloatingActionButton
, TooltipSmallFloatingActionButton
) and replaces many existing IconButton
/FAB usages across screens to display tooltips for actions without visible text.
- Introduces new tooltip components under
ui/component/tooltip
- Wraps delete, reset, back, help, search, and other icon buttons with
TooltipIconButton
- Replaces plain and haptic FABs with
TooltipFloatingActionButton
/TooltipSmallFloatingActionButton
where appropriate
Reviewed Changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
app/src/main/java/app/revanced/manager/ui/screen/settings/DownloadsSettingsScreen.kt | Wrapped delete action in TooltipIconButton |
app/src/main/java/app/revanced/manager/ui/screen/settings/AdvancedSettingsScreen.kt | Wrapped restore/reset action in TooltipIconButton |
app/src/main/java/app/revanced/manager/ui/screen/settings/AboutSettingsScreen.kt | Wrapped social icon buttons in TooltipIconButton |
app/src/main/java/app/revanced/manager/ui/screen/PatchesSelectorScreen.kt | Wrapped search, filter, back icons and FABs in tooltip wrappers |
app/src/main/java/app/revanced/manager/ui/screen/PatcherScreen.kt | Wrapped save and log export icons in TooltipIconButton |
app/src/main/java/app/revanced/manager/ui/screen/DashboardScreen.kt | Wrapped toolbar icons and FAB in tooltip wrappers |
app/src/main/java/app/revanced/manager/ui/screen/AppSelectorScreen.kt | Wrapped search icon in TooltipIconButton |
app/src/main/java/app/revanced/manager/ui/component/tooltip/TooltipWrap.kt | Added core TooltipWrap component |
app/src/main/java/app/revanced/manager/ui/component/tooltip/TooltipIconButton.kt | Added TooltipIconButton wrapper |
app/src/main/java/app/revanced/manager/ui/component/tooltip/TooltipFloatingActionButton.kt | Added TooltipFloatingActionButton wrapper |
app/src/main/java/app/revanced/manager/ui/component/tooltip/TooltipSmallFloatingActionButton.kt | Added TooltipSmallFloatingActionButton wrapper |
app/src/main/java/app/revanced/manager/ui/component/settings/IntegerItem.kt | Wrapped edit icon in TooltipIconButton |
app/src/main/java/app/revanced/manager/ui/component/patches/OptionFields.kt | Wrapped option editor icons in TooltipIconButton |
app/src/main/java/app/revanced/manager/ui/component/haptics/HapticSmallFloatingActionButton.kt | Introduced haptic small FAB (unchanged) |
app/src/main/java/app/revanced/manager/ui/component/bundle/ImportBundleDialog.kt | Added TODO around potential tooltip wrapping |
app/src/main/java/app/revanced/manager/ui/component/bundle/BundleTopBar.kt | Wrapped back icon in TooltipIconButton |
app/src/main/java/app/revanced/manager/ui/component/bundle/BundleInformationDialog.kt | Wrapped delete/update icons in TooltipIconButton |
app/src/main/java/app/revanced/manager/ui/component/SearchView.kt | Wrapped back icon in TooltipIconButton |
app/src/main/java/app/revanced/manager/ui/component/PasswordField.kt | Wrapped visibility toggle in TooltipIconButton |
app/src/main/java/app/revanced/manager/ui/component/NotificationCard.kt | Wrapped dismiss icon in TooltipIconButton |
app/src/main/java/app/revanced/manager/ui/component/ExceptionViewerDialog.kt | Wrapped share icon in TooltipIconButton |
app/src/main/java/app/revanced/manager/ui/component/ArrowButton.kt | Wrapped arrow toggle in TooltipIconButton |
app/src/main/java/app/revanced/manager/ui/component/AppScaffold.kt | Wrapped back icon in TooltipIconButton |
Comments suppressed due to low confidence (1)
app/src/main/java/app/revanced/manager/ui/component/tooltip/TooltipWrap.kt:1
- [nitpick] The new tooltip components introduce interactive UI behavior and haptic feedback but don’t appear to have any corresponding tests. Consider adding unit or integration tests to verify tooltip visibility and haptic feedback on long press.
package app.revanced.manager.ui.component.tooltip
app/src/main/java/app/revanced/manager/ui/screen/PatchesSelectorScreen.kt
Outdated
Show resolved
Hide resolved
) { | ||
IconButton( | ||
onClick = onClick, | ||
modifier = modifier, |
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.
[nitpick] The modifier
is applied to both TooltipWrap
and the inner IconButton
, leading to duplicate modifications in layout or behavior. Consider applying the modifier only to the outer wrapper and using the default Modifier
for the inner IconButton
.
modifier = modifier, |
Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <[email protected]>
content: @Composable (() -> Unit), | ||
) { | ||
TooltipWrap( | ||
modifier = modifier, |
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.
If you need to pass modifiers to TooltipWrap
, use a separate parameter, otherwise remove it. This also applies for the other components.
@@ -69,7 +69,11 @@ fun AppTopBar( | |||
scrollBehavior = scrollBehavior, | |||
navigationIcon = { | |||
if (onBackClick != null) { | |||
IconButton(onClick = onBackClick) { | |||
TooltipIconButton( | |||
modifier = Modifier, |
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.
Explicitly passing empty Modifier
s is unnecessary since the parameter should be set by default. Please remove these throughout the codebase.
Add TooltipWrap to well... wrap a composable component using TooltipBox.
Extended FAB aren't wrapped because they have text shown in the button.
Icon Button, Small FAB and regular FAB are wrapped because they do not have text shown.
partially fix - #2555