Skip to content

fix(cluster): output of cluster ls now shows the correct contract id#121

Merged
joshi4 merged 1 commit into
mainfrom
sj/fix-contracts-display
Apr 16, 2025
Merged

fix(cluster): output of cluster ls now shows the correct contract id#121
joshi4 merged 1 commit into
mainfrom
sj/fix-contracts-display

Conversation

@joshi4
Copy link
Copy Markdown
Contributor

@joshi4 joshi4 commented Apr 16, 2025

We were using Bade to show the contract id.

However, badge turns everything to upper case.

This is a problem as our contract ids are base62 encoded - where the
distinction between lower case and upper case matters.

@semanticdiff-com
Copy link
Copy Markdown

semanticdiff-com Bot commented Apr 16, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  src/lib/clusters/clusters.tsx  38% smaller

@joshi4 joshi4 requested a review from JohnPhamous April 16, 2025 18:27
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Modified the contract ID display in cluster listing to preserve case sensitivity by replacing the Badge component with Text, ensuring base62 encoded IDs are shown correctly.

  • Removed @inkjs/ui Badge component import and usage in src/lib/clusters/clusters.tsx
  • Added custom Text component styling with background color to maintain visual consistency
  • Fixed potential data corruption issue where uppercase contract IDs could cause mismatches

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment thread src/lib/clusters/clusters.tsx
@joshi4
Copy link
Copy Markdown
Contributor Author

joshi4 commented Apr 16, 2025

I thought adding the space via empty space was a hack, but turns out that's exactly how Bade is implemented.

https://github.com/vadimdemedes/ink-ui/blob/14b1145da0123a48cfc2f0ec9ff33dff0633f464/source/components/badge/badge.tsx#L29C2-L33C10

@joshi4 joshi4 force-pushed the sj/fix-contracts-display branch from 9f8bd5f to 93776e8 Compare April 16, 2025 18:28
@joshi4
Copy link
Copy Markdown
Contributor Author

joshi4 commented Apr 16, 2025

before

image

after

image

@joshi4 joshi4 requested a review from sigmachirality April 16, 2025 19:13
We were using a Badge to show the contract id.

Badges turns their text to upper case.

This is a problem as our contract ids are base62 encoded - where the
distinction between lower case and upper case matters.
@joshi4 joshi4 force-pushed the sj/fix-contracts-display branch from 93776e8 to ec8fb1e Compare April 16, 2025 20:19
@joshi4 joshi4 merged commit d3c669c into main Apr 16, 2025
1 check passed
@joshi4 joshi4 deleted the sj/fix-contracts-display branch April 16, 2025 20:25
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.

2 participants