Skip to content

viewer: make addresses, tables and charts usable for analysis - #6

Merged
smypmsa merged 5 commits into
mainfrom
feat/viewer-readability
Oct 1, 2026
Merged

smypmsa merged 5 commits into
mainfrom
feat/viewer-readability

Conversation

@smypmsa

@smypmsa smypmsa commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Found building a dashboard over a real dataset full of wallets, token contracts and transaction hashes. Each item below is something a project could not fix from its own SQL or YAML.

Viewer

  • Hex values can be copied whole. Every hex cell has a copy button; columns.<name>.full: true on a panel shows the value unshortened. Before, the full value lived only in a title tooltip and selecting the cell copied the shortened text.

  • Explorer links. New optional chain_sources[].explorer_url. Address, transaction and block cells link to <url>/address/…, /tx/…, /block/…. Addresses are detected from their values, tx_hash and block_number by name; a 32-byte value is never guessed to be a transaction, since it may be any bytes32 id. kind overrides either way.

  • Column labels and descriptions. columns.<name>.label, .description, .kind per panel. A header with a description is underlined and explains itself on hover. Amount columns explain their decimals, which replaces the unexplained blue dot after their headers.

  • Analysis affordances. Each panel links to its SQL in the source bundle (source/queries/*.sql, already shipped, never linked). Tables and charts download their rows as CSV with exact values under the query's column names. Tables over ten rows get a filter.

  • Bar labels. With up to 30 bars every bar is labelled, tilted when crowded; hideOverlap used to drop every other one, leaving bars nobody could identify. Past 30 the axis is a scale (a bar per day) and labels thin out as before.

  • KPI height. A KPI beside a table or chart keeps its own height instead of stretching to its row-mate's with the number pinned to the bottom of an empty card. Two KPIs side by side still level.

  • Link guards. The viewer builds explorer links only from an http(s) base and renders a SQL link only for a path inside the release's source/ directory, whatever the dashboard JSON says; validation already holds explorer_url to http(s), but a release's JSON can be edited after the build. docs/security.md describes what the viewer turns into links.

explorer_url and the SQL paths are written into dashboards/<id>.json, not release.json, so they count toward the content digest. Releases built before this render as they did, without the new links.

CLI

  • Missing snapshot. In an ingest project, a dataset whose snapshot apply does not write (a lookup table a script fills in afterwards) passed validation and then failed the build with internal: ENOENT: … stat …. It is now a validation error naming the dataset, its path and a suggested_next.
  • Stray key in schema errors. must NOT have additional properties now ends with the key, e.g. : "by size". An unquoted comma in a flow-mapping title splits it into a second key, and the message used to give no hint of it.

Testing

  • pnpm test: 369 passed; the 3 live tests (S3, mainnet e2e) skipped.
  • Viewer helpers (column kind detection, explorer hrefs, header help, filter, CSV, KPI row pairing) have unit tests; the build test checks the SQL path and explorer_url in the dashboard doc; validate tests cover the new schema fields and the stray-key message.
  • Rendered transfer-traffic and protocol-flows by forking their published releases and building with this branch, and usdc-supply from its published results with this branch's viewer; compared each against the live page. The 358-bar daily chart in usdc-supply thins its labels as before.
  • A Robinhood Chain project with explorer_url: https://robinhoodchain.blockscout.com rendered every address, transaction and block cell as a working Blockscout link.

Not in this PR: indexing account code or token metadata as datasets. A project that needs them still fills a lookup table from a script.

🤖 Generated with Claude Code

smypmsa and others added 2 commits October 1, 2026 11:47
A dataset in an ingest project whose snapshot apply does not write (a
lookup table filled in by a script afterwards) passed validation, since
ingest snapshots appear at apply time, and then failed the build with an
internal error carrying the stat call's ENOENT. It is now a validation
error naming the dataset, its path and what to do.

Schema errors for an additional property now name the key. "must NOT
have additional properties" alone sent a reader hunting; the key usually
gives the cause away, as when an unquoted comma in a flow-mapping title
splits it into a second key. The missing-snapshot pointer for
dataset-only projects also narrows from /datasets to the entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A dashboard over wallets, contracts and transactions could not be read
or checked: every hex value was shortened with the full one only in a
tooltip, nothing linked anywhere, headers were SQL aliases, and an
unexplained dot marked amount columns.

- Every hex cell has a copy button for the full value; a panel's
  columns.<name>.full shows it unshortened.
- chain_sources[].explorer_url links address, transaction and block
  cells. Addresses are detected from their values, tx_hash and
  block_number by name; a 32-byte value is never guessed to be a
  transaction, since it may be any id.
- columns.<name>.label, .description and .kind on a panel. A header
  with a description is underlined and explains itself on hover; an
  amount column explains its decimals. The dot is gone.
- Each panel links to its SQL in the source bundle, tables and charts
  download their rows as CSV with exact values, and a table over ten
  rows gets a filter.
- Bar charts with up to 30 bars label every bar, tilted when crowded;
  past that the axis is a scale and labels thin out as before.
- A KPI beside a table or chart keeps its own height instead of
  stretching into an empty card; two KPIs side by side still level.

explorer_url and the SQL paths are written into the dashboard doc, not
release.json, so they count toward the content digest. Releases built
before this render as they did, without the new links.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 578c4df9-ba6d-4964-8808-e1ecd67884af

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

smypmsa and others added 3 commits October 1, 2026 12:04
The Presentation paragraph listed the panel options without columns, and
capabilities did not say how bar labels and KPI height now behave.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Validation holds explorer_url to http(s), but the viewer renders whatever
dashboard JSON it is served, and a release's JSON can be edited after
the build: a javascript: base would have become a clickable script.
explorerHref now refuses a base that is not http(s), and a panel's SQL
link renders only for a path inside the release's source/ directory.
security.md says what the viewer turns into links and why a cell value
cannot carry a scheme into one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
compatibility.md still described the bundle as committed under
viewer/dist/, which .gitignore has excluded since the bundle and its
sources could drift. Match the README: pnpm build produces it, and
build refuses to write a release without it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@smypmsa
smypmsa merged commit cbbd28b into main Oct 1, 2026
7 checks passed
@smypmsa
smypmsa deleted the feat/viewer-readability branch October 1, 2026 15:50
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.

1 participant