registry: the search field in the header of package pages #306
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Every package page of the registry carries the search field in its header (
registryPageHtml(..., searchAction: Some("/search/"))), sendingqto the search page of #241 (landed, closed), and the pages already in the storage get it too.Source
docs/design/RELEASE.md7.11, the bullet "The package pages are static files too" (which ends "The search field of the header of a package page ... [is] not built") and the bullet of the search page (#241).tools/registry/src/packages.trb(packagePageHtml, last line callsregistryPageHtmlwithoutsearchAction),tools/registry/src/registry.trb(Registry.fillPages,pageFileWritten; the model isownerFileFilled, which compares the stored text with the text the row makes),tools/registry/src/main.trb(the start-up call), the shell incompiler/src/documentation/site-registry.trb(already renders theregistry-searchform, nothing to change there).Design (decided by the loop, see the comment below)
fillPagesstops asking "is there a page?" and asks "is the stored page the one the database makes now?": it buildspackagePageOf(database, package), reads the stored text (textAt) and writes only where it differs or is missing. No marker or hash is stored in the page; the page itself is the comparison, so any later change of the shell is picked up the same way.Acceptance criteria
packagePageHtmlcallsregistryPageHtmlwithsearchAction: Some("/search/"); a test intools/registry/tests/packages.test.trbasserts the page contains<form class="registry-search" method="get" action="/search/" role="search">and thename="q"input (onsample()and on a page written by a publish).Registry.fillPagesrewrites a package page whose stored text differs from the onepackagePageOfmakes, and writes a missing one, as before; it leaves an equal page untouched and does not count it. It answers the number of pages it wrote; the doc comment offillPagesand the start-up line inmain.trb("wrote the pages of N packages") stay true.fillPages(answersOk(1)for that package), asserts the page now has the form, and a secondfillPagesanswersOk(0); the existing missing-page test keeps passing.docs/design/RELEASE.md7.11 states that a package page has the search field, thatfillPagesrewrites every page that differs from the one the database makes (so a registry of a newer toolchain brings its shell), and drops "The search field of the header of a package page ... are not built" for the field (the capability summary #51 stays "not built").tools/gates.sh a),tools/check-commits.shclean.Seed impact
None. Registry application code (
tools/registry) and a design record only; no syntax, native, driver flag or std name looked up by string.Size and dependencies
One PR, two Conventional Commits:
feat(registry): the search field in the header of a package page(packages.trb + test) andfeat(registry): rewrite the package pages that differ at start(registry.trb + test + RELEASE.md), or one if it fits. Depends on #241: landed (closed,e069025,7d1a30d). No open dependency.Out of scope
The account pages (
account.trb) also callregistryPageHtmlwithoutsearchAction; they are not package pages and keep their current header.[loop:torbscript] claim refine by session:loop-torbscript-20261013 until 2026-10-13T06:35Z
[loop:torbscript] decided by the loop: existing pages are brought up to date by comparing, not by a marker and not by rewriting all.
Registry.fillPagesbuilds the page withpackagePageOf, reads the stored text withtextAtand writes only on a difference, the same wayownerFileFilledalready does for owner files. Why: (1) exact - it catches any change of the shell or of the page code, where a marker/hash would need a version constant kept in step by hand; (2) rewrite-all would PUT every file at every start (20 000 writes, churned ETags for the CDN) while compare writes only the changed ones; (3) the work is the existing per-package exists check plus the 5 readspackagePageOfalready does and one file read per package, sequential under the write lock before the first request, so the cost is a one-time start-up read pass, not a new class of work. Not measured: the choice does not turn on the number (compare reads what rewrite-all would read and writes less), and the forge CI would only time a seeded database; if a later release shows a start-up that is too slow at scale, a marker is the follow-up, with that number.[loop:torbscript] refine: verified #241 landed (closed; search page at
e069025, shell script7d1a30d), no open dependency; checked packages.trb, registry.trb fillPages/pageFileWritten/ownerFileFilled, main.trb, site-registry.trb (shell already renders the search form) and RELEASE.md 7.11 (still says the field is not built); tightened the acceptance criteria in the body (exact form markup, compare strategy, fill test with an old-shell page, doc change), seed impact none, size one PR of two commits, label ready set, next: implement[loop:torbscript] claim implement by session:loop-torbscript-20261013 until 2026-10-13T13:04Z