fix: fall back to wasm hash in contract history when unpublished - #62
Merged
Conversation
A contract's version history (/v1/contracts/{name}) includes every
on-chain wasm transition, not just published ones — wasm_name/
wasm_version/wasm_channel are null for transitions that never resolved
to a published wasm (e.g. predate the registry, or were never
published). The Contract History list assumed these were always
present and linked every entry to /wasms/{name}/v/{version}, which
broke (or rendered nothing useful) for contracts with unpublished
history — see stellar-registry/tansu on testnet.
Minimal-surface fix on the UI side only: when a version entry has no
published wasm_name, render its wasm_hash as plain text instead of a
link. Entries that do resolve to a published wasm keep linking to the
registry wasm page as before.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BFkp8Uduc8SWRMmeUS9c1E
pselle
force-pushed
the
fix/contract-history-hash-fallback
branch
from
September 8, 2026 15:11
78a059f to
ed058c6
Compare
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
registry-ui | 6925b0c | Sep 08 2026, 05:23 PM |
Long wasm hashes (or the fallback labels) could wrap the version list onto multiple lines per entry. Truncate each row with an ellipsis and expose the full '<index>: <label> <kind>' text via the title attribute so it's still available on hover. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BFkp8Uduc8SWRMmeUS9c1E
DetailFields is a grid item under .layout's grid-template-columns: 1fr 13rem. Grid items default to min-width: auto, sizing to their content's min-content width — the new white-space: nowrap on history rows made that min-content width the full unwrapped line, forcing the 1fr track (and the page) wider than the viewport rather than actually truncating. min-width: 0 lets the item shrink below that, so the history rows' overflow: hidden + text-overflow: ellipsis clips at the column's real width instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BFkp8Uduc8SWRMmeUS9c1E
The whole row (index + hash/label + kind) shared one nowrap+ellipsis block, so a long hash consumed the entire truncation budget and cut off 'initial'/'upgrade' entirely — the one part of the row that's always short and worth keeping visible. Split each row into a flex layout: the variable-length label (index + hash or wasm name/version) truncates on its own, while kind sits in a flex-shrink: 0 slot that's never squeezed out. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BFkp8Uduc8SWRMmeUS9c1E
The '(latest)' marker was a ::after on li:first-child in the shared detail-field.module.css — fine when the li's content was inline text, but the previous commit made that content a block-level flex div, so the generated text had nowhere to go but its own line below it. Render '(latest)' as a normal flex-shrink: 0 child of .historyRow instead, alongside kind, so it always shares the row. Drops the ::after rule (only ever used by this one list). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BFkp8Uduc8SWRMmeUS9c1E
pselle
commented
Sep 8, 2026
|
|
||
| .field ol { | ||
| list-style-type: circle; | ||
| > li:first-child::after { |
Contributor
Author
There was a problem hiding this comment.
Switched this content to be in the markup itself, since it needs to be computed with the flex rules
pselle
commented
Sep 8, 2026
| wasm_name: string | ||
| wasm_version: string | ||
| wasm_channel?: string | ||
| wasm_hash: string | null |
Contributor
Author
There was a problem hiding this comment.
All these values are not guaranteed -- including wasm_hash. Name/version/etc only apply if it's published to registry. Hash may not be present if say, the contract changed to an executable; then there's not a wasm hash there
pselle
marked this pull request as ready for review
September 8, 2026 17:35
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.
Show wasm hash in contract history if there is not a published wasm.
Before (note the "null/null" links)



After (local screenshot):
The full wasm hash shows in the "title" property
When there are published versions to the registry, those show:

Because of the length of wasm hashes, I added more UI structure and CSS to prevent overflow or limiting the window's size/losing responsiveness.