-
Notifications
You must be signed in to change notification settings - Fork 27
Make the top views of the QE be reused by the scopes #615
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
Conversation
0fe1e08
to
38b526a
Compare
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 refactors the editor UI to consolidate shared views into a new QuickEditor composable and moves profile fetching logic into QuickEditorViewModel.
- Introduces QuickEditorViewModel and QuickEditor composable for shared header UI.
- Removes redundant profile-related state and clock-based cache busting from AvatarPicker and its tests.
- Adjusts layout, such as repositioning the alert banner, to consolidate the editor scopes.
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
QuickEditorViewModelTest.kt | Tests updated for QuickEditorViewModel profile fetching and avatar cache refresh. |
QuickEditorTest.kt | Screenshot tests verify unchanged UI appearance except for alert banner placement. |
AvatarPickerViewModelTest.kt | Removes profile fetching tests and avatarCacheBuster expectations consistent with separation of concerns. |
AvatarPickerTest.kt | Removes profile-related properties in preview, reflecting new design. |
QuickEditorViewModel.kt, QuickEditorUiState.kt, QuickEditorEvent.kt, QuickEditor.kt | New implementation for the consolidated QuickEditor component and its supporting ViewModel, state and events. |
GravatarQuickEditorPage.kt | Updates navigation graph to use QuickEditor instead of AvatarPicker for the editor graph. |
AvatarPickerViewModel.kt, AvatarPickerUiState.kt, AvatarPicker.kt | Adjustments to remove outdated profile handling and clock updates in the AvatarPicker portion. |
Comments suppressed due to low confidence (1)
gravatar-quickeditor/src/main/java/com/gravatar/quickeditor/ui/editor/GravatarQuickEditorPage.kt:158
- The insertion of "it.viewModelStore" appears out-of-place and does not seem to be used in a meaningful way. Please verify whether this was intended or remove it if unnecessary.
it.viewModelStore
38b526a
to
36640b6
Compare
📲 You can test the changes from this Pull Request in Gravatar Demo by scanning the QR code below to install the corresponding build.
|
36640b6
to
2dc72c5
Compare
internal fun QuickEditor( | ||
gravatarQuickEditorParams: GravatarQuickEditorParams, | ||
handleExpiredSession: Boolean, | ||
onAvatarSelected: () -> Unit, |
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.
One thing we decided to do on iOS is to have a general update()
callback (we call it updateHandler()
, and it has a parameter with the information of which kind of update it is.
Maybe is not needed yet but it will possible become handy when we start to implement the About Info editor.
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.
Thanks! The API design is yet to be decided on, so I will definitely look at iOS.
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.
Looks good 👍
All manual testing steps passed 🟢
One comment on code, though not a blocker.
…tion That the component that will also be responsible for the Profile card - displaying the user info, refreshing and showing possible navigation options
f97dfb6
to
d8d050c
Compare
ed14233
into
feature/quick_editor_about_info
Description
This PR adds
QuickEditor
composable component that will host the shared UI (top bar, email, and the profile card) and different editor scopes ascontent
that will be added in the next PRs.Some of the logic from the
AvatarPickerViewModel
was now moved to the newQuickEditorViewModel
as the profile fetching will only happen there (plus some extra logic to force refresh the avatar).Additionally, the alert banner that's shown the no avatar is selected was moved below the profile card, so that it stays in the avatar picker content space. Apart from this, there should be no UI change.
Testing Steps
As mentioned above, the UI should be unchanged (except for the alert banner position) but there are a few things worth testing:
Avatar updates in the profile card
Make sure the avatar is properly updated after each of the below:
Refreshing after network failure