oficina / equipo Public

build: bump Rastrillo to v0.30.1

codex agent, operated by paul@keymail.dev pushed by claude agent, operated by paul@keymail.dev 80717e349c6b4d661b3ec3cc3feaa3bdbaa6efa6 parent 761c9c4
6 files changed, +26 −18
  • AGENTS.md +1 −1
  • go.mod +1 −1
  • go.sum +2 −2
  • internal/equipo/static/shell.js +19 −11
  • internal/equipotest/browser_test.go +1 −1
  • internal/equipotest/upgrade_test.go +2 −2

CI failed — run details

diff --git a/AGENTS.md b/AGENTS.md
index c5813d75..3ae881ea 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -29,7 +29,7 @@ enabled with `EQUIPO_ALLOW_LOGGED_MAIL=1`. Logged mail is loopback-only.
`EQUIPO_OWNERS` is enforced by bootstrap only when the database has no team.
Never log credentials or sign-in links in production.
-Use Rastrillo v0.30.0 APIs from the pinned module cache. Resolve activation,
+Use Rastrillo v0.30.1 APIs from the pinned module cache. Resolve activation,
open one database, construct the app, clear `opts.DBPath`, then serve.
The database closes on shutdown and on failed app construction.
diff --git a/go.mod b/go.mod
index 98d39da4..a7002728 100644
--- a/go.mod
+++ b/go.mod
@@ -3,7 +3,7 @@ module amadan.net/oficina/equipo
go 1.26.0
require (
- amadan.net/rastrillo/rastrillo v0.30.0
+ amadan.net/rastrillo/rastrillo v0.30.1
github.com/chromedp/cdproto v0.158.6
github.com/chromedp/chromedp v0.21.0
github.com/go-chi/chi/v5 v5.3.2
diff --git a/go.sum b/go.sum
index 3b11e5fe..ff5c03a1 100644
--- a/go.sum
+++ b/go.sum
@@ -1,5 +1,5 @@
-amadan.net/rastrillo/rastrillo v0.30.0 h1:c2rZGeNXTJMfYSD60YyNoVHXY7rybT4CUty7woVvHjo=
-amadan.net/rastrillo/rastrillo v0.30.0/go.mod h1:K7Clrt14+25ruVupgRjlIhH2GQp/OdL9VoD8xPmkt0w=
+amadan.net/rastrillo/rastrillo v0.30.1 h1:MleTrteqqnGGeCZBqQSzZAhAfqQ3B0tZahZ+0wXhzXc=
+amadan.net/rastrillo/rastrillo v0.30.1/go.mod h1:K7Clrt14+25ruVupgRjlIhH2GQp/OdL9VoD8xPmkt0w=
amadan.net/rastrillo/rastrillo/money v0.1.0 h1:MxU4oqNrW8abxRTkgZBv24OYNpFnvonajNqeLIzmmaM=
amadan.net/rastrillo/rastrillo/money v0.1.0/go.mod h1:cmgkjBEIQh1pFSYvQk0UU6oPYS8kSDypdT9+t4Flx0U=
github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk=
diff --git a/internal/equipo/static/shell.js b/internal/equipo/static/shell.js
index 93a5e1bc..2cd0406d 100644
--- a/internal/equipo/static/shell.js
+++ b/internal/equipo/static/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/equipotest/browser_test.go b/internal/equipotest/browser_test.go
index 6f61f3cc..4a90b655 100644
--- a/internal/equipotest/browser_test.go
+++ b/internal/equipotest/browser_test.go
@@ -186,7 +186,7 @@ func TestFoundationBrowserWalk(t *testing.T) {
check(fmt.Sprintf(`document.querySelectorAll('[data-project-kind]').length === %d`, map[int64]int{1280: 3, 390: 6}[width]), "project count mismatch")
shot(fmt.Sprintf("projects-%d", width))
goTo("/specialists/engineering")
- check(`document.querySelectorAll('[data-activity="empty"]').length === 3`, "specialist work is not empty")
+ check(`document.querySelectorAll('#activity > section').length === 4 && document.querySelectorAll('#activity [data-empty-state]').length === 1 && document.querySelectorAll('#activity [data-task]').length === 0`, "specialist work is not empty")
shot(fmt.Sprintf("specialist-%d", width))
}
goTo("/work")
diff --git a/internal/equipotest/upgrade_test.go b/internal/equipotest/upgrade_test.go
index 976e31d0..8aaedf1b 100644
--- a/internal/equipotest/upgrade_test.go
+++ b/internal/equipotest/upgrade_test.go
@@ -44,8 +44,8 @@ func TestRastrilloUpgradeContract(t *testing.T) {
}
for _, dep := range info.Deps {
if dep.Path == "amadan.net/rastrillo/rastrillo" {
- if dep.Version != "v0.30.0" || dep.Replace != nil {
- t.Errorf("linked Rastrillo = %+v, want v0.30.0 without replacement", dep)
+ if dep.Version != "v0.30.1" || dep.Replace != nil {
+ t.Errorf("linked Rastrillo = %+v, want v0.30.1 without replacement", dep)
}
return
}