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

Add missing device id to settings screen #2320

Merged
merged 7 commits into from
Jan 31, 2024

Conversation

jmartinesp
Copy link
Member

@jmartinesp jmartinesp commented Jan 30, 2024

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

  • Add the device id to the settings screen footer.
  • Extract the footer to its own composable.
  • Restore @PreviewWithLargeHeight behaviour so we can actually see the changes in the screenshot tests.

Motivation and context

Fixes #2316 .

Screenshots / GIFs

Funnily enough, we should have screenshot changes due to this change, but as the screenshot only contains the top part of the screen, the changes are not visible ¯\(ツ)/¯.

Tests

  • Open the settings screen.

Tested devices

  • Physical
  • Emulator
  • OS version(s): 14.

Checklist

@jmartinesp jmartinesp requested a review from a team as a code owner January 30, 2024 12:34
@jmartinesp jmartinesp requested review from ganfra and removed request for a team January 30, 2024 12:34
Copy link
Contributor

github-actions bot commented Jan 30, 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/L34fPG

Copy link

codecov bot commented Jan 30, 2024

Codecov Report

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

Comparison is base (0f5038a) 70.05% compared to head (d2f8419) 70.06%.
Report is 5 commits behind head on develop.

Files Patch % Lines
...tures/preferences/impl/root/PreferencesRootView.kt 75.00% 1 Missing and 4 partials ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2320   +/-   ##
========================================
  Coverage    70.05%   70.06%           
========================================
  Files         1353     1353           
  Lines        33233    33249   +16     
  Branches      6872     6876    +4     
========================================
+ Hits         23283    23295   +12     
- Misses        6641     6642    +1     
- Partials      3309     3312    +3     

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

@@ -62,6 +65,10 @@ class PreferencesRootPresenter @Inject constructor(
initialLoad(matrixUser)
}

val deviceId by produceState<String?>(initialValue = null) {
value = sessionStore.getSession(matrixClient.sessionId.value)?.deviceId
Copy link
Member

Choose a reason for hiding this comment

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

I would probably expose the deviceId from the MatrixClient, as a String, this would be simpler.

@bmarty
Copy link
Member

bmarty commented Jan 30, 2024

Funnily enough, we should have screenshot changes due to this change, but as the screenshot only contains the top part of the screen, the changes are not visible ¯_(ツ)_/¯.

We could use @PreviewWithLargeHeight for this screen?

@jmartinesp
Copy link
Member Author

We could use @PreviewWithLargeHeight for this screen?

I can give it a try, but I remember it causing issues in the past so we stopped using it. Maybe those have been fixed in latest Paparazzi versions.

@jmartinesp jmartinesp added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Jan 31, 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 Jan 31, 2024
@jmartinesp
Copy link
Member Author

It's actually using @PreviewWithLargeHeight, but we removed the code that made this work in the Paparazzi tests, so it behaves as a normal @Preview. I tried restoring the logic, it works locally. Let's see how it behaves in the CI.

@@ -64,6 +64,7 @@ class RustMatrixClientFactory @Inject constructor(
baseDirectory = baseDirectory,
baseCacheDirectory = cacheDirectory,
clock = clock,
deviceId = sessionData.deviceId,
Copy link
Member

Choose a reason for hiding this comment

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

I would not add a constructor param here, but read the value from client.deviceId() to simplify even more (like it's done for sessionId). Sorry if my first comment was not clear. Or there is a limitation that I don't see?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I didn't realise Client from the Rust SDK had this value. Indeed, that's a lot easier.

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems like recording worked fine! Let's see how verification goes.

Copy link
Member Author

Choose a reason for hiding this comment

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

It worked too 🎉

Copy link

sonarcloud bot commented Jan 31, 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

@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.

Thanks for also fixing the recording for preview with large height! Awesome!

Copy link
Member

Choose a reason for hiding this comment

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

It looks like this preview does not need to have the @PreviewWithLargeHeight, it's probably because of a copy paste from RoomDetailsView (which needs it). We may want to change that in another PR... or now. We may also want to keep it, for future need. We will have more action on this screen like "Verify user", "Jump to Read Receipt", etc.

@jmartinesp jmartinesp added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jan 31, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jan 31, 2024
@jmartinesp jmartinesp enabled auto-merge (squash) January 31, 2024 09:43
@jmartinesp jmartinesp merged commit c2fc6db into develop Jan 31, 2024
18 checks passed
@jmartinesp jmartinesp deleted the misc/jme/2316-display-device-id-in-settings branch January 31, 2024 10:01
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.

Show device ID in settings
2 participants