carlos / platform Public

console: re-vendor Rastrillo v0.30.2 (rail ring, page transition)

tokens.css: the console rail's current item draws its ring and shadow
whole. shell.js: no uncaught error when the browser skips a page
transition. Other vendored files unchanged since v0.29.0.

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

Squashed from rastrillo-v0.30.2 into main.
Paul Campbell pushed by claude agent, operated by paul@keymail.dev ab5b57b9696d995361071da4be708cada7a336ac parent 412203c
4 files changed, +32 −19
  • internal/console/assets_test.go +2 −2
  • internal/console/static/rastrillo/VERSION +4 −4
  • internal/console/static/rastrillo/shell.js +19 −11
  • internal/console/static/rastrillo/tokens.css +7 −2

CI failed — run details

diff --git a/internal/console/assets_test.go b/internal/console/assets_test.go
index c2a40ca85..d695b4ed6 100644
--- a/internal/console/assets_test.go
+++ b/internal/console/assets_test.go
@@ -89,8 +89,8 @@ func TestParseRastrilloVersionRejectsJunk(t *testing.T) {
// of any file and this fails. Not acceptance: it reads the embedded files.
func TestRastrilloCopiesMatchVersion(t *testing.T) {
v := readRastrilloVersion(t)
- if v.Tag != "v0.29.0" {
- t.Errorf("tag = %q, want v0.29.0", v.Tag)
+ if v.Tag != "v0.30.2" {
+ t.Errorf("tag = %q, want v0.30.2", v.Tag)
}
entries, err := staticFS.ReadDir("static/rastrillo")
if err != nil {
diff --git a/internal/console/static/rastrillo/VERSION b/internal/console/static/rastrillo/VERSION
index c6f11388b..fc559989c 100644
--- a/internal/console/static/rastrillo/VERSION
+++ b/internal/console/static/rastrillo/VERSION
@@ -1,12 +1,12 @@
# Rastrillo design-system files, copied unmodified from the tag below.
# Never edit them by hand: re-copy from a tag and update this file.
# Licence: MPL-2.0, see LICENSE. The upstream files carry no per-file header.
-tag v0.29.0
-commit 3aa8f377718f244f1b9c0a8fb70362e39e8d6d04
-file tokens.css ui/tokens.css 8a99d7e8512d89d8d2469545b57eef670836a376d1fbdbf5e26096aa9241234c
+tag v0.30.2
+commit 9eb69891dc9e8d0a3393ee85226a607e279a4401
+file tokens.css ui/tokens.css fef74ac211c01f3d3905dc6c06436aa0667b4b8a88a3da61152d3ab4dfc626a2
file day.css ui/themes/day.css 2deaa9f663d9929cfa9238d60ed0e532dc552313d5838b8e0d076f9991b4907f
file shell.css ui/shell.css 566f7dfb5f3907f12b7de92d133e5430ad4537892e9e55578665a849353fb108
-file shell.js ui/shell.js 6fa4c282e48d2c63b30d84ce990bf3b8fbec8a717624e3fafb73e6d3d2ac34d7
+file shell.js ui/shell.js e5a459754df20d76cfcbc1902c435b87a56b0d35318583f1fdb9f6732fc2e5c1
file rastrillo.js ui/rastrillo.js 13a8ca6fa9ac25833f6485ab50a521dff7bd811372025dc5141b96522b60098b
file anchor.js ui/anchor.js 9a015c586428d682f5d00eb5ec33df316e48bcf2c4b6418b83400eec70c3ba08
file LICENSE LICENSE 3f3d9e0024b1921b067d6f7f88deb4a60cbe7a78e76c64e3f1d7fc3b779b9d04
diff --git a/internal/console/static/rastrillo/shell.js b/internal/console/static/rastrillo/shell.js
index 93a5e1bc7..2cd0406d4 100644
--- a/internal/console/static/rastrillo/shell.js
+++ b/internal/console/static/rastrillo/shell.js
@@ -87,17 +87,24 @@
if (hit) hit.focus();
}
- // 1. Direction. Back when the page being left recorded that its back
- // control was used AND this page is where it pointed, or when the
- // Navigation API reports a traverse to an earlier entry (the browser's
- // own Back); forward otherwise. The record is written on the click,
- // before anything commits, so a Back whose leave-page prompt was
- // cancelled leaves it behind: scoped to its destination, the next link
- // followed still slides forward. Taken on every reveal, matched or not,
- // so a stale one never waits for its URL to come round. A URL pattern
- // cannot decide it: the new page cannot know which URL is the index,
- // and the pattern is the app's.
+ // A skipped browser transition rejects even though navigation succeeds.
+ // Observe only its promises, so unrelated failures remain visible.
+ function observeTransition(transition) {
+ if (!transition) return;
+ ["ready", "finished", "updateCallbackDone"].forEach(function (key) {
+ if (transition[key]) transition[key].catch(function (err) {
+ if (!(err instanceof DOMException) ||
+ ["AbortError", "InvalidStateError", "TimeoutError"].indexOf(err.name) < 0) throw err;
+ });
+ });
+ }
+
+ // 1. Direction. The back record is scoped to its destination because
+ // a cancelled leave-page prompt can leave it behind. Consume it on
+ // every reveal so it cannot affect a later visit. Browser Back uses
+ // the Navigation API's entry order; URL patterns belong to the app.
function reveal(e) {
+ observeTransition(e.viewTransition);
var back = take(WENT_BACK) === location.pathname + location.search, a = window.navigation && navigation.activation;
if (!back && a && a.navigationType === "traverse" && a.from && a.entry) back = a.entry.index < a.from.index;
// Focus first, and the type only where there is a set to add it to:
@@ -116,7 +123,8 @@
// revealed; pagehide is the fallback where there is no pageswap.
// Never both: a pagehide landing after the index took the record
// would leave a stale one behind.
- function leave() {
+ function leave(e) {
+ observeTransition(e.viewTransition);
if (view(PAGE)) store(function (s) { s.setItem(RETURN, location.pathname + location.search); });
}
window.addEventListener("onpageswap" in window ? "pageswap" : "pagehide", leave);
diff --git a/internal/console/static/rastrillo/tokens.css b/internal/console/static/rastrillo/tokens.css
index fb0ee032a..418855523 100644
--- a/internal/console/static/rastrillo/tokens.css
+++ b/internal/console/static/rastrillo/tokens.css
@@ -2923,8 +2923,13 @@ dialog.rst-modal-panel, dialog[rst-modal-panel] { block-size: auto; color: inher
the gate that missed it asked where the person sat inside the rail
— a question that stayed true while the rail hung off the screen.
TestTheConsoleRailFitsTheViewport asks the other question, and
- carries a control page that must answer it the other way. */
- .rst-shell-console > .rst-shell__rail > .rst-shell__nav, [rst-shell-console] > [rst-shell-rail] > [rst-shell-nav] { box-sizing: border-box; inset-block-start: var(--rst-sp-4); max-block-size: calc(100dvh - 2 * var(--rst-sp-4)); overflow-y: auto; position: sticky; }
+ carries a control page that must answer it the other way.
+ THE RING. overflow-y: auto clips the nav at its padding box on
+ both axes, which cut the current item's ring and contact shadow
+ off at the nav's edges. The 5px of padding is room for the shadow
+ at any light position, and the negative margin, inset and cap give
+ it back so nothing moves (TestTheConsoleRailDrawsTheCurrentItemWhole). */
+ .rst-shell-console > .rst-shell__rail > .rst-shell__nav, [rst-shell-console] > [rst-shell-rail] > [rst-shell-nav] { box-sizing: border-box; inset-block-start: calc(var(--rst-sp-4) - 5px); margin-block: -5px; margin-inline: -5px; max-block-size: calc(100dvh - 2 * var(--rst-sp-4) + 10px); overflow-y: auto; padding-block: 5px; padding-inline: 5px; position: sticky; }
}
/* The topbar's narrow menu is a floating card: it overlays the page and