Skip to content

Shorter links: ?doc= is deflated, and portal pages carry only their c… - #78

Merged
alisman merged 1 commit into
masterfrom
session/doc-url
Oct 26, 2026
Merged

alisman merged 1 commit into
masterfrom
session/doc-url

Conversation

@alisman

@alisman alisman commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

…hanged settings

Every JSON value the app writes into a URL (lib/url-json.ts) is now 1.<base64url>: the JSON's UTF-8 bytes, raw deflate with no dictionary, so any zlib reads it (Python: zlib.decompress(data, -15)). A value with no "." is the plain base64url JSON that links were before, and still opens, so old links, scripts and hand-made links keep working. The lab, the Examples tab, the reproductions and campaign pages, the agent tools and MCP's run_analysis link all write it; the oncoprint lab's ?spec= is unchanged and shares the base64 helpers.

The Results and Comparison pages no longer put their whole document in the URL. ?changes= (app/portal/page-changes.ts) holds only how each view differs from the page's defaults, which are rebuilt from the query, keyed by the kinds of the page's views in order: changes made on another layout are not applied, and the page says so. An untouched page carries nothing. Comparison keeps its cohorts in ?doc= without the views; a ?doc= link with views still opens.

Measured on the 92 gallery documents: about half the plain length overall (largest 2,598 ->
568 characters). On the Results page, hiding Missense on the lollipop is a 225-character ?changes=, and a reload shows the same selection.

Verified: unit tests (new test/url-json.test.ts, test/page-changes.test.ts; a pinned format-1 link is read by Node's own zlib), lint, and the e2e lane of scripts/gate.sh (185 pass), which now asserts the Results page writes ?changes= and no ?doc=, and decodes the lab's ?doc= with the same module.

Claude-Session: https://claude.ai/code/session_01TyVfAhLnjshk2kWewGnLum

…hanged settings

Every JSON value the app writes into a URL (lib/url-json.ts) is now `1.<base64url>`: the JSON's
UTF-8 bytes, raw deflate with no dictionary, so any zlib reads it (Python:
zlib.decompress(data, -15)). A value with no "." is the plain base64url JSON that links were
before, and still opens, so old links, scripts and hand-made links keep working. The lab, the
Examples tab, the reproductions and campaign pages, the agent tools and MCP's run_analysis link
all write it; the oncoprint lab's ?spec= is unchanged and shares the base64 helpers.

The Results and Comparison pages no longer put their whole document in the URL. ?changes=
(app/portal/page-changes.ts) holds only how each view differs from the page's defaults, which
are rebuilt from the query, keyed by the kinds of the page's views in order: changes made on
another layout are not applied, and the page says so. An untouched page carries nothing.
Comparison keeps its cohorts in ?doc= without the views; a ?doc= link with views still opens.

Measured on the 92 gallery documents: about half the plain length overall (largest 2,598 ->
568 characters). On the Results page, hiding Missense on the lollipop is a 225-character
?changes=, and a reload shows the same selection.

Verified: unit tests (new test/url-json.test.ts, test/page-changes.test.ts; a pinned format-1
link is read by Node's own zlib), lint, and the e2e lane of scripts/gate.sh (185 pass), which
now asserts the Results page writes ?changes= and no ?doc=, and decodes the lab's ?doc= with
the same module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TyVfAhLnjshk2kWewGnLum
@vercel

vercel Bot commented Oct 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cbiolab-genie Ready Ready Preview Oct 26, 2026 11:51pm UTC
cohort-lab Ready Ready Preview Oct 26, 2026 11:51pm UTC

Request Review

@alisman
alisman merged commit 1dccf3c into master Oct 26, 2026
7 of 8 checks passed
@alisman
alisman deleted the session/doc-url branch October 26, 2026 23:52

This branch was successfully deployed

1 active deployment
Preview – cohort-lab — 3e77cc06 Deployed Oct 26, 2026 by vercel[bot]
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