Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[JetChat] Add glance widget for JetChat App #1424 #1425
base: main
Are you sure you want to change the base?
[JetChat] Add glance widget for JetChat App #1424 #1425
Changes from all commits
e5d2904
09fe44f
78716ea
6c54e0c
7982007
ed13f9a
25e745f
27929da
f9fc151
8321785
b532df8
5f6382f
a97068c
f3ff8c4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Instead of showing the error only when user clicks the button, can we prevent showing the drawer item at all?
Maybe you can abstract the method to something like
widgetAddingIsSupported()
that uses the SDK check and uses theisRequestPinAppWidgetSupported
and check for that before showing the UI.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 suggest instead of adding bunch of copy pastes, to use something like the
initialMessages
and filter it for the unread messages. Maybe filter the ones not from the current author?val unreadMessages = initialMessages.filter { it.author != "me" }
If you don't have enough messages, you can add more (meaningful-ish) messages to the
initialMessages
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.
You have a widget error layout but do not use it. Consider referencing it here with the errorUiLayout property or implementing onCompositionError
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.
unreadMessages
should be hoisted and passed into MessagesWidget from provideGlance.Usually in a Glance Widget you will pass to your widget a repository and the widget can access flows in the composable function. Even though this is fakeData we should try to keep as much as possible to this pattern.
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.
add
color = GlanceTheme.colors.onSurface
to the TextStyle. This will make the colors update when you switch to dark mode.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'm not a fan of us not being able to format the text in any form. Showing the unformatted font looks unstyled :(
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.
add color = GlanceTheme.colors.onSurface to the TextStyle. This will make the colors update when you switch to dark mode.
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.
Try not to use direct colors, but use the tokens from the Theme
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.
where is this used? 🤔
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.