Repository navigation
feat(collections): let visitors browse designed indexes and collection lists - #1765
Merged
gregpriday merged 8 commits intoNov 28, 2026
Conversation
…n listings - browse: true on a connected list or a query's loop, kept apart from the query - designed indexes browse their own loops over the page's entries - the browse component takes a content snippet and a frame for the controls
…listings - unit: the switch beside the query, validation, listing payloads, designed index rows, cache - browser: two listings on one page, a designed index, and the inspector switch - export: browse data names no file, designed rows keep their pictures
…p each file's browse data its own - controls climb past lists, text, rows, grids and linked cards, never out of a slot, dialog or panel - the footer's listings are numbered and declared with the header's - browse snippets and declarations take names no property's local can - export strips only genuine browse data, written with line separators escaped - code that places the browse component keeps its runtime; detached archive loops browse nothing - browse-specific diagnostics, focus after Show more skips hidden links
… and out of any form - the controls are a search landmark, not a form, so a listing inside a form leaves it whole - the climb stops at a conditional element, a placement's slot content and a disclosure, and never lands on a repeated item - placed among a grid's items, the controls take the whole row - export strips browse data only in generated files, rows with values
… where their rows show - every control names a form that is not there, so Enter or a half-typed number never touches an author's form - the climb stops at a node hidden at some screen size and at a bound tag, and falls back below a list it cannot leave - a listing that could only have controls inside a link shows without them - export reads a code component's file whole, whatever note it keeps
…des at a screen size - a tag a property chooses may be text: the controls climb past it, and with nowhere valid the listing has none - an element hidden at some screen size holds the controls with its rows - the controls name an empty form, which no form's ID can match
…-add-visitor-browsing-to-collection-indexes
…-add-visitor-browsing-to-collection-indexes
gregpriday
deleted the
feature/issue-1730-add-visitor-browsing-to-collection-indexes
branch
November 28, 2026 16:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1402: visitor search, filters and sorting now also work on a collection index with its own design, and on collection listing sections.
Resolves #1730
What changes
An index with its own design (
archiveTemplate) browses while its layout has a loop over the page's entries ({ $archive: true }) that the page shows. The browse index (collections/<id>.js) holds each published entry's match data and its projected row for each such loop, built by the sameprepareLoopsthat writes the page's own rows, so a matching entry from page 3 looks exactly as it would there. The page writes the layout once, inside the browse component'scontentsnippet: each$archiveloop shows the page's own rows until a control is used, then the rows that match. The controls sit under the archive heading (aframesnippet). The More button takes the place of the page links (content's second argument). Pages 2 and later, and term archives, are unchanged. A layout with no such loop says in Index settings, and to the assistant (browseOff), that the index has none of it.Collection listings. A connected list (
listSources[prop].browse: true) or a query loop ({ $query, browse: true }) opts in beside the query, never insideCollectionQuery, so it never changes which rows show. The listing browses exactly the rows its query, sort, offset, limit and the list'smaxchose, using the controls the collection'sbrowsesetting offers. Choice options are limited to those its own rows have. Its rows and match data are declared once in that file's script (so_rows_N,so_browse_N), so a page showing six records ships six and never loads the collection's index. Each listing gets its ownSoBrowse, and several on one page (or in the header and footer) are independent. The controls go above the element holding the listing, moving up past lists, text, rows, grids, tags a property chooses and linked cards. They never move out of what shows and hides the rows: a slot's content, a disclosure, a dialog or tab panel, an element hidden at some screen size, or one shown only while a condition holds. A listing whose controls could only sit inside a link, a list or text shows without them.Reused as they are:
collection-browse.js, the control kinds and the matching code.CollectionBrowse.sveltegains optionalcontentandframesnippets beside the ready-maderesults/childrenpath. Its controls are now a<div role="search">, not a<form>, and every control names an emptyform. A listing inside an author's form never nests forms, and pressing Enter or typing a half-finished number never touches that form. The ready-made index (#1402) behaves as before. In an author's design, Show more focuses the first newly shown thing a keyboard can reach, or the status.Editing.
ListSourceSwitchandLoopSourceControls. Query and mapping edits keep it.CollectionBrowsingmoved out ofPagesPanel.tsxso lists-only collections can be set too.instance.setListSourceandnode.setRepeatSourcetakebrowse: true.normalizeConnectionandloopProblemvalidate it, and a hand edit gets a browse-specific message.connect_collection_listtakesbrowseand keeps the current value when the call leaves it out.Export. A designed index's loop rows count as page content (their pictures ship). The listings' inline match data is skipped, but only lines that parse as generated match data, so an entry's sort text never keeps a file and authored code is never stripped. A code component that places the browse component keeps the runtime files.
Testing
tests/unit/collection-browse-lists.test.tscovers the opt-in shape and validation, exact listing rows, controls limited to a listing's rows, host placement past a grid, list and linked card, shared header/footer numbering, reserved names, designed-index rows, detached loops, the assistant tool, and the generation cache against a full run.tests/unit/collection-browse-lists-visitor.test.tsruns in Chromium. It renders on the server and hydrates two independent listings on one page, and a designed index searched across pages with Show more, zero matches and Clear. It checks that no extra script loads.tests/unit/collection-list-browse-browser.test.tscovers the inspector switch's ops.tests/unit/export.test.ts. Two existing assertions intests/unit/collection-browse.test.tsthat encoded "a design of its own never browses" now encode the new rule.<details>is climbed past, so the controls can sit outside a collapsed disclosure;<ul>/<ol>that is hidden on phones and holds the loop directly leaves the listing without controls at every width;li-only tag, placed in a<ul>, can have the controls placed directly in the list.$current;connect_collection_listcaps a query's limit at 100.