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

Room list room summary cleanup #2273

Merged
merged 10 commits into from
Jan 22, 2024
Merged

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Jan 22, 2024

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other : cleanup codebase

Content

Following #2130, there were more cleanup to do.

Motivation and context

Be ready for #2265 to (be rebased and) land properly.

Screenshots / GIFs

Tests

  • Nothing should be broken.

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

@bmarty bmarty requested a review from a team as a code owner January 22, 2024 11:17
@bmarty bmarty requested review from jmartinesp and removed request for a team January 22, 2024 11:17
Copy link
Member Author

Choose a reason for hiding this comment

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

id has changed, and so the avatar color.

Copy link
Member Author

Choose a reason for hiding this comment

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

no timestamp if no message.

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine with not displaying the timestamp if there's no last message, but DefaultLastMessageFormatter has a CharSequence? return type that could return null even if there is a last message formatted, so you'd see the room item at the top of the list when it's updated, but you wouldn't see a timestamp if I'm not mistaken, which would look weird.

Could we change this return type to CharSequence and make sure we always return a String, even an empty one, if there is a last message for the room? So if there is a last event we always return something (maybe empty, but something) and if there really is nothing we return null.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm fine with not displaying the timestamp if there's no last message

I did not change any logic in the existing codebase, just wanted to have more coherent previews. But you're right, since DefaultLastMessageFormatter can return null, we can have a room list item with no message and a timestamp. So the previous screenshot may reflect something that can happen.

if we want to change this, it should be done in a separate PR, as this one is only rework with no logical change.

Copy link
Contributor

github-actions bot commented Jan 22, 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/Jcn9An

Copy link

codecov bot commented Jan 22, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (c3538e5) 70.04% compared to head (bbd8710) 70.05%.

Files Patch % Lines
...res/roomlist/impl/datasource/RoomListDataSource.kt 50.00% 0 Missing and 2 partials ⚠️
...list/impl/datasource/RoomListRoomSummaryFactory.kt 94.73% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2273      +/-   ##
===========================================
+ Coverage    70.04%   70.05%   +0.01%     
===========================================
  Files         1335     1335              
  Lines        32674    32684      +10     
  Branches      6792     6793       +1     
===========================================
+ Hits         22885    22896      +11     
  Misses        6512     6512              
+ Partials      3277     3276       -1     

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

Use `?.let {}` instead of if/else with a null block when checking for nullable values [UseLet]
Copy link

sonarcloud bot commented Jan 22, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Member

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

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

LGTM if the CI passes.

@bmarty bmarty added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jan 22, 2024
@bmarty bmarty enabled auto-merge January 22, 2024 13:46
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jan 22, 2024
@bmarty bmarty merged commit bee56c8 into develop Jan 22, 2024
18 checks passed
@bmarty bmarty deleted the feature/bma/roomListRoomSummaryCleanup branch January 22, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants