diff --git a/app/components/detail-field.module.css b/app/components/detail-field.module.css index d32c80c..f715a65 100644 --- a/app/components/detail-field.module.css +++ b/app/components/detail-field.module.css @@ -1,3 +1,7 @@ +.fields { + min-width: 0; +} + .fields > .field:first-child { border-top: 1px solid var(--color-border); } @@ -41,7 +45,4 @@ .field ol { list-style-type: circle; - > li:first-child::after { - content: " (latest)"; - } } diff --git a/app/lib/types.ts b/app/lib/types.ts index 4f32b64..b154313 100644 --- a/app/lib/types.ts +++ b/app/lib/types.ts @@ -101,9 +101,10 @@ export interface Contract { } interface ContractVersion { - wasm_name: string - wasm_version: string - wasm_channel?: string + wasm_hash: string | null + wasm_name: string | null + wasm_version: string | null + wasm_channel: string | null version_index: number kind: string } diff --git a/app/routes/contractDetails.module.css b/app/routes/contractDetails.module.css index b937543..7dd7547 100644 --- a/app/routes/contractDetails.module.css +++ b/app/routes/contractDetails.module.css @@ -36,6 +36,30 @@ } } +/* ── Contract History list ──────────────────────────── */ + +.historyRow { + display: flex; + align-items: baseline; + gap: 0.35rem; +} + +.historyLabel { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + min-width: 0; +} + +.historyKind, +.historyLatest { + flex-shrink: 0; +} + +.historyLatest { + color: var(--color-muted-foreground); +} + /* ── Sidebar (right column) ─────────────────────────── */ .sidebar { diff --git a/app/routes/contractDetails.tsx b/app/routes/contractDetails.tsx index 79c6425..31102cb 100644 --- a/app/routes/contractDetails.tsx +++ b/app/routes/contractDetails.tsx @@ -134,22 +134,44 @@ export default function ContractDetail({ loaderData }: Route.ComponentProps) { {contractVersions.length > 0 && (
    - {contractVersions.map((version) => { - const versionWasmName = prefixName( - version.wasm_name!, - version.wasm_channel, - ) - const versionLabel = `${versionWasmName}@v${version.wasm_version}` + {contractVersions.map((version, i) => { + const isPublished = !!version.wasm_name + const versionWasmName = isPublished + ? prefixName( + version.wasm_name!, + version.wasm_channel ?? undefined, + ) + : undefined + const versionLabel = isPublished + ? `${versionWasmName}@v${version.wasm_version}` + : (version.wasm_hash ?? "non-wasm executable") + const isLatest = i === 0 return ( -
  1. - {version.version_index}:  - - {versionLabel} - {" "} - {version.kind} +
  2. +
    + + {version.version_index}:  + {isPublished ? ( + + {versionLabel} + + ) : ( + versionLabel + )} + + + {version.kind} + + {isLatest && ( + (latest) + )} +
  3. ) })}