Skip to content

Fix separator handling in rendered values - #55

Merged
manuelwedler merged 3 commits into
sourcifyeth:mainfrom
shukudaidayo:fix-separator-render-values
Jul 29, 2026
Merged

Fix separator handling in rendered values#55
manuelwedler merged 3 commits into
sourcifyeth:mainfrom
shukudaidayo:fix-separator-render-values

Conversation

@shukudaidayo

Copy link
Copy Markdown
Contributor

Summary

  • Keep separator text out of rendered field values
  • Keep separator text out of interpolatedIntent substitutions
  • Update separator fixtures to expect semantic field values only

Context

This was surfaced while testing the Ocarina ERC-7730 registry submission: ethereum/clear-signing-erc7730-registry#2598.

That descriptor uses array item separators such as:

"separator": "Tip {index}"

The separator is useful presentation context for array items, but it should not become part of the rendered field value itself. Before this change, Sourcify could render an interpolated intent like:

Authorize Tip 0 1 USDC tip

instead of:

Authorize 1 USDC tip

Details

DisplayField.value now contains only the formatted field value, and the renderedValues interpolation map stores the same clean value.

This keeps separator handling out of semantic values while preserving the descriptor’s field formatting behavior. If wallets want to expose separator text as presentation metadata, that can be added separately without contaminating value.

Validation

  • npm test
  • npm run check:types
  • npm run check:eslint
  • npm run check:prettier

@manuelwedler manuelwedler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This completely removes the use of separator and not displays the separator anymore. I see the point that it might not be best to put it in value, but where do you think should the separator go else?

From ERC-7730:

Each element of the array is formatted using the provided formatter, and the separator value is displayed before each element.

@shukudaidayo

Copy link
Copy Markdown
Contributor Author

My understanding is that separator is optional presentation context for array items, so one possible output shape would be:

{
  label: "Tip amount",
  value: "1 USDC",
  separator: "Tip 0"
}

This would let wallets display the computed separator before each array element, while keeping value clean for tests and interpolation.

If you'd like, I'd be happy to update this PR accordingly, or add it as a separate PR.

@manuelwedler
manuelwedler merged commit c76eb5a into sourcifyeth:main Jul 29, 2026
2 checks passed
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