Skip to content

feat(explorer): add link for id type field#161

Open
KeitoTadashi wants to merge 12 commits intodevelopfrom
tooling-explorer/add-link-id-type-field
Open

feat(explorer): add link for id type field#161
KeitoTadashi wants to merge 12 commits intodevelopfrom
tooling-explorer/add-link-id-type-field

Conversation

@KeitoTadashi
Copy link
Copy Markdown
Contributor

@KeitoTadashi KeitoTadashi commented Apr 24, 2026

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.

@KeitoTadashi KeitoTadashi requested a review from a team as a code owner April 24, 2026 13:08
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
iota-evm-bridge Ready Ready Preview, Comment Apr 30, 2026 0:32am
iota-multisig-toolkit Ready Ready Preview, Comment Apr 30, 2026 0:32am
iota-names Ready Ready Preview, Comment Apr 30, 2026 0:32am
rebased-explorer Ready Ready Preview, Comment Apr 30, 2026 0:32am
wallet-dashboard Ready Ready Preview Apr 30, 2026 0:32am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
apps-ui-kit Ignored Ignored Preview Apr 30, 2026 0:32am

Request Review

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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we simplify this condition? Looks very complicated imo

@vercel vercel Bot temporarily deployed to Preview – iota-multisig-toolkit April 27, 2026 09:40 Inactive
@vercel vercel Bot temporarily deployed to Preview – iota-names April 27, 2026 09:40 Inactive
@vercel vercel Bot temporarily deployed to Preview – iota-evm-bridge April 27, 2026 09:40 Inactive
@vercel vercel Bot temporarily deployed to Preview – wallet-dashboard April 27, 2026 09:40 Inactive
@vercel vercel Bot temporarily deployed to Preview – iota-multisig-toolkit April 27, 2026 09:52 Inactive
@vercel vercel Bot temporarily deployed to Preview – iota-names April 27, 2026 09:52 Inactive
@vercel vercel Bot temporarily deployed to Preview – wallet-dashboard April 27, 2026 09:52 Inactive
@vercel vercel Bot temporarily deployed to Preview – iota-evm-bridge April 27, 2026 09:52 Inactive
@vercel vercel Bot temporarily deployed to Preview – iota-evm-bridge April 27, 2026 10:06 Inactive
@vercel vercel Bot temporarily deployed to Preview – iota-names April 27, 2026 10:06 Inactive
@vercel vercel Bot temporarily deployed to Preview – iota-multisig-toolkit April 27, 2026 10:06 Inactive
@vercel vercel Bot temporarily deployed to Preview – wallet-dashboard April 27, 2026 10:06 Inactive
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>
);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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>
        );
    }
}

@vercel vercel Bot temporarily deployed to Preview – iota-evm-bridge April 27, 2026 13:43 Inactive
@vercel vercel Bot temporarily deployed to Preview – wallet-dashboard April 27, 2026 13:43 Inactive
@vercel vercel Bot temporarily deployed to Preview – iota-multisig-toolkit April 27, 2026 13:43 Inactive
Copy link
Copy Markdown
Contributor

@brancoder brancoder left a comment

Choose a reason for hiding this comment

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

LGTM

}
}

// for object types, use SyntaxHighlighter
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Unneeded comment, it's pretty self explanatory

Copy link
Copy Markdown
Contributor Author

@KeitoTadashi KeitoTadashi Apr 28, 2026

Choose a reason for hiding this comment

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

that comment was there before, i just moved the whole block

https://github.com/iotaledger/ts-packages/pull/161/changes#diff-fb87d7fed956988741a075f674a60a0ac4a0fc543766795f053bfea5aa50acb1L27

but i can remove it if you want

@vercel vercel Bot temporarily deployed to Preview – iota-evm-bridge April 28, 2026 08:19 Inactive
@vercel vercel Bot temporarily deployed to Preview – iota-multisig-toolkit April 28, 2026 08:19 Inactive
@vercel vercel Bot temporarily deployed to Preview – wallet-dashboard April 28, 2026 08:19 Inactive
@vercel vercel Bot temporarily deployed to Preview – iota-names April 28, 2026 08:19 Inactive
@msarcev
Copy link
Copy Markdown
Collaborator

msarcev commented Apr 28, 2026

@begonaalvarezd do we really want this? its just a link to self... you are in the object already
i think we can close issue and this PR, but if anyone think this is good let's merge

Should we make it so that self-referencing IDs are not rendered ? Only links to other objects.

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.

[Explorer] Add a link for ID type fields

4 participants