Skip to content

Say where each cost model page's data-source values came from - #7931

Open
Unisay wants to merge 1 commit into
masterfrom
yura/cost-model-page-data-source
Open

Say where each cost model page's data-source values came from#7931
Unisay wants to merge 1 commit into
masterfrom
yura/cost-model-page-data-source

Conversation

@Unisay

@Unisay Unisay commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

A cost model page fills its CSV and JSON URL fields from localStorage when the link does not carry them, and gave no sign it had done so. A review link whose query string was cut in transit therefore loaded a half-typed path left from an earlier session, showed it as though somebody had chosen it, and reported a 404 that read as a broken page.
A field that storage filled in now says so beside itself, with a button that drops the stored value and falls back to the branch for that field alone. A failed request repeats the note in its message, which is the case where nobody can otherwise tell where the URL came from. A query parameter now wins even when it is empty, so ?json= means there is no JSON URL rather than falling through to storage, and a stored path is restored only when the link does not name a different branch, because a path saved against one branch is wrong for another. ?csv= and ?json= are new, which lets a review link point at files a branch does not have yet.
The change is in shared plumbing, so all 14 cost model pages get it.
Found while preparing the pages for the keepPolicies and dropPolicies cost models.

A field filled from `localStorage` looked exactly like one somebody chose. A
review link whose query string got cut in transit therefore loaded a half-typed
path left over from an earlier session and reported a 404 that read as a broken
page. Three changes, all in the shared plumbing, so every builtin page gets
them:

A query parameter now wins even when it is empty. `?json=` says "no JSON URL",
and the old `||` chain treated that as absent and fell through to storage. Same
for `csv` and for `branch`.

A stored path is only restored when the link does not name a different branch,
because a path saved against one branch is wrong for another, and a stale
absolute path is worse than an empty field: the empty field falls back to the
branch and works.

A field that storage filled in says so, next to itself, with a button that drops
the stored value and falls back to the branch for that field alone. A failed
request adds the same note to its message, since that is the case where nobody
can tell where the URL came from. Copy Link now carries whichever of `csv` and
`json` the branch does not imply, so a review link stands on its own.

`?csv=` and `?json=` are new: they let a link point at files a branch does not
have yet, which needs a local HTTP server because `fetch` rejects the `file:`
scheme.
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.6.3

🚀 View preview at
https://IntersectMBO.github.io/plutus/pr-preview/cost-models/pr-7931/

Built to branch gh-pages at 2026-09-01 12:28 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@Unisay Unisay self-assigned this Sep 2, 2026
@Unisay Unisay added the No Changelog Required Add this to skip the Changelog Check label Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No Changelog Required Add this to skip the Changelog Check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant