Skip to content

Conversation

@csillag
Copy link
Contributor

@csillag csillag commented Jul 30, 2025

Small adjustments in AddressLink CSS.

Before After
Transfer events squeezed small image image
Minting event image image

Improves #2096.

@github-actions
Copy link

github-actions bot commented Jul 30, 2025

Deployed to Cloudflare Pages

Latest commit: 833be736a02a2f76c1bcff6f6fd4d6e3a3a76b0c
Status:✅ Deploy successful!
Preview URL: https://5efff065.oasis-explorer.pages.dev
Alias: https://pr-2107.oasis-explorer.pages.dev

@csillag csillag force-pushed the csillag/address-formatting-fixes branch 2 times, most recently from 7e9fd31 to 4f55839 Compare July 30, 2025 13:12
@csillag csillag marked this pull request as ready for review July 30, 2025 13:12
@csillag csillag self-assigned this Jul 30, 2025
Comment on lines 171 to 176
<Box
component="span"
sx={{ display: 'inline-flex', alignItems: 'center', gap: 3, flexWrap: 'wrap' }}
>
<AccountMetadataSourceIndicator source={accountMetadata!.source} />
<HighlightedText text={accountName} pattern={highlightPattern} /> ({address})
Copy link
Member

Choose a reason for hiding this comment

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

This code worked before #2072. What changed in #2072?
This is now fixing it differently so I'm concerned something else will break.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Short version: #2072 didn't create the error, just exposed it by triggering it accidentally. Now I fix both the original problem and the accidental trigger.

Here is the full history.

  • There was a error in AdaptivelyTrimmedAccountLink: under specific conditions (if there is sufficient width to show both account name and address at the same line), it rendered ugly content.
  • However, this error was not triggered very often, because AdaptivelyTrimmedAccountLink was only used when we were short on space.
  • However, in Further enhance ROFL app endorsement display #2072, when introducing an option for always enabling the adaptive trimmer in AccountLink (even if we are on desktop and have lots of space), I have introduced an error by checking the wrong variable in a condition. (I meant to check the new option, alwaysAdapt, but I accidentally wrote alwaysTrimOnTablet.) This resulted in accidentally using AdaptivelyTrimmedAccountLink in unintended situations, including situations with lots of available width, therefore triggering this pre-existing, but previously hidden error.
  • This PR fixes the condition (for selecting the right kind of link), plus it improves both AdaptivelyTrimmedAccountLink and DesktopAccountLink to better handle wrapping / non-wrapping situations, thereby eliminating the original error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so I'm concerned something else will break.

That's not an unreasonable assumption; that is why I did manual testing by slowly changing the width and checking the behavior on multiple pages. I don't see anything broken.

Copy link
Member

Choose a reason for hiding this comment

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

ohh that makes sense

@csillag csillag force-pushed the csillag/address-formatting-fixes branch 2 times, most recently from dde4d93 to ffaebb2 Compare July 31, 2025 00:10
csillag added 4 commits July 31, 2025 02:18
- If we show both account name and address,
  put the addressin parenthesis.
- Properly align name and address side by side
- More consistent wrapping and gap setting
- Fix reference to wrong variable name, which messed
  up the table/desktop selection in some situations
@csillag csillag force-pushed the csillag/address-formatting-fixes branch from ffaebb2 to 833be73 Compare July 31, 2025 00:19
@csillag csillag merged commit 3cb5c3e into master Jul 31, 2025
9 checks passed
@csillag csillag deleted the csillag/address-formatting-fixes branch July 31, 2025 06:20
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.

3 participants