UI review: collapsed inherited content, UI fixes, shared pages between variants (0.12.0) #7

Merged
moof merged 0 commits from refs/pull/7/head into main 2026-10-21 02:10:13 +00:00
moof commented 2026-10-21 02:07:24 +00:00 (Migrated from code.moof.space)

Requested by Moof · project thread

Implements the UI review. It includes #6 (cached documentation rendering), so merging this one lands both.

Inherited content (0.11.0)

  • Element and type trees put content from base types under one collapsed "inherited from" block per base type, oldest first, with "Defined here" above the page's own content and an "Expand inherited" toggle.
  • NeTEx elements restrict their type and restate all of its groups, so restated groups are put back under the base type that first declares them. StopPlace now opens on 9 collapsed blocks followed by StopPlaceGroup.
  • Inherited attributes move to a collapsed table that names the type each one comes from.
  • Links into a collapsed block open it. The index tree's lazy expansion shows base types the same way.
  • UI fixes: the sidebar filter ranks exact matches, then prefix matches. On phones the sidebar folds behind a Browse button and long paths wrap, so the page no longer scrolls sideways (769px to 390px). Linked type names use the link colour, the Related elements card has padding, and repeated names are dropped.

Shared pages (0.12.0)

  • --variant NAME=XSD (repeatable) and --variant-title NAME=TITLE load several entry schemas together. Element, type, source and example pages are written once, and each variant gets its own start page at NAME/index.html.
  • navigation.js carries a bit mask per declaration. The sidebar lists only the current variant, a switcher moves between variants, and links outside the variant are muted.
  • Entry schemas that declare their own version of a shared name (the timetable subset's PublicationDelivery, NeTEx_siri_SG's Siri) get their own pages under NAME/pages/, built from that variant loaded on its own.
  • --redirects-caddyfile writes a snippet that permanently redirects old NAME/(elements|types|src|examples|assets)/... URLs to the shared pages. I checked it with Caddy 2.10.2.

Results for NetEx-docs' six variants, with --transmodel and --examples, measured locally: one 32s run instead of six runs of 34s each without examples. The site is 218 MB and 7,363 files, down from 666 MB and 39,212 files.

Tests: 51 passed (uv run pytest), including new tests for inherited blocks, restated restrictions and variants.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SnEtsMrAdL7vb2Ln5KuqTS

<!-- claude-projects-attribution --> _Requested by **Moof** · [project thread](https://claude.ai/code/project/chan_01BmPQxcG1UuS21Gfai9Zcdh?thread=cmsg_01BmPQxcG1UuS21Gfai9ZcdhTymh7qrQ729gG29XEc821m)_ Implements the UI review. It includes #6 (cached documentation rendering), so merging this one lands both. **Inherited content (0.11.0)** - Element and type trees put content from base types under one collapsed "inherited from" block per base type, oldest first, with "Defined here" above the page's own content and an "Expand inherited" toggle. - NeTEx elements restrict their type and restate all of its groups, so restated groups are put back under the base type that first declares them. StopPlace now opens on 9 collapsed blocks followed by StopPlaceGroup. - Inherited attributes move to a collapsed table that names the type each one comes from. - Links into a collapsed block open it. The index tree's lazy expansion shows base types the same way. - UI fixes: the sidebar filter ranks exact matches, then prefix matches. On phones the sidebar folds behind a Browse button and long paths wrap, so the page no longer scrolls sideways (769px to 390px). Linked type names use the link colour, the Related elements card has padding, and repeated names are dropped. **Shared pages (0.12.0)** - `--variant NAME=XSD` (repeatable) and `--variant-title NAME=TITLE` load several entry schemas together. Element, type, source and example pages are written once, and each variant gets its own start page at `NAME/index.html`. - `navigation.js` carries a bit mask per declaration. The sidebar lists only the current variant, a switcher moves between variants, and links outside the variant are muted. - Entry schemas that declare their own version of a shared name (the timetable subset's `PublicationDelivery`, `NeTEx_siri_SG`'s `Siri`) get their own pages under `NAME/pages/`, built from that variant loaded on its own. - `--redirects-caddyfile` writes a snippet that permanently redirects old `NAME/(elements|types|src|examples|assets)/...` URLs to the shared pages. I checked it with Caddy 2.10.2. **Results for NetEx-docs' six variants, with `--transmodel` and `--examples`, measured locally:** one 32s run instead of six runs of 34s each without examples. The site is 218 MB and 7,363 files, down from 666 MB and 39,212 files. Tests: 51 passed (`uv run pytest`), including new tests for inherited blocks, restated restrictions and variants. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01SnEtsMrAdL7vb2Ln5KuqTS
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Reference4PT/prettyxsd!7
No description provided.