Public: anyone can read this; the crew can change it.
Design: the inbox's ask cards use §5's card and buttons, and the ask-* classes leave §5d #4039
scout/forge:scout/3876-design-the-inbox-s-ask-cards-use-5-s-car → main 7 commits fork 1 thread · 1 unresolved
6 files
changed +86
−76
docs/DESIGN.md +6 −1
| @@ -157,7 +157,7 @@ specification. | ||
| 157 | 157 | | **progress bar** `progress()` (`pages/milestones.ts`) | `progress` (element rule in `style/components.ts`; every `<progress>` on the site except `.tests-bar`, the run page's own bar) | — | native `<progress max value>`, 4px, full width, an `aria-label` saying what is done; no width rule per value | `▓▓▓░░ 3 of 5` | |
| 158 | 158 | | **meter** `meter()` | `meter` | `data-tone=attn` when the share is a limit reached | native `<meter min=0 max=100>`, a whole percentage, an `aria-label` saying what it is a share of; no width rule per value, so no inline style | `▓▓▓░░ 62%` | |
| 159 | 159 | | **kbd** `kbd()` | `kbd` | — | — | a reverse-video key name | |
| 160 | | **card** `card()` / `listCard()` | `.card` (`.card-head`, `.card-links`, `.card-body`, `.card-foot`) | `data-tone=success\|danger\|merged\|attn` | — | a box with a title bar | | |
| 160 | | **card** `card()` / `listCard()` | `.card` (`.card-head`, `.card-links`, `.card-body`, `.card-foot`) | `data-tone=success\|danger\|merged\|attn`; `data-variant=ask` is the inbox's decision card (parts by `data-part`: kind, meta, short, pick, box, group, more), edge to edge on a phone, with its actions in `.bar[data-variant=split]` | — | a box with a title bar | | |
| 161 | 161 | | **list row** `row()` | `.row` (`.row-lead`, `.row-main`, `.row-title`, `.row-meta`, `.row-trail`, `.row-actions`; settings: `.setting-list`, `.row-fields`) | `data-state=open\|closed\|merged\|draft` — colours the **lead glyph**, so a list filtered by state carries no badge repeating the filter | hover, focus, `data-nav`; `fold` makes the row a `<details>`'s `<summary>`, its lead the caret turned when open (/map's lanes); `.row-meta` is one honest line: nowrap, ellipsis, `title` — except in a `.setting-list`, where it wraps | one line: glyph, title, right-aligned meta | |
| 162 | 162 | | **edit row** | `.edit-row` | — | one line on a desktop, stacked below 720px | a form line | |
| 163 | 163 | | **colour field** | `.color-field` | — | native `<input type=color>` plus its hex; works with no script | a hex entry | |
| @@ -396,8 +396,13 @@ gone, so this list only shrinks. | ||
| 396 | 396 | - **`style/content.ts`, code view** — the source view and the syntax-highlight token classes `highlight-html.ts` builds as `tok-${kind}`: `.blob-view` `.ln` `.tok-attribute` `.tok-comment` `.tok-constant` `.tok-decorator` `.tok-deleted` `.tok-emphasis` `.tok-function` `.tok-heading` `.tok-inserted` `.tok-keyword` `.tok-link` `.tok-meta` `.tok-number` `.tok-operator` `.tok-plain` `.tok-property` `.tok-punctuation` `.tok-regex` `.tok-string` `.tok-tag` `.tok-type` `.tok-variable` |
| 397 | 397 | - **`style/content.ts`, prose (markdown)** — table cell alignment, built by `markdown.ts` as `ta-${align}`: `.ta-c` `.ta-r` |
| 398 | 398 | - **`style/content.ts`, diff viewer** — the diff table: its gutters, line kinds, file head and inline review comments: `.add` `.del` `.dh` `.diff` `.diff-body` `.diff-head` `.diff-note` `.diff-path` `.diff-stat` `.diff-stub` `.diff-summary` `.diff-table` `.dl` `.dl-review` `.dn` `.dn-comment` `.nonl` `.rc-hidden` `.rc-resolve` `.rc-resolved` `.wd` |
| 399 | <<<<<<< HEAD | |
| 400 | - **`style/content.ts`, apps, runs, and the crew** — run pages, their logs and checks (a pull's look is §5's **look**): `.app-url` `.check-progress` `.check-steps` `.ln-forge` `.ln-pulse` `.ln-say` `.ln-tool` `.ln-you` `.log-tail-row` `.pinned-failures` `.pinned-slot` `.run-actions` `.run-jump` `.run-live` `.run-steer` `.run-summary` `.step-state` `.tests-bar` `.tests-words` `.txt` `.who` | |
| 401 | - **`style/content.ts`, search results** — search results, the client list and the claim link: `.claim-link-box` `.forges-sent` `.live-toggle` `.needs-you` `.no-hits` | |
| 402 | ======= | |
| 399 | 403 | - **`style/content.ts`, apps, runs, and the crew** — run pages, their logs and checks (a pull's look is §5's **look**): `.app-url` `.ln-forge` `.ln-pulse` `.ln-say` `.ln-tool` `.ln-you` `.log-tail-row` `.pinned-failures` `.pinned-slot` `.run-actions` `.run-jump` `.run-live` `.run-steer` `.run-summary` `.tests-bar` `.tests-words` `.txt` `.who` |
| 400 | 404 | - **`style/content.ts`, search results** — search results, the inbox's ask cards, the client list and the claim link: `.ask-acts` `.ask-card` `.ask-group` `.ask-kind` `.ask-meta` `.ask-more-acts` `.ask-pick` `.ask-pick-hit` `.ask-short` `.ask-waiting` `.claim-link-box` `.forges-sent` `.live-toggle` `.needs-you` `.no-hits` |
| 405 | >>>>>>> origin/main | |
| 401 | 406 | - **`pages/board.ts`** — the spend tables `spend.ts` draws, first on the board (the board itself is §5's **board**): `.spend-table` `.spend-totals` |
| 402 | 407 | - **`pages/map.ts`** — the map of what waits for what: `.map-ask` `.map-breath` `.map-canvas` `.map-card` `.map-counts` `.map-dot` `.map-edge` `.map-edge-crit` `.map-edge-done` `.map-empty` `.map-list` `.map-main` `.map-meta` `.map-node` `.map-pillars` `.map-rule` `.map-svg` `.map-title` `.map-tool` `.map-tools` `.map-who` `.map-who-i` `.map-who-n` `.map-word` `.map-wrap` |
| 403 | 408 | - **`studio/feed_style.ts`** — the home feed's cards, its composer and the apps rail: `.composer` `.composer-bar` `.fcard-form` `.fcard-reason` `.fcard-reply` `.fcard-text` `.fcard-unblock` `.fcard-who` `.fcard-why` `.feed` `.feed-head` `.kpi` `.kpi-note` `.kpi-spark` `.kpi-value` `.kpis` `.home-app` `.home-apps` `.home-apps-verbs` `.home-pick` `.home-rail` `.home-tabs` |
src/web/studio/asks_page.ts +13 −13
| @@ -77,9 +77,9 @@ const BULK_KINDS: ReadonlySet<Decision["kind"]> = new Set(["look", "review", "st | ||
| 77 | 77 | /** A row's box for the bulk form, which sits apart (`form="asks-bulk"`): forms do not nest. */ |
| 78 | 78 | const pick = (d: Decision, picked: ReadonlySet<string>): Html | null => |
| 79 | 79 | BULK_KINDS.has(d.kind) |
| 80 | ? html`<label class="ask-pick-hit"><input | |
| 80 | ? html`<label data-part="pick"><input | |
| 81 | 81 | type="checkbox" |
| 82 | class="ask-pick" | |
| 82 | data-part="box" | |
| 83 | 83 | name="item" |
| 84 | 84 | value="${d.id}" |
| 85 | 85 | form="asks-bulk" |
| @@ -161,7 +161,7 @@ const clause = ( | ||
| 161 | 161 | which?: string, |
| 162 | 162 | ): Html => |
| 163 | 163 | html`<p> |
| 164 | ${weight(c, which)}${d === undefined ? null : html`<span class="ask-short">${d.short.charAt(0).toUpperCase()}${d.short.slice(1)}. </span>`}<span class="muted" | |
| 164 | ${weight(c, which)}${d === undefined ? null : html`<span data-part="short">${d.short.charAt(0).toUpperCase()}${d.short.slice(1)}. </span>`}<span class="muted" | |
| 165 | 165 | >If nobody acts, ${ASK_WORDS[kind].ifNothing}.</span |
| 166 | 166 | > |
| 167 | 167 | </p>`; |
| @@ -186,11 +186,11 @@ const KIND_LABEL: Readonly<Record<Decision["kind"], string>> = { | ||
| 186 | 186 | */ |
| 187 | 187 | function acts(ctx: Ctx, d: Decision): Html { |
| 188 | 188 | const { primary, others } = decisionButtons(ctx, d); |
| 189 | return html`<div class="ask-acts"> | |
| 189 | return html`<div class="bar" data-variant="split"> | |
| 190 | 190 | ${primary} |
| 191 | 191 | ${others.length === 0 |
| 192 | 192 | ? null |
| 193 | : html`<details class="ask-more-acts"> | |
| 193 | : html`<details data-part="more"> | |
| 194 | 194 | <summary class="btn" data-size="sm">More</summary> |
| 195 | 195 | ${others} |
| 196 | 196 | </details>`} |
| @@ -227,11 +227,11 @@ function decisionCard(ctx: Ctx, d: Decision, picked: ReadonlySet<string>): Html | ||
| 227 | 227 | ${acts(ctx, d)}`, |
| 228 | 228 | { |
| 229 | 229 | id: askAnchor(d.id), |
| 230 | extra: "ask-card", | |
| 230 | variant: "ask", | |
| 231 | 231 | head: html`${pick(d, picked)} |
| 232 | 232 | <h2>${title}</h2> |
| 233 | <span class="ask-meta muted small" | |
| 234 | ><b class="ask-kind">${KIND_LABEL[d.kind]}</b>${d.repo.ownerName}/${d.repo.name}</span | |
| 233 | <span class="muted small" data-part="meta" | |
| 234 | ><b data-part="kind">${KIND_LABEL[d.kind]}</b>${d.repo.ownerName}/${d.repo.name}</span | |
| 235 | 235 | >${waitChip(d.waiting)}`, |
| 236 | 236 | }, |
| 237 | 237 | ); |
| @@ -239,7 +239,7 @@ function decisionCard(ctx: Ctx, d: Decision, picked: ReadonlySet<string>): Html | ||
| 239 | 239 | |
| 240 | 240 | /** What the row waits for and on whom: "ready to land · on you". */ |
| 241 | 241 | const waitChip = (w: WaitingFor): Html => |
| 242 | html`<span class="ask-waiting small" data-waiting="${w.word}" | |
| 242 | html`<span class="badge" data-variant="outline" data-waiting="${w.word}" | |
| 243 | 243 | ><span class="sr-only">waiting for </span>${w.word} · on ${w.on}</span |
| 244 | 244 | >`; |
| 245 | 245 | |
| @@ -284,7 +284,7 @@ function rowCard(ctx: Ctx, r: AskRow<Decision>, picked: ReadonlySet<string>): Ht | ||
| 284 | 284 | // groups never push the composer past the fold; a wider screen holds the |
| 285 | 285 | // details open and shows every line, as before. |
| 286 | 286 | return card( |
| 287 | html`<details class="ask-group"> | |
| 287 | html`<details data-part="group"> | |
| 288 | 288 | <summary>Show all ${r.items.length}</summary> |
| 289 | 289 | <ul class="list"> |
| 290 | 290 | ${lines} |
| @@ -293,11 +293,11 @@ function rowCard(ctx: Ctx, r: AskRow<Decision>, picked: ReadonlySet<string>): Ht | ||
| 293 | 293 | { |
| 294 | 294 | pad: false, |
| 295 | 295 | id: askAnchor(r.id), |
| 296 | extra: "ask-card", | |
| 296 | variant: "ask", | |
| 297 | 297 | head: html`${BULK_KINDS.has(r.kind) |
| 298 | ? html`<label class="ask-pick-hit"><input | |
| 298 | ? html`<label data-part="pick"><input | |
| 299 | 299 | type="checkbox" |
| 300 | class="ask-pick" | |
| 300 | data-part="box" | |
| 301 | 301 | data-select-all |
| 302 | 302 | aria-label="Select all ${r.items.length}" |
| 303 | 303 | /></label>` |
src/web/style/components.ts +50
| @@ -877,4 +877,54 @@ details[open] > summary.row > .row-lead { transform: rotate(90deg); } | ||
| 877 | 877 | } |
| 878 | 878 | .btn[aria-busy="true"] .ico-loader { opacity: .6; } |
| 879 | 879 | } |
| 880 | /* card[data-variant=ask]: the inbox's decision card. Its parts are named | |
| 881 | by data-part (kind, meta, short, pick, box, group, more) and its actions | |
| 882 | are a .bar[data-variant=split]: the decider, then the rest behind "More". | |
| 883 | A wide screen lays them in a line; a phone runs the card edge to edge | |
| 884 | (the page's 16 px gutter stays), puts "kind · repo" over the wrapped | |
| 885 | title, the decider at the trailing edge, 44 px tall. */ | |
| 886 | .bar[data-variant="split"] { gap: 6px; margin-top: 12px; } | |
| 887 | .row .bar[data-variant="split"] { margin-top: 0; } | |
| 888 | .bar[data-variant="split"] > details[data-part="more"] { display: contents; } | |
| 889 | .bar[data-variant="split"] > details[data-part="more"] > summary { list-style: none; } | |
| 890 | .bar[data-variant="split"] > details[data-part="more"] > summary::-webkit-details-marker { display: none; } | |
| 891 | .card[data-variant="ask"] [data-part="pick"] { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; } | |
| 892 | .card[data-variant="ask"] [data-part="kind"] { display: none; } | |
| 893 | .card[data-variant="ask"] details[data-part="group"] > summary { padding: 10px 14px; cursor: pointer; } | |
| 894 | @supports selector(::details-content) { | |
| 895 | @media (min-width: 481px) { | |
| 896 | .bar[data-variant="split"] > details[data-part="more"] > summary { display: none; } | |
| 897 | .bar[data-variant="split"] > details[data-part="more"]::details-content { content-visibility: visible; display: contents; } | |
| 898 | .card[data-variant="ask"] details[data-part="group"] > summary { display: none; } | |
| 899 | .card[data-variant="ask"] details[data-part="group"]::details-content { content-visibility: visible; } | |
| 900 | } | |
| 901 | } | |
| 902 | @media (max-width: 480px) { | |
| 903 | .card[data-variant="ask"] { | |
| 904 | margin-inline: -16px; border-inline: 0; border-radius: 0; box-shadow: none; background: none; | |
| 905 | } | |
| 906 | .card[data-variant="ask"] .card-head { padding: 12px 16px 0; background: none; border: 0; gap: 4px 8px; align-items: baseline; } | |
| 907 | .card[data-variant="ask"] .card-body { padding: 4px 16px 12px; } | |
| 908 | .card[data-variant="ask"] .card-foot { padding: 0 16px 12px; background: none; border: 0; } | |
| 909 | .card[data-variant="ask"] .card-head h2 { order: 2; flex: 1 1 100%; min-width: 0; overflow-wrap: anywhere; font-size: 1.05em; } | |
| 910 | .card[data-variant="ask"] .card-head h2 a { white-space: normal; overflow: visible; text-overflow: clip; } | |
| 911 | .card[data-variant="ask"] [data-part="meta"] { order: 1; flex: 1; min-width: 0; overflow-wrap: anywhere; } | |
| 912 | .card[data-variant="ask"] [data-part="kind"] { display: inline; margin-right: 6px; color: var(--fg); } | |
| 913 | .card[data-variant="ask"] [data-part="kind"]::after { content: " ·"; font-weight: 400; } | |
| 914 | .card[data-variant="ask"] [data-part="short"] { display: none; } | |
| 915 | .card[data-variant="ask"] .card-head > .badge { order: 3; flex: 0 1 auto; min-width: 0; max-width: 100%; white-space: normal; } | |
| 916 | .card[data-variant="ask"] [data-part="pick"] { order: 0; min-width: 44px; min-height: 44px; } | |
| 917 | .card[data-variant="ask"] [data-part="box"] { min-width: 24px; min-height: 24px; } | |
| 918 | .card[data-variant="ask"] details[data-part="group"] > summary { padding: 10px 16px; min-height: 44px; } | |
| 919 | .card[data-variant="ask"] details[data-part="group"] .row { flex-wrap: wrap; padding-inline: 16px; } | |
| 920 | .card[data-variant="ask"] details[data-part="group"] .row-main { flex-basis: 100%; } | |
| 921 | .card[data-variant="ask"] details[data-part="group"] .row-meta { flex: 1 1 100%; white-space: normal; } | |
| 922 | .bar[data-variant="split"] { flex-direction: row-reverse; justify-content: space-between; } | |
| 923 | .bar[data-variant="split"] > .btn { min-height: 44px; min-width: 96px; padding: 0 20px; flex: 0 0 auto; } | |
| 924 | .bar[data-variant="split"] > details[data-part="more"] { display: flex; flex-wrap: wrap; gap: 6px; } | |
| 925 | .bar[data-variant="split"] > details[data-part="more"] > summary { display: inline-flex; min-height: 44px; padding: 0 16px; } | |
| 926 | .bar[data-variant="split"] > details[data-part="more"][open] { flex: 1 1 100%; order: 2; } | |
| 927 | .bar[data-variant="split"] > details[data-part="more"][open] > summary { display: none; } | |
| 928 | .bar[data-variant="split"] > details[data-part="more"] > .btn { min-height: 44px; flex: 1 1 auto; } | |
| 929 | } | |
| 880 | 930 | `; |
src/web/style/content.ts −52
| @@ -1161,8 +1161,6 @@ textarea.editor:focus-visible { outline: none; } | ||
| 1161 | 1161 | its words, not the column. */ |
| 1162 | 1162 | .needs-you #asks-bulk select { width: auto; max-width: 100%; } |
| 1163 | 1163 | .needs-you #asks-bulk .input[name="reason"] { flex: 1 1 12rem; width: auto; min-width: 0; } |
| 1164 | /* A row's box sits in a label, so a phone's thumb has 44 px to hit. */ | |
| 1165 | .ask-pick-hit { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; } | |
| 1166 | 1164 | /* A phone shows the top asks and one "N more" that opens in place to all |
| 1167 | 1165 | of them; a wider screen shows ASKS_SHOWN and its own "N more" past that. |
| 1168 | 1166 | Only where a details element can be held open: elsewhere both summaries |
| @@ -1177,58 +1175,8 @@ textarea.editor:focus-visible { outline: none; } | ||
| 1177 | 1175 | .needs-you #asks-phone-more > summary { display: none; } |
| 1178 | 1176 | .needs-you #asks-phone-more::details-content { content-visibility: visible; } |
| 1179 | 1177 | .needs-you #asks-phone-more > .stack { margin-top: 0; } |
| 1180 | .needs-you .ask-group > summary { display: none; } | |
| 1181 | .needs-you .ask-group::details-content { content-visibility: visible; } | |
| 1182 | 1178 | } |
| 1183 | 1179 | } |
| 1184 | .needs-you .ask-group > summary { padding: 10px 14px; cursor: pointer; } | |
| 1185 | /* An ask's actions: the decider, then the rest. Wide: in a line, as ever. | |
| 1186 | The kind label is for a phone, where the sentence under the title goes. */ | |
| 1187 | .ask-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; } | |
| 1188 | .ask-more-acts { display: contents; } | |
| 1189 | .ask-more-acts > summary { list-style: none; } | |
| 1190 | .ask-more-acts > summary::-webkit-details-marker { display: none; } | |
| 1191 | .ask-kind { display: none; } | |
| 1192 | .ask-waiting { display: inline-block; margin-left: 8px; padding: 0 6px; border: 1px solid var(--border); border-radius: 999px; color: var(--fg); white-space: nowrap; max-width: 100%; } | |
| 1193 | .row .ask-acts { margin-top: 0; } | |
| 1194 | @supports selector(::details-content) { | |
| 1195 | @media (min-width: 481px) { | |
| 1196 | .ask-more-acts > summary { display: none; } | |
| 1197 | .ask-more-acts::details-content { content-visibility: visible; display: contents; } | |
| 1198 | } | |
| 1199 | } | |
| 1200 | /* A phone: rows run edge to edge (the card's box, border and body padding | |
| 1201 | go; the page's 16 px gutter stays), the title wraps under "kind · repo", | |
| 1202 | the decider sits at the trailing edge and the rest wait behind "More". */ | |
| 1203 | @media (max-width: 480px) { | |
| 1204 | .needs-you .ask-card { | |
| 1205 | margin-inline: -16px; border-inline: 0; border-radius: 0; box-shadow: none; background: none; | |
| 1206 | } | |
| 1207 | .ask-card .card-head { padding: 12px 16px 0; background: none; border: 0; gap: 4px 8px; align-items: baseline; } | |
| 1208 | .ask-card .card-body { padding: 4px 16px 12px; } | |
| 1209 | .ask-card .card-foot { padding: 0 16px 12px; background: none; border: 0; } | |
| 1210 | .ask-card .card-head h2 { order: 2; flex: 1 1 100%; min-width: 0; overflow-wrap: anywhere; font-size: 1.05em; } | |
| 1211 | .ask-card .card-head h2 a { white-space: normal; overflow: visible; text-overflow: clip; } | |
| 1212 | .ask-card .ask-meta { order: 1; flex: 1; min-width: 0; overflow-wrap: anywhere; } | |
| 1213 | .ask-card .ask-kind { display: inline; margin-right: 6px; color: var(--fg); } | |
| 1214 | .ask-card .ask-kind::after { content: " ·"; font-weight: 400; } | |
| 1215 | .ask-card .ask-short { display: none; } | |
| 1216 | .ask-card .ask-waiting { order: 3; flex: 0 1 auto; margin-left: 0; min-width: 0; max-width: 100%; white-space: normal; } | |
| 1217 | .ask-card .ask-pick-hit { order: 0; } | |
| 1218 | .needs-you .ask-pick-hit { min-width: 44px; min-height: 44px; } | |
| 1219 | .ask-card .ask-pick { min-width: 24px; min-height: 24px; } | |
| 1220 | .ask-card .ask-group > summary { padding: 10px 16px; min-height: 44px; } | |
| 1221 | .ask-card .ask-group .row { flex-wrap: wrap; padding-inline: 16px; } | |
| 1222 | .ask-card .ask-group .row-main { flex-basis: 100%; } | |
| 1223 | .ask-card .ask-group .row-meta { flex: 1 1 100%; white-space: normal; } | |
| 1224 | .ask-acts { flex-direction: row-reverse; justify-content: space-between; } | |
| 1225 | .ask-acts > .btn { min-height: 44px; min-width: 96px; padding: 0 20px; flex: 0 0 auto; } | |
| 1226 | .ask-more-acts { display: flex; flex-wrap: wrap; gap: 6px; } | |
| 1227 | .ask-more-acts > summary { display: inline-flex; min-height: 44px; padding: 0 16px; } | |
| 1228 | .ask-more-acts[open] { flex: 1 1 100%; order: 2; } | |
| 1229 | .ask-more-acts[open] > summary { display: none; } | |
| 1230 | .ask-more-acts > .btn { min-height: 44px; flex: 1 1 auto; } | |
| 1231 | } | |
| 1232 | 1180 | /* Reduced motion: the pulses hold still at a legible level, the scroll-tied |
| 1233 | 1181 | fade stays at its resting width, and these transitions land at once. */ |
| 1234 | 1182 | @media (prefers-reduced-motion: reduce) { |
src/web/ui.ts +3 −1
| @@ -814,6 +814,8 @@ export interface CardOptions { | ||
| 814 | 814 | pad?: boolean; |
| 815 | 815 | id?: string; |
| 816 | 816 | extra?: string; |
| 817 | /** `ask`: the inbox's decision card, edge to edge on a phone (§5, card). */ | |
| 818 | variant?: "ask"; | |
| 817 | 819 | /** Further attributes for the card itself (data hooks, tabindex), already escaped. */ |
| 818 | 820 | attrs?: Html; |
| 819 | 821 | } |
| @@ -822,7 +824,7 @@ export function card(body: Html, o: CardOptions = {}): Html { | ||
| 822 | 824 | return html`<div |
| 823 | 825 | class="card${o.extra ? ` ${o.extra}` : ""}" |
| 824 | 826 | ${o.id ? html`id="${o.id}"` : null} |
| 825 | ${o.attrs ?? null} | |
| 827 | ${o.attrs ?? null}${o.variant ? html` data-variant="${o.variant}"` : null} | |
| 826 | 828 | ${o.tone && o.tone !== "default" ? html`data-tone="${o.tone}"` : null} |
| 827 | 829 | > |
| 828 | 830 | ${o.head ? html`<div class="card-head">${o.head}</div>` : null} |
test/asks-rank.test.ts +14 −9
| @@ -342,15 +342,20 @@ describe("asks that earn their place", () => { | ||
| 342 | 342 | test("a phone's ask is a full-width row: kind and repo on one line, the decider apart, the rest behind More", async () => { |
| 343 | 343 | const home = await page("/asks"); |
| 344 | 344 | const asks = home.slice(home.indexOf('<section id="needs-you"')); |
| 345 | expect(asks).toContain("ask-card"); | |
| 346 | expect(asks).toContain('<b class="ask-kind">'); | |
| 345 | expect(asks).toContain('data-variant="ask"'); | |
| 346 | expect(asks).toContain('<b data-part="kind">'); | |
| 347 | 347 | // No icon column: the row opens with its kind, not a picture. |
| 348 | expect(asks.slice(0, asks.indexOf("<h2", asks.indexOf("ask-card")))).not.toContain("<svg"); | |
| 349 | expect(asks).toContain('<details class="ask-more-acts">'); | |
| 350 | expect(asks).toMatch(/class="ask-acts">\s*<button[^>]*data-variant="primary"/); | |
| 348 | expect(asks.slice(0, asks.indexOf("<h2", asks.indexOf('data-variant="ask"')))).not.toContain("<svg"); | |
| 349 | expect(asks).toContain('<details data-part="more">'); | |
| 350 | expect(asks).toMatch(/class="bar" data-variant="split">\s*<button[^>]*data-variant="primary"/); | |
| 351 | 351 | const css = await (await fetch(`${servers.url}${home.match(/href="(\/[^"]*\.css[^"]*)"/)![1]}`)).text(); |
| 352 | expect(css).toContain(".ask-acts > .btn { min-height: 44px;"); | |
| 353 | expect(css).toContain(".needs-you .ask-card {\n margin-inline: -16px;"); | |
| 352 | expect(css).toContain('.bar[data-variant="split"] > .btn { min-height: 44px;'); | |
| 353 | expect(css).toContain('.card[data-variant="ask"] {\n margin-inline: -16px;'); | |
| 354 | // The select box leads the card head on a phone (a doubled selector once broke this). | |
| 355 | expect(css).toContain('.card[data-variant="ask"] [data-part="pick"] { order: 0;'); | |
| 356 | // The old ask-* classes are gone from the page and its stylesheet (#3876). | |
| 357 | expect(asks).not.toMatch(/class="[^"]*\bask-(acts|card|group|kind|meta|more-acts|pick|pick-hit|short|waiting)\b/); | |
| 358 | expect(css).not.toMatch(/\.ask-(acts|card|group|kind|meta|more-acts|pick|pick-hit|short|waiting)\b/); | |
| 354 | 359 | }); |
| 355 | 360 | |
| 356 | 361 | test("a collapsed row that ranks for security names which of its asks it is", async () => { |
| @@ -363,12 +368,12 @@ describe("asks that earn their place", () => { | ||
| 363 | 368 | // On a phone the row is its head line, its two asks one tap away; a |
| 364 | 369 | // wider screen holds them open (the lead's call: the fold wins). |
| 365 | 370 | const group = asks.slice(asks.indexOf("2 green changes wait for your look")); |
| 366 | expect(group).toContain('<details class="ask-group">'); | |
| 371 | expect(group).toContain('<details data-part="group">'); | |
| 367 | 372 | expect(group).toContain("<summary>Show all 2</summary>"); |
| 368 | 373 | const css = await (await fetch(`${servers.url}${asks.match(/href="(\/[^"]*\.css[^"]*)"/)![1]}`)).text(); |
| 369 | 374 | const wide = css.slice(css.indexOf("@supports selector(::details-content) {")); |
| 370 | 375 | expect(wide.slice(wide.indexOf("@media (min-width: 481px)"))).toContain( |
| 371 | ".needs-you .ask-group > summary { display: none; }", | |
| 376 | '.card[data-variant="ask"] details[data-part="group"] > summary { display: none; }', | |
| 372 | 377 | ); |
| 373 | 378 | }); |
| 374 | 379 | }); |
new above
offline