Grouped category index pages with a Start here entry point - #545
Draft
zieka wants to merge 1 commit into
Draft
Conversation
Replaces the DocCardList grid on generated-index pages with a grouped description list. The grid restated the section sidebar at roughly four times the height — /authoring-recipes ran 19 cards over 2544px while the same 19 links sat unscrolled in the sidebar — and its one addition, the description, was clamped to two lines on 12 of 62 cards. Grouping and the entry point come from sidebar_custom_props in each doc's front matter, which the docs plugin reads ahead of the sidebar item, so sidebars.ts stays the single source of truth. A section that sets neither renders as one flat list. The sidebar is hidden while an index page is mounted: the page is that list, grouped and described, so showing both repeats every destination in one viewport. The attribute is removed on unmount so client-side navigation to a doc restores it. Also fixes three defects: - nested category cards fell back to "18 items" because the plugin drops `link` when building client props, so a description set only there never arrived - external links in the index showed no outbound icon, unlike the same links in the navbar and sidebar - previous/next links were a 14px-tall tap target, under WCAG 2.2 2.5.8 Heights: /authoring-recipes 2544->2028px, /concepts 2060->1709, /reference 1968->1582, /running-recipes 1412->912. Zero clamped descriptions, zero rows under 44px, AA in both themes.
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.
Problem
/authoring-recipesran 19 cards over 2544px — 3.2 screens — while the same 19 links sat in the sidebar, unscrolled, the whole way down.-webkit-line-clamp: 2cut 12 of 62 of them off mid-sentence. The deciding information was the hidden information./authoring-recipespresents a strict five-step sequence — set up, choose a recipe type, write, test, ship — as 19 interchangeable tiles, with no entry point.Objectives
Assumptions
sidebar_custom_props, not insidebars.ts. The docs plugin reads front matter ahead of the sidebar item (props.js:26), and an automated job editssidebars.tson every release — a second copy of titles and descriptions there would drift./+ doc id is safe here specifically:routeBasePathis/and no document in a section overrides its slug. Two documents define a customslug; one matches its id and the other is the landing page, which is in no section.link— the plugin dropslinkwhen it builds client props. That is the whole cause of "18 items".Changes
(1,2,3)src/theme/DocCategoryGeneratedIndexPage/— new swizzle rendering a grouped description list instead ofDocCardList: a Start here block,h2group headings, and one row per document with its full, unclamped description.(1)src/css/custom.css— hides the sidebar while an index page is mounted, and lifts thecalc(100% - var(--doc-sidebar-width))cap that would otherwise leave the reserved column as dead space. Removes five supersededgeneratedIndexPagerules.(3)48 documents —sidebar_custom_propscarryinggroupandstartHere. Content untouched; front matter only.(4)sidebars.ts— category-leveldescriptionfor Popular recipe guides, andcustomPropson the external workshop link, which cannot carry front matter.No tests: this repo has no test framework or test files.
tscand the production build are the available checks.Notes
/authoring-recipes2544→2028px,/concepts2060→1709,/reference1968→1582,/running-recipes1412→912. Un-clamping the descriptions spends some of the saving back; the result is ~20% shorter with complete information, not 70% shorter with it still hidden.padding: 0withline-height: 1left a 14px hit area, under WCAG 2.2 §2.5.8. Rows here are ≥73px.h2headings, but it copies every title and description out ofsidebars.tsinto a second source that an automated job would drift from.yarn typecheckclean; production build succeeds; across five index pages — 0 clamped descriptions, 0 rows under 44px, 0 truncation; contrast passes AA in both themes (worst 4.83 light, 5.95 dark); reflows at 600px./reference/all-recipesresolves to Lists with its own sidebar,/reference/faqto Reference, and the index-page attribute releases correctly on document pages — the two mechanisms both touch sidebar visibility.