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

feat(knock) : Knock Requests Banner UI #4005

Merged
merged 9 commits into from
Dec 9, 2024

Conversation

ganfra
Copy link
Member

@ganfra ganfra commented Dec 6, 2024

Content

First iteration of the knock requests banner view
No data branched.

Motivation and context

Part of #3692

Screenshots / GIFs

Tests

  • Step 1
  • Step 2
  • Step ...

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • Pull request includes a sign off
  • You've made a self review of your PR

@ganfra ganfra added PR-Wip For anything that isn't ready to ship and will be enabled at a later date Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. labels Dec 6, 2024
@github-actions github-actions bot removed the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Dec 6, 2024
@ganfra ganfra marked this pull request as ready for review December 6, 2024 16:29
@ganfra ganfra requested a review from a team as a code owner December 6, 2024 16:29
@ganfra ganfra requested review from bmarty and removed request for a team December 6, 2024 16:29
Copy link
Contributor

github-actions bot commented Dec 6, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/pfYTgY

@ganfra ganfra force-pushed the feature/fga/requests_to_join_banner branch from e17713f to 603deb7 Compare December 6, 2024 16:53
@ganfra ganfra added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Dec 6, 2024
@github-actions github-actions bot removed the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Dec 6, 2024
Copy link

codecov bot commented Dec 6, 2024

Codecov Report

Attention: Patch coverage is 85.84906% with 30 lines in your changes missing coverage. Please review.

Project coverage is 83.08%. Comparing base (eae73ac) to head (364a374).
Report is 16 commits behind head on develop.

Files with missing lines Patch % Lines
...quests/impl/banner/KnockRequestsBannerPresenter.kt 0.00% 13 Missing ⚠️
.../impl/banner/DefaultKnockRequestsBannerRenderer.kt 0.00% 6 Missing ⚠️
...ockrequests/impl/banner/KnockRequestsBannerView.kt 94.49% 4 Missing and 2 partials ⚠️
...krequests/impl/banner/KnockRequestsBannerEvents.kt 0.00% 2 Missing ⚠️
...ckrequests/impl/banner/KnockRequestsBannerState.kt 89.47% 1 Missing and 1 partial ⚠️
...ent/android/features/messages/impl/MessagesView.kt 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           develop    #4005    +/-   ##
=========================================
  Coverage    83.07%   83.08%            
=========================================
  Files         1815     1821     +6     
  Lines        46248    46434   +186     
  Branches      5429     5440    +11     
=========================================
+ Hits         38421    38578   +157     
- Misses        5920     5946    +26     
- Partials      1907     1910     +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

A few remarks, else LGTM

class KnockRequestsBannerPresenter @Inject constructor() : Presenter<KnockRequestsBannerState> {
@Composable
override fun present(): KnockRequestsBannerState {
var shouldShowBanner by remember { mutableStateOf(false) }
Copy link
Member

Choose a reason for hiding this comment

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

The banner will be shown at each app starts? Or will the app will store the decision to hide the banner in a later PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

Will be stored by the sdk actually!

null
}

val reason = if (knockRequests.size == 1) {
Copy link
Member

Choose a reason for hiding this comment

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

Could be nice to have a firstIfSingleton extension.

)
if (state.canAccept) {
Button(
text = "Accept",
Copy link
Member

Choose a reason for hiding this comment

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

Use stringResource please (several changes to do in this place)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ooops, yeah forgot some strings

if (state.canAccept) {
Button(
text = "Accept",
onClick = {},
Copy link
Member

Choose a reason for hiding this comment

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

Can be done later, but maybe prepare the lambda for the onClick action.

Copy link
Member

Choose a reason for hiding this comment

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

Show a loading wheel and disable the button here? (Loading state)

Copy link
Member Author

Choose a reason for hiding this comment

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

The banner will be dismissed directly in this case, I'm waiting to branch the logic

@ganfra ganfra enabled auto-merge December 9, 2024 10:18
@ganfra ganfra added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Dec 9, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Dec 9, 2024
Copy link

sonarqubecloud bot commented Dec 9, 2024

@ganfra ganfra merged commit 9dac27a into develop Dec 9, 2024
30 checks passed
@ganfra ganfra deleted the feature/fga/requests_to_join_banner branch December 9, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Wip For anything that isn't ready to ship and will be enabled at a later date
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants