| index 243478c..f1ce5bf 100644 |
| --- a/internal/docs/views/list.html |
| +++ b/internal/docs/views/list.html |
| @@ -9,6 +9,12 @@ |
| renders unconditionally, so the control reaches a person with no |
| documents yet exactly the same way it reaches everyone else, |
| rather than only appearing once there is something to list. |
| + It is one button and no title field: the handler already names a |
| + blank title "Untitled document", and the title is editable in the |
| + document's own bar, which is where a person is when they know |
| + what the document is called. Asking first put two text fields |
| + side by side in the header, and the second read as a second |
| + search box. |
| |
| [docs-header-actions] wraps the search form and that create form |
| as one group: [rst-page-header]'s flex/space-between rule wants at |
| @@ -54,231 +60,325 @@ |
| which is what an empty document, and a document whose structure |
| could not be read, both get. */}} |
| {{define "thumb"}}<span docs-thumb aria-hidden="true">{{if .Bars}}<svg viewBox="0 0 {{.W}} {{.H}}" preserveAspectRatio="xMidYMin slice">{{range .Bars}}<rect x="{{.X}}" y="{{.Y}}" width="{{.W}}" height="{{.H}}"/>{{end}}</svg>{{end}}</span>{{end}} |
| +{{/* tile — one document on the shelf. */}} |
| +{{define "tile"}}<li docs-tile> |
| + <span docs-tile-title><a href="{{.Href}}">{{.Title}}</a></span> |
| + {{template "thumb" .Thumb}} |
| + <span docs-tile-meta><span docs-row-when>{{.When}}</span>{{if .SharedNote}}<span docs-row-shared>{{.SharedNote}}</span>{{end}}</span> |
| + </li>{{end}} |
| {{define "content"}}<style> |
| - /* [docs-thumb] holds a real rendering of the document's page one: |
| - the <svg> inside it is the line boxes the PDF exporter's own |
| - layout placed, through export.PageOne (see preview.go). It was |
| - reserved and deliberately empty until that existed — "reserved |
| - space, not a placeholder image" — and the box is unchanged now |
| - that it is filled, which is what that reservation was for. |
| - 26×34 is literal: the brief's own figure, and within a percent |
| - of a US-Letter page's aspect at row scale, so the page inside it |
| - is not distorted to fit. */ |
| - [docs-thumb] { |
| - display: block; |
| - flex: none; |
| - inline-size: 26px; |
| - block-size: 34px; |
| - border: 1px solid var(--rst-line-strong); |
| - border-radius: var(--rst-radius-sm); |
| - background: var(--rst-surface); |
| - overflow: hidden; |
| + /* The desk. The list is the person's documents laid out as the paper |
| + they are, so the page under them is a desk rather than a form: the |
| + suite's background, lit from above by a wash of Docs' own hue (the |
| + icon's glow, estilo theme/apps.go hue 262, at the aurora's |
| + lightness). One hue only, as the app icons have; the suite's full |
| + aurora stays on Home. It is painted on the body so it can reach |
| + the bar and the edges without anything here overflowing. */ |
| + body:has([docs-list]) { |
| + background: |
| + radial-gradient(ellipse 70rem 28rem at 50% -6rem, |
| + light-dark(oklch(0.86 0.06 262 / 0.55), oklch(0.42 0.08 262 / 0.35)), |
| + transparent 70%) |
| + no-repeat, |
| + var(--rst-bg); |
| } |
| - [docs-thumb] > svg { |
| - display: block; |
| - inline-size: 100%; |
| - block-size: 100%; |
| + [docs-list] { |
| + padding-block: var(--rst-sp-4) var(--rst-sp-6); |
| } |
| - /* The fill is a token rather than a presentation attribute on each |
| - rect: var() in an SVG presentation attribute has a patchy support |
| - history, and a token here follows the theme the way every other |
| - colour on this page does. Nothing about the thumbnail carries |
| - meaning by colour alone — a heading reads as a heading because |
| - its bar is taller, which is the real ratio between the two type |
| - sizes. */ |
| - [docs-thumb] rect { |
| - fill: var(--rst-text-muted); |
| + /* The header: the screen's name, large and set tight, with search |
| + and create on the same line. It wraps under the title on a phone, |
| + search first, at full width. */ |
| + [docs-list-head] { |
| + display: flex; |
| + flex-wrap: wrap; |
| + align-items: center; |
| + justify-content: space-between; |
| + gap: var(--rst-sp-3) var(--rst-sp-5); |
| + margin-block-end: var(--rst-sp-5); |
| } |
| - [docs-group-label] { |
| + [docs-list-head] h1 { |
| margin: 0; |
| - padding: var(--rst-sp-3) var(--rst-sp-3) var(--rst-sp-1); |
| - font-size: var(--rst-fs-xs); |
| + font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); |
| font-weight: 700; |
| - letter-spacing: 0.04em; |
| - text-transform: uppercase; |
| - color: var(--rst-text-muted); |
| - } |
| - [docs-row-when] { |
| - flex: none; |
| - color: var(--rst-text-muted); |
| - font-size: var(--rst-fs-sm); |
| + letter-spacing: -0.025em; |
| + line-height: 1.1; |
| } |
| - /* No row-click rule here on purpose, and it is worth saying why, |
| - because the measurement that argues for one is misleading. |
| - A row's title link measures 268×16 — well under the 24×24 WCAG |
| - 2.2 AA target minimum, with the thumbnail and the whole right |
| - half of the row apparently dead. That reading is wrong, and |
| - getBoundingClientRect is what makes it wrong: it reports an |
| - element's own box and cannot see an absolutely positioned |
| - pseudo-element. rastrillo already stretches this link over the |
| - whole row. tokens.css gives [rst-row] position: relative, gives |
| - [rst-row]:hover the --rst-surface-2 tint, and gives |
| - [rst-row-main] > a::after content:"" with inset: 0, under its own |
| - comment: "The name link's overlay makes the whole row clickable |
| - without nesting one anchor inside another." |
| - Our markup already matches that selector, so the row is fully |
| - clickable, fully hover-tinted and past 24×24 with nothing of ours |
| - involved. An earlier version of this file added [docs-row] and |
| - [docs-row-link]::after restating those exact declarations, and a |
| - hit test then "confirmed" a fix that had changed nothing — the |
| - probe was hitting rastrillo's overlay both before and after. |
| - If you are about to add one: hit-test the row before you change |
| - anything, not only after. */ |
| - /* [docs-header-actions]: the header's one flex child opposite the |
| - titles — [rst-page-header]'s space-between rule places it there |
| - with no layout rule of its own beyond this; everything it holds |
| - (the search form and the create form — sign-out moved into the |
| - shell's account control, see the note at the top of this file) |
| - lays out as one inline group inside it. */ |
| + /* [docs-header-actions]: search and create as one group. They stay |
| + two separate <form>s, never one, because they are unrelated |
| + actions with different methods and targets (GET / vs POST |
| + /documents) and must never be merged into one submit. */ |
| [docs-header-actions] { |
| display: flex; |
| - flex-wrap: wrap; |
| + flex: 1 1 22rem; |
| + justify-content: flex-end; |
| align-items: center; |
| gap: var(--rst-sp-3); |
| + min-inline-size: 0; |
| } |
| - /* [docs-create-form]: the title field and its submit button as one |
| - inline row — nowrap, deliberately, and this is the part that took |
| - two attempts. |
| - A wrapping flex line does not shrink its items to fit; it breaks |
| - first and shrinks only what still does not fit afterwards. So |
| - with wrap on, the button dropped to a second line and the field — |
| - now alone on the first one, with room to grow — sprang back to |
| - its 14rem maximum, which is how a fix aimed at making the header |
| - shorter measured exactly as tall as before it (175px, unchanged). |
| - nowrap is what forces the field to give up width to its button |
| - instead of the button giving up the line. |
| - The button itself is flex: none so the whole shortfall comes out |
| - of the field. Shared proportionally, both would shrink, and |
| - "New document" would start wrapping or clipping inside a control |
| - that had no reason to be narrower. |
| - One thing to watch when the other eleven catalogs land: nowrap |
| - plus a non-shrinking button means a locale whose |
| - docs.list.create.label is wider than about 270px overflows the |
| - 320px column rather than wrapping out of it. English is 131px and |
| - is the only catalog today, so this is a note rather than a bug — |
| - but it is a real edge, and the fix when it arrives is a |
| - wrap allowance keyed to the label, not a smaller field. */ |
| - [docs-create-form] { |
| + /* Search is one field with its submit inside it, at the start, as the |
| + magnifier. The button keeps "Search documents" as its name, so a |
| + pointer, a screen reader and Enter from the field all reach the |
| + same submit. The field takes whatever the row leaves it, down to |
| + nothing: min-inline-size: 0 lifts a flex item's automatic minimum, |
| + which for an <input> is its content and would otherwise push the |
| + page sideways at 320px (SC 1.4.10, which this app supports with |
| + no exemption; the old two-control form failed it once). */ |
| + [docs-search-form] { |
| + position: relative; |
| display: flex; |
| - flex-wrap: nowrap; |
| - gap: var(--rst-sp-2); |
| + flex: 0 1 20rem; |
| + min-inline-size: 0; |
| } |
| - [docs-create-form] button { |
| + [docs-search-form] [rst-input] { |
| + flex: 1 1 auto; |
| + min-inline-size: 0; |
| + min-block-size: 40px; |
| + padding-inline-start: 40px; |
| + border-color: transparent; |
| + border-radius: var(--rst-radius-pill); |
| + background: light-dark(rgb(255 255 255 / 0.8), rgb(255 255 255 / 0.06)); |
| + box-shadow: inset 0 0 0 1px var(--rst-line), 0 1px 2px light-dark(rgb(20 30 60 / 0.06), transparent); |
| + } |
| + [docs-search-form] [rst-input]:hover { |
| + box-shadow: inset 0 0 0 1px var(--rst-line-strong); |
| + } |
| + [docs-search-submit] { |
| + position: absolute; |
| + inset-block: 0; |
| + inset-inline-start: 2px; |
| + display: grid; |
| + place-items: center; |
| + inline-size: 38px; |
| + padding: 0; |
| + border: 0; |
| + border-radius: var(--rst-radius-pill); |
| + background: transparent; |
| + color: var(--rst-text-muted); |
| + cursor: pointer; |
| + } |
| + [docs-search-submit]:hover { |
| + color: var(--rst-accent); |
| + } |
| + [docs-search-submit] svg, |
| + [docs-create-form] svg { |
| + inline-size: 18px; |
| + block-size: 18px; |
| + fill: none; |
| + stroke: currentColor; |
| + stroke-width: 2; |
| + stroke-linecap: round; |
| + } |
| + [docs-create-form] { |
| flex: none; |
| } |
| - /* The title field shares its line with the submit button instead of |
| - holding a fixed 14rem and pushing it onto a line of its own. |
| - Measured at 320px — the reflow width spec §10.3 commits to — |
| - before this changed: a fixed 14rem (224px) field could not sit |
| - beside a 131px button in a 288px content column, so the field, |
| - "New document" and "Sign out" each took a full row and the header |
| - stood 175px tall, putting the first document 223px down a 720px |
| - viewport. Just under a third of the screen spent on chrome before |
| - a single thing a person came here to read. |
| - flex-basis 10rem with room to shrink is what lets the field and |
| - its button share one line in that column; the 14rem cap keeps the |
| - desktop header exactly as it was, since the form still sizes to |
| - its max-content there. min-inline-size: 0 is load-bearing — a |
| - flex item's automatic minimum size is its content, so without it |
| - an <input> refuses to shrink below its default size and the row |
| - overflows rather than fitting. */ |
| - [docs-create-form] [rst-input] { |
| - flex: 1 1 10rem; |
| - min-inline-size: 0; |
| - max-inline-size: 14rem; |
| - } |
| - /* [docs-search-form] is the same inline row as the create form, with |
| - one difference: it does NOT wrap. The header carries several |
| - controls, and with wrapping allowed the search button dropped onto |
| - a line of its own under its own field while the create form stayed |
| - whole — which reads as two rows of unrelated chrome rather than as |
| - one field and its button. |
| - |
| - Staying on one row is only safe because the FIELD shrinks, and |
| - that is the part this rule got wrong for a while. It previously |
| - carried a comment asserting that the group wrapping at |
| - [docs-header-actions] meant "a 320px viewport puts each form on |
| - its own line intact rather than breaking one of them in half". |
| - That was never measured and was wrong. The field held a fixed |
| - 11rem, its button holds a label that does not wrap, and |
| - max-inline-size: 100% resolves against a form whose own width is |
| - its content — so the form set a min-content floor of about 334px |
| - and simply stood wider than the 288px column. Measured on |
| - origin/main at 7507a33 with scripts/browser-drive.sh: the list |
| - page scrolled sideways at 320px, scrollWidth 356 against a 320 |
| - viewport, with this form's button the innermost offender at |
| - x=356. |
| - |
| - That is a WCAG 2.2 SC 1.4.10 failure, which AGENTS.md allows no |
| - exemption from, traded for a desktop layout nicety by a comment |
| - that sounded like it had been checked. |
| - |
| - Note what the floor did to its NEIGHBOUR. [docs-create-form] was |
| - measured over the edge too, at x=350, and it is correctly written |
| - — it shrinks exactly as it should. It overflowed because a |
| - wrapping flex container is at least as wide as its widest item's |
| - min-content, so this form's 334px floor widened every line in the |
| - group, including the one the create form had to itself. Fixing |
| - the field below fixes both; there was never a second bug. Worth |
| - knowing before someone "fixes" the create form as well. |
| - |
| - The fix is that the field takes what is left after the button |
| - rather than claiming a width: flex 1 1 with a small basis, and |
| - min-inline-size 0 to lift a flex item's automatic minimum, which |
| - is its content size and is what an <input> otherwise refuses to |
| - go below. The 11rem cap keeps the desktop header exactly as it |
| - was. */ |
| - [docs-search-form] { |
| - display: flex; |
| - flex-wrap: nowrap; |
| + /* A phone: the title and "New document" share the first line, and |
| + search takes the whole second one, where its hint has room to be |
| + read. display: contents lets the two forms join the header's own |
| + row; they stay two separate forms. */ |
| + @media (max-width: 36rem) { |
| + [docs-header-actions] { |
| + display: contents; |
| + } |
| + [docs-list-head] h1 { |
| + flex: 1 1 auto; |
| + } |
| + [docs-search-form] { |
| + order: 3; |
| + flex: 1 1 100%; |
| + } |
| + } |
| + [docs-create-form] button { |
| + display: inline-flex; |
| align-items: center; |
| gap: var(--rst-sp-2); |
| - max-inline-size: 100%; |
| + min-block-size: 40px; |
| + padding-inline: var(--rst-sp-4) var(--rst-sp-5); |
| + border-radius: var(--rst-radius-pill); |
| + white-space: nowrap; |
| + box-shadow: 0 1px 0 rgb(255 255 255 / 0.18) inset, 0 6px 16px -6px color-mix(in oklab, var(--rst-accent) 70%, transparent); |
| } |
| - [docs-search-form] [rst-input] { |
| - flex: 1 1 6rem; |
| + /* The shelf: every document as its own first page, side by side, |
| + each page --docs-tile wide. The recency groups (spec §6.4) sit |
| + side by side on the same shelf rather than each taking a band of |
| + the screen, each with its heading over its own pages: "Today", |
| + two pages, "Yesterday", one, and so on along the row, wrapping |
| + like words. A group with more pages than fit on one line takes |
| + the whole width and wraps inside itself. */ |
| + [docs-list] { |
| + --docs-tile: 10.5rem; |
| + --docs-tile-gap: var(--rst-sp-5); |
| + } |
| + [docs-groups] { |
| + display: flex; |
| + flex-wrap: wrap; |
| + gap: var(--rst-sp-6) calc(var(--docs-tile-gap) * 2); |
| + } |
| + [docs-group] { |
| + flex: 0 1 auto; |
| min-inline-size: 0; |
| - max-inline-size: 11rem; |
| - } |
| - /* The submit button is for a pointer and for a screen reader; a |
| - keyboard user submits with Enter from the field, which a |
| - single-input form does natively. It stays visible rather than |
| - becoming an icon because "Search documents" is also the field's |
| - accessible name and the two agreeing is worth more than the |
| - width. |
| - flex: 0 0 auto for the same reason: the whole shortfall comes out |
| - of the field, so the button keeps its whole label. It is the |
| - words that are load-bearing here, not the box. |
| - The locale caveat, stated as the sequence it actually is rather |
| - than as a single threshold. Because the field gives way first and |
| - the button never shrinks, a wider label eats the FIELD long |
| - before anything overflows: a ~200px label leaves about 80px of |
| - field, ~270px leaves a sliver, and only past ~280px — the 288px |
| - column less the gap — does anything cross the edge. So the first |
| - failure a wide catalog produces is a search box too narrow to |
| - read what you typed, which is a usability problem and not a |
| - 1.4.10 one; the overflow comes later. English is 131px and is the |
| - only catalog today. The fix when it arrives is a wrap allowance |
| - keyed to the label, not a smaller field. |
| - ([docs-create-form]'s own comment above states the same caveat as |
| - a bare "wider than about 270px overflows", which is the second |
| - half of this sequence and not the part that bites first.) */ |
| - [docs-search-form] button { |
| + } |
| + /* A group's heading is a quiet label over its pages: sentence case, |
| + the muted ink, weight doing the work rather than capitals, with a |
| + hairline running out to the group's edge so the pages under it |
| + read as one run. */ |
| + [docs-group-label] { |
| + display: flex; |
| + align-items: center; |
| + gap: var(--rst-sp-3); |
| + margin: 0 0 var(--rst-sp-4); |
| + font-size: var(--rst-fs-sm, 0.875rem); |
| + font-weight: 600; |
| + color: var(--rst-text-muted); |
| white-space: nowrap; |
| - flex: 0 0 auto; |
| + } |
| + [docs-group-label]::after { |
| + content: ""; |
| + flex: 1 1 auto; |
| + min-inline-size: var(--rst-sp-5); |
| + border-block-start: 1px solid light-dark(rgb(23 32 60 / 0.12), rgb(255 255 255 / 0.12)); |
| + } |
| + [docs-shelf] { |
| + display: flex; |
| + flex-wrap: wrap; |
| + gap: var(--rst-sp-6) var(--docs-tile-gap); |
| + margin: 0; |
| + padding: 0; |
| + list-style: none; |
| + } |
| + [docs-shelf] > [docs-tile] { |
| + inline-size: var(--docs-tile); |
| + } |
| + /* Two pages to a row on a phone, edge to edge of the column. */ |
| + @media (max-width: 30rem) { |
| + [docs-list] { |
| + --docs-tile-gap: var(--rst-sp-4); |
| + } |
| + [docs-group] { |
| + flex-basis: 100%; |
| + } |
| + [docs-shelf] > [docs-tile] { |
| + inline-size: calc((100% - var(--docs-tile-gap)) / 2); |
| + } |
| + } |
| + /* One document. The title link is stretched over the whole tile by |
| + its ::after, the same overlay rastrillo's rows use, so the paper, |
| + the title and the date are all one target without nesting |
| + anything interactive inside the link. */ |
| + [docs-tile] { |
| + position: relative; |
| + display: flex; |
| + flex-direction: column; |
| + gap: var(--rst-sp-1); |
| + min-inline-size: 0; |
| + } |
| + [docs-tile-title] { |
| + order: 2; |
| + margin-block-start: var(--rst-sp-3); |
| + font-size: var(--rst-fs-sm, 0.875rem); |
| + font-weight: 600; |
| + line-height: 1.3; |
| + overflow-wrap: anywhere; |
| + display: -webkit-box; |
| + -webkit-box-orient: vertical; |
| + -webkit-line-clamp: 2; |
| + line-clamp: 2; |
| + overflow: hidden; |
| + } |
| + [docs-tile-title] a { |
| + color: var(--rst-text); |
| + text-decoration: none; |
| + } |
| + [docs-tile-title] a::after { |
| + content: ""; |
| + position: absolute; |
| + inset: -6px; |
| + border-radius: var(--rst-radius-sm); |
| + } |
| + [docs-tile-title] a:focus-visible { |
| + outline: none; |
| + } |
| + [docs-tile-title] a:focus-visible::after { |
| + outline: 2px solid var(--rst-accent); |
| + outline-offset: 2px; |
| + } |
| + [docs-tile-meta] { |
| + order: 3; |
| + display: flex; |
| + flex-wrap: wrap; |
| + gap: 0 var(--rst-sp-2); |
| + color: var(--rst-text-muted); |
| + font-size: var(--rst-fs-xs, 0.75rem); |
| + } |
| + /* [docs-thumb] holds a real rendering of the document's page one: |
| + the <svg> inside it is the line boxes the PDF exporter's own |
| + layout placed, through export.PageOne (see preview.go). At shelf |
| + size it reads as the page it is, margins and all, so the box is |
| + the page's own aspect (612 by 792, the viewBox) and the paper is |
| + the literal white a document always is (spec §10.2), in either |
| + theme. An empty document is the same sheet with nothing on it. */ |
| + [docs-thumb] { |
| + order: 1; |
| + display: block; |
| + inline-size: 100%; |
| + aspect-ratio: 612 / 792; |
| + border-radius: 3px; |
| + background: #ffffff; |
| + overflow: hidden; |
| + box-shadow: |
| + 0 0 0 1px light-dark(rgb(23 32 60 / 0.07), rgb(255 255 255 / 0.06)), |
| + 0 1px 2px rgb(23 32 60 / 0.08), |
| + 0 10px 24px -12px light-dark(rgb(23 32 60 / 0.28), rgb(0 0 0 / 0.7)); |
| + transition: transform 180ms cubic-bezier(.2, .7, .2, 1), box-shadow 180ms ease; |
| + } |
| + [docs-thumb] > svg { |
| + display: block; |
| + inline-size: 100%; |
| + block-size: 100%; |
| + } |
| + /* The lines of text, in a soft ink. Nothing about the thumbnail |
| + carries meaning by colour: a heading reads as a heading because |
| + its bar is taller, which is the real ratio between the two type |
| + sizes. */ |
| + [docs-thumb] rect { |
| + fill: #b9c0cc; |
| + } |
| + /* Picking a page up: it lifts and takes the accent's edge. The |
| + motion answers the pointer, and is dropped for reduced motion, |
| + where the edge alone says the same thing. */ |
| + [docs-tile]:hover [docs-thumb], |
| + [docs-tile]:has(a:focus-visible) [docs-thumb] { |
| + transform: translateY(-4px); |
| + box-shadow: |
| + 0 0 0 1.5px var(--rst-accent), |
| + 0 2px 4px rgb(23 32 60 / 0.08), |
| + 0 18px 32px -14px light-dark(rgb(23 32 60 / 0.35), rgb(0 0 0 / 0.8)); |
| + } |
| + [docs-tile]:hover [docs-tile-title] a { |
| + color: var(--rst-accent); |
| + } |
| + @media (prefers-reduced-motion: reduce) { |
| + [docs-thumb] { |
| + transition: none; |
| + } |
| + [docs-tile]:hover [docs-thumb], |
| + [docs-tile]:has(a:focus-visible) [docs-thumb] { |
| + transform: none; |
| + } |
| } |
| /* The way back out of a result page, under the results rather than |
| in the header: it is about the list being shown, not about the |
| controls that produced it. */ |
| [docs-search-clear] { |
| - margin-block-start: var(--rst-sp-3); |
| + margin-block-start: var(--rst-sp-6); |
| font-size: var(--rst-fs-sm); |
| } |
| + [docs-list] [rst-empty] { |
| + margin-block-start: var(--rst-sp-6); |
| + } |
| </style> |
| -<header rst-page-header> |
| - <div rst-page-header-titles> |
| - <h1>{{.Title}}</h1> |
| - </div> |
| +<div docs-list> |
| +<header docs-list-head> |
| + <h1>{{.Title}}</h1> |
| <div docs-header-actions> |
| {{/* Search (spec §15.2's title search). A GET form, so a search |
| is a link — bookmarkable, reloadable, and reachable with the |
| @@ -293,30 +393,27 @@ |
| <form docs-search-form method="get" action="/" role="search"> |
| <input rst-input docs-search-input type="search" name="q" value="{{.Query}}" |
| placeholder="{{.SearchPlace}}" aria-label="{{.SearchLabel}}" autocomplete="off"> |
| - <button rst-btn="ghost" type="submit">{{.SearchLabel}}</button> |
| + <button docs-search-submit type="submit" title="{{.SearchLabel}}" aria-label="{{.SearchLabel}}"><svg viewBox="0 0 20 20" aria-hidden="true" focusable="false"><circle cx="8.5" cy="8.5" r="5.5"/><path d="m13 13 4 4"/></svg></button> |
| </form> |
| {{if .CanCreate}} <form docs-create-form method="post" action="/documents"> |
| - <input rst-input type="text" name="title" placeholder="{{.CreatePlaceholder}}" aria-label="{{.CreateLabel}}" autocomplete="off"> |
| - <button rst-btn="primary" type="submit">{{.CreateLabel}}</button> |
| + <button rst-btn="primary" type="submit"><svg viewBox="0 0 20 20" aria-hidden="true" focusable="false"><path d="M10 4v12M4 10h12"/></svg>{{.CreateLabel}}</button> |
| </form>{{end}} |
| </div> |
| </header> |
| {{if .PartialCatalog}}{{template "callout" (dict "Body" .PartialCatalog "Tone" "warning")}}{{end}} |
| -{{/* Searching renders a ranked, UNGROUPED result list. Recency |
| +{{/* Searching renders a ranked, UNGROUPED result shelf. Recency |
| grouping is what an unfiltered list is for; grouping ranked |
| - results under "Today" and "Earlier" would order the same rows |
| - twice by two different rules and show only the second. */}} |
| + results under "Today" and "Earlier" would order the same pages |
| + twice by two different rules and show only the second. |
| + |
| + Each tile's link comes first in the markup and the paper is put |
| + back above it by order: so a screen reader, and the tab order, |
| + meet the title first, and the page's picture is decoration. */}} |
| {{if .Searching}} |
| {{if .Results}} |
| -<div rst-list> |
| - {{range .Results}} |
| - <div rst-row> |
| - {{template "thumb" .Thumb}} |
| - <span rst-row-main><a href="{{.Href}}">{{.Title}}</a></span> |
| - <span docs-row-when>{{.When}}</span>{{if .SharedNote}}<span rst-muted docs-row-shared>{{.SharedNote}}</span>{{end}} |
| - </div> |
| - {{end}} |
| -</div> |
| +<ul docs-shelf> |
| + {{range .Results}}{{template "tile" .}}{{end}} |
| +</ul> |
| {{else}} |
| <div rst-empty> |
| <h2 rst-empty-title>{{.NoResultsHead}}</h2> |
| @@ -325,16 +422,14 @@ |
| {{end}} |
| <p docs-search-clear><a href="/">{{.ClearLabel}}</a></p> |
| {{else if .Groups}} |
| -<div rst-list> |
| +<div docs-groups> |
| {{range .Groups}} |
| - <h2 docs-group-label>{{.Label}}</h2> |
| - {{range .Rows}} |
| - <div rst-row> |
| - {{template "thumb" .Thumb}} |
| - <span rst-row-main><a href="{{.Href}}">{{.Title}}</a></span> |
| - <span docs-row-when>{{.When}}</span>{{if .SharedNote}}<span rst-muted docs-row-shared>{{.SharedNote}}</span>{{end}} |
| - </div> |
| - {{end}} |
| + <section docs-group> |
| + <h2 docs-group-label>{{.Label}}</h2> |
| + <ul docs-shelf> |
| + {{range .Rows}}{{template "tile" .}}{{end}} |
| + </ul> |
| + </section> |
| {{end}} |
| </div> |
| {{else}} |
| @@ -343,5 +438,6 @@ |
| <p rst-empty-body>{{.EmptyBody}}</p> |
| </div> |
| {{end}} |
| +</div> |
| {{template "docs-jumpto" .}} |
| {{end}} |