Skip to content
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

Merged
merged 6 commits into from
Feb 18, 2025

Conversation

estrattonbailey
Copy link
Member

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.

CleanShot 2025-02-13 at 16 39 25@2x
CleanShot 2025-02-13 at 16 44 51@2x
CleanShot 2025-02-13 at 16 44 31@2x
CleanShot 2025-02-13 at 17 15 25@2x
CleanShot 2025-02-13 at 17 17 12@2x
CleanShot 2025-02-13 at 17 17 35@2x
CleanShot 2025-02-13 at 17 22 38@2x

Comment on lines +135 to 145
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`)
}
Copy link
Member Author

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

Comment on lines +133 to +134
const sourceName =
desc.source || desc.sourceDisplayName || _(msg`an unknown labeler`)
Copy link
Member Author

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

Copy link

github-actions bot commented Feb 13, 2025

Old size New size Diff
6.93 MB 6.93 MB 2.12 KB (0.03%)

Copy link
Member

@mozzius mozzius left a 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]}>
Copy link
Member

Choose a reason for hiding this comment

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

Visual alignment is a little off, would look better with +4px padding on the bottom

Screenshot 2025-02-18 at 13 19 38

Copy link
Member Author

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.

Copy link
Member Author

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.

@arcalinea arcalinea temporarily deployed to eric/app-1049-show-label-expiration-in-frontend - social-app PR #7738 February 18, 2025 15:38 — with Render Destroyed
@estrattonbailey estrattonbailey merged commit da45c42 into main Feb 18, 2025
7 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants