-
Notifications
You must be signed in to change notification settings - Fork 155
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
Timeline UI | MessageShield Support #3240
Conversation
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
1f0c532
to
b3b90a3
Compare
Quality Gate passedIssues Measures |
I tried this out for nothing more than sheer curiosity, and there were a couple things I noticed that were a bit weird (aside from the fact that literally every encrypted message was marked as unauthentic)
|
private fun TimelineItem.Event.shieldPosition(): MessageShieldPosition { | ||
val shield = this.messageShield ?: return MessageShieldPosition.None | ||
|
||
// sdk returns raw human readable strings, add i18n support |
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.
@jorge Could the SDK return an enum instead?
Same for the color, it should be a enum (if the first enum is not enough) with a notion of criticity. "color" is a concept for the application (UI) level.
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 think you should discuss this with @pixlwave (and not poor @jorge
😅 ).
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.
Ah yeah I fixed this… You can now switch on the ShieldState::code
which is an enum 😁
On EXI we map ShieldState
to this EncryptionAuthenticity
representation for our sanity.
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.
@bmarty For completeness here is the view we use for the timestamp with send/encryption warnings: TimelineItemSendInfoLabel
And the PRs element-hq/element-x-ios#3051, element-hq/element-x-ios#3100 and element-hq/element-x-ios#3116
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.
with a notion of criticity. "color" is a concept for the application (UI) level.
FWIW, both myself and @stefanceriu raised this here and here but the crypto team don't want to change it 🤷♂️
is MessageShield.UnverifiedIdentity -> CompoundIcons.Admin() | ||
is MessageShield.UnknownDevice, | ||
is MessageShield.UnsignedDevice -> CompoundIcons.HelpSolid() | ||
is MessageShield.SentInClear -> CompoundIcons.KeyOff() |
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.
TODO: need to check this mapping.
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.
This should be the final mapping: https://github.com/element-hq/element-x-ios/blob/cf35056c787fbae4a219e2a442738b6a84164a95/ElementX/Sources/Services/Timeline/TimelineItemContent/EncryptionAuthenticity.swift#L59-L65
(I realise now that I linked you to a bunch of PRs that iteratively changed it over time).
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. I have updated the code.
But there is no shield at all, which is against the SDK recommendation here and here.
Now I have this (from the Preview):
@BillCarsonFr can you confirm please?
Also handle click on the timeline and information displayed on long click.
711b484
to
faf1e7d
Compare
Updated, maybe need to add a feature flag as per iOS app (?) |
Tbh the only reason I've kept the iOS flag around is so we could enable this on both apps at the same time. So entirely up do you, if you don't want to add one I'll remove it from iOS when this PR is merged. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3240 +/- ##
===========================================
+ Coverage 82.56% 82.61% +0.05%
===========================================
Files 1662 1666 +4
Lines 38992 39121 +129
Branches 4724 4746 +22
===========================================
+ Hits 32193 32320 +127
+ Misses 5133 5132 -1
- Partials 1666 1669 +3 ☔ View full report in Codecov by Sentry. |
Need to add content description on the shield icon.
Quality Gate passedIssues Measures |
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.
Implementation should be equivalent to iOS, let's merge and iterate if necessary.
Fixes https://github.com/element-hq/crypto-internal/issues/345
Depends on matrix-org/matrix-rust-sdk#3679
Design: https://www.figma.com/design/2aqj9A5WRvGY3tcdTrBek4/Unencrypted-message-warning-in-Timeline?node-id=910-77038&t=pF5GGduo3EsrFG2Q-0
Content
Show E2E message shields.
Motivation and context
Screenshots / GIFs
Tests
Tested devices
Checklist