Conversation
Summary of ChangesHello @ThatOneCalculator, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the user experience by adding a subtle haptic confirmation when a new post is successfully created. This tactile feedback provides an immediate and intuitive response to the user's action, making the interaction feel more complete and engaging. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This is a nice, small change that improves the user experience by adding haptic feedback. The implementation is correct, but it introduces some code duplication between TopAppBarFab and ComposePostFab. I've left a couple of comments with suggestions on how to refactor this to improve maintainability. Overall, good work!
| onClick = onClick@{ | ||
| state.createPostAction()?.let(onCreatePost) | ||
| state.createPostAction()?.let { | ||
| haptic.performHapticFeedback(HapticFeedbackType.Confirm) | ||
| onCreatePost(it) | ||
| } | ||
| }, |
There was a problem hiding this comment.
This onClick logic, along with getting the haptic instance on line 49, is duplicated in ComposePostFab. To avoid code duplication and improve maintainability, consider extracting this logic to a common helper function.
Since LocalHapticFeedback.current is a composable call, you could create a private composable function that returns a decorated onClick lambda. For example:
@Composable
private fun rememberHapticClickHandler(action: () -> Unit): () -> Unit {
val haptic = LocalHapticFeedback.current
return {
haptic.performHapticFeedback(HapticFeedbackType.Confirm)
action()
}
}This could then be used in both TopAppBarFab and ComposePostFab to wrap the post creation logic.
There was a problem hiding this comment.
I think this should be opt in, most apps of this sort don't have haptics for like actions.
There was a problem hiding this comment.
Bluesky sort of does (strangely, when you click the compose fab initially, instead of when you post), but I think that haptics like this are good for accessibility and general UX since it's physical confirmation of a successfully completed action -- I think making this optional is totally fine, but my vote would be for it to be on by default rather than off by default :)
Very small change that adds a confirmation haptic when making a post :)