-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[APP-1049] show label expiration in frontend #7738
[APP-1049] show label expiration in frontend #7738
Conversation
let source = labeler | ||
? sanitizeHandle(labeler.creator.handle, '@') | ||
: undefined | ||
let sourceDisplayName = labeler?.creator.displayName | ||
if (!source) { | ||
if (cause.label.src === BSKY_LABELER_DID) { | ||
source = 'Bluesky Moderation Service' | ||
source = 'moderation.bsky.app' | ||
sourceDisplayName = 'Bluesky Moderation Service' | ||
} else { | ||
source = cause.label.src | ||
source = _(msg`an unknown labeler`) | ||
} |
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.
Now prioritizes the handle over the display name
const sourceName = | ||
desc.source || desc.sourceDisplayName || _(msg`an unknown labeler`) |
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.
Source will always be defined based on the logic in useModerationCauseDescription
, but did this for completeness
|
7aeb225
to
14fe841
Compare
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.
lgtm! one nit on visual alignment
. | ||
</Trans> | ||
</Text> | ||
<View style={[a.flex_row, a.justify_between, a.gap_xl]}> |
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.
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.
Yeah common problem with aligning text: it's aligned to the line-height, basically the capital letters. Aligning to the x-height isn't a good option either because then capitals look off too, but we can pry fudge it with a number in between that makes it feel a little better.
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.
Yeah anything more than 1px starts to look wrong to me, esp when there's not exp shown and it's just Source: ...
. Copied this fix to LabelsOnMe
as well since it's the same treatment there.
Show's label expiration (if set) on labels, for both the labeled user and viewers.
I also opted to align the UI a bit here from where it was, since I think the
LabelsOnMe
dialog treatment is more attractive and succinct, and works well for the expiry handling.Also,
useGetTimeAgo
is really just a date diff, so tbh we could rename that to make it more obvious that it can be used for future dates too.We should really build a real tooltip too for web hovers e.g. to show the precise expiry on hover.