feat(explorer): add link for id type field#161
Open
KeitoTadashi wants to merge 12 commits intodevelopfrom
Open
feat(explorer): add link for id type field#161KeitoTadashi wants to merge 12 commits intodevelopfrom
KeitoTadashi wants to merge 12 commits intodevelopfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Comment on lines
+44
to
+52
| const obj = value as Record<string, unknown>; | ||
| const objectId = | ||
| typeof value === 'string' | ||
| ? value | ||
| : typeof obj.id === 'string' | ||
| ? obj.id | ||
| : typeof obj.bytes === 'string' | ||
| ? obj.bytes | ||
| : null; |
Contributor
There was a problem hiding this comment.
Could we simplify this condition? Looks very complicated imo
brancoder
requested changes
Apr 27, 2026
Comment on lines
41
to
48
| if (TYPE_OBJECT_ID.includes(normalizedType as string)) { | ||
| const objectId = typeof value === 'string' ? value : (value as Record<string, string>).id; | ||
| return ( | ||
| <div className="break-all"> | ||
| <ObjectLink | ||
| objectId={value.toString()} | ||
| noTruncate={!truncate} | ||
| copyText={value.toString()} | ||
| /> | ||
| <ObjectLink objectId={objectId} noTruncate={!truncate} copyText={objectId} /> | ||
| </div> | ||
| ); | ||
| } |
Contributor
There was a problem hiding this comment.
we could add some guards and checks here ex.
if (typeof normalizedType === 'string' && TYPE_OBJECT_ID.includes(normalizedType)) {
const objectId =
typeof value === 'string' ? value : (value as Record<string, string>).id ?? null;
if (objectId) {
return (
<div className="break-all">
<ObjectLink objectId={objectId} noTruncate={!truncate} copyText={objectId} />
</div>
);
}
}
msarcev
reviewed
Apr 28, 2026
| } | ||
| } | ||
|
|
||
| // for object types, use SyntaxHighlighter |
Collaborator
There was a problem hiding this comment.
Unneeded comment, it's pretty self explanatory
Contributor
Author
There was a problem hiding this comment.
that comment was there before, i just moved the whole block
but i can remove it if you want
Collaborator
Should we make it so that self-referencing IDs are not rendered ? Only links to other objects. |
panteleymonchuk
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of change
It would be beneficial for the user experience to also provide a link for "ID" type fields, in order to navigate directly to the object in question.
Links to any relevant issues
fixes #128
How the change has been tested
Describe the tests that you ran to verify your changes.
Make sure to provide instructions for the maintainer as well as any relevant configurations.