You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Repo: jasonhnd/jobs → mirai-shigoto.com. JA-only static Astro site. /compare/* receives 34.4% of entering sessions at ~7s engagement; below 600px the two jobs stack vertically so the page's core promise (side-by-side) disappears.
Base branch is preview. Your PR targets preview. NEVER push, merge, or open a PR to main. Never trigger a production deploy. The owner reviews everything on preview and personally decides promotion.
Visual reference: mockups/shots/pair-4.png, frame-05.png. Written spec wins over mockup pixels. Known mockup deviations you must NOT copy: 就業者数 win-coloring (stays neutral), skills TOP5 folded (stays visible), related pairs folded (stays as today).
Problem
Current first screen at 390px (mockups/shots/live-compare.png): H1 → sub (contains leftover English "side-by-side") → long intro → .ai-fact start. Zero comparison data visible; .versus-hero collapses to one column <600px.
Scope — one template, 20 pages
src/pages/compare/[pair].astro (order, pinned bar, metric rows, folded block, CSS)
Compact <h1> (text unchanged; CSS-only compaction on mobile).
Pinned duel bar directly under the header, mobile only: grid 1fr 34px 1fr; each side is one whole-side <a> (≥44px hit area, §3.2) to that occupation's page, containing the job name (serif) + pill AI {score}/10 (existing .risk-pill low/mid/high classes — note: the live pill system is .risk-pill + --risk-pill-* vars in src/lib/canonical-css.ts; the .m-risk-* classes in styles/mobile-tokens.css are NOT in the live render path). Center vs. Breakpoint fact: the mobile top bar renders only at ≤768px (canonical-css.ts), so pin with position:sticky; top:48px inside @media (max-width:768px) — do not use the 900px figure for this. At ≥769px keep the existing .versus-hero untouched (desktop non-regression); hide the duel bar there.
Metric rows after the bar, all viewports, order: 年収 (平均) / 仕事が減るリスク / 就業者数 / 月間労働時間 / 関連資格 / 求人倍率 — row labels reuse the existing compare-hub label strings verbatim (compare-hub.ts; e.g. it says 関連資格, not 必要資格, and 年収 (平均), not 中央値). Skip a row when either side lacks the value. Data note (authorized):仕事が減るリスク (AIOIS displacement) does NOT exist in the current compare bindings — read it in _compare-bindings.ts via the graph parameter already passed in (graph.occupations.get(...)?.aiRisk?.aiois?.displacement ?? null); skip the row when null. Do not restructure compare-hub.ts. Win-highlight rule: accent the better side ONLY for 年収 (higher), 月間労働時間 (shorter), 求人倍率 (higher). AI scores, 就業者数, 資格 stay neutral.
Folded block<details class="chap"><summary>この比較の読み方・出典</summary> placed after the metric rows and before MeEntry (MeEntry keeps its adjacency to the skills section). Contents in order, byte-identical inner content: the former .sub line (with the copy fix below), the .intro paragraph (keep class="intro" — JSON-LD speakable references it), the 比較すべき主要観点/選び方の判断ヒント grid, the full existing 項目別比較表 table (§3.5 no deletion — headline rows AND full table both stay), the .ai-fact block.
Copy fix (approved): in the sub line replace side-by-side with 並べて.
Unchanged: #wrapper data-attrs + the recent-compare localStorage script (CSP-hashed — byte-identical), skills TOP5 section (visible), FAQ, cross-hub, related pairs, escape-routes.
Invariants
§3.5 (title/meta/JSON-LD/H1 unchanged; sub-line fix is body copy). §3.1 floors; §3.2 tap areas. No new element ids (internal-links baseline); classes only.
Acceptance
PR screenshots: 390×844 before/after of /compare/kango-vs-helper at top AND mid-scroll (bar pinned); desktop ≥1280 after-shot showing .versus-hero unchanged.
No English remains in the sub line.
仕事が減るリスク row renders real displacement values for both sides on /compare/kango-vs-helper (0.6 / 0.5 with current data).
bun run typecheck && bun run test && bun run verify:gates && bun run test:e2e green; add a unit test for the new metric-row binding logic (none exists for _compare-bindings.ts today).
bun run capture:seo-baseline diff clean for title/meta/JSON-LD.
bun run check:csp-hashes: recent-compare script hash unchanged; a new/updated hash only if the shared desktop-open snippet lands here.
Context (read this first)
jasonhnd/jobs→ mirai-shigoto.com. JA-only static Astro site./compare/*receives 34.4% of entering sessions at ~7s engagement; below 600px the two jobs stack vertically so the page's core promise (side-by-side) disappears.preview. Your PR targetspreview. NEVER push, merge, or open a PR tomain. Never trigger a production deploy. The owner reviews everything onpreviewand personally decides promotion.preview.docs/MOBILE_SHAPES.md— read §0, §3, §4.4 (this issue).mockups/shots/pair-4.png,frame-05.png. Written spec wins over mockup pixels. Known mockup deviations you must NOT copy: 就業者数 win-coloring (stays neutral), skills TOP5 folded (stays visible), related pairs folded (stays as today).Problem
Current first screen at 390px (
mockups/shots/live-compare.png): H1 → sub (contains leftover English "side-by-side") → long intro →.ai-factstart. Zero comparison data visible;.versus-herocollapses to one column <600px.Scope — one template, 20 pages
src/pages/compare/[pair].astro(order, pinned bar, metric rows, folded block, CSS)src/pages/compare/_compare-bindings.ts(metric-row bindings incl. displacement lookup)Spec
<h1>(text unchanged; CSS-only compaction on mobile).1fr 34px 1fr; each side is one whole-side<a>(≥44px hit area, §3.2) to that occupation's page, containing the job name (serif) + pillAI {score}/10(existing.risk-pill low/mid/highclasses — note: the live pill system is.risk-pill+--risk-pill-*vars insrc/lib/canonical-css.ts; the.m-risk-*classes instyles/mobile-tokens.cssare NOT in the live render path). Centervs.Breakpoint fact: the mobile top bar renders only at ≤768px (
canonical-css.ts), so pin withposition:sticky; top:48pxinside@media (max-width:768px)— do not use the 900px figure for this. At ≥769px keep the existing.versus-herountouched (desktop non-regression); hide the duel bar there.年収 (平均) / 仕事が減るリスク / 就業者数 / 月間労働時間 / 関連資格 / 求人倍率— row labels reuse the existing compare-hub label strings verbatim (compare-hub.ts; e.g. it says 関連資格, not 必要資格, and 年収 (平均), not 中央値). Skip a row when either side lacks the value.Data note (authorized):
仕事が減るリスク(AIOIS displacement) does NOT exist in the current compare bindings — read it in_compare-bindings.tsvia thegraphparameter already passed in (graph.occupations.get(...)?.aiRisk?.aiois?.displacement ?? null); skip the row when null. Do not restructurecompare-hub.ts.Win-highlight rule: accent the better side ONLY for 年収 (higher), 月間労働時間 (shorter), 求人倍率 (higher). AI scores, 就業者数, 資格 stay neutral.
<details class="chap"><summary>この比較の読み方・出典</summary>placed after the metric rows and beforeMeEntry(MeEntry keeps its adjacency to the skills section). Contents in order, byte-identical inner content: the former.subline (with the copy fix below), the.introparagraph (keepclass="intro"— JSON-LDspeakablereferences it), the比較すべき主要観点/選び方の判断ヒントgrid, the full existing項目別比較表table (§3.5 no deletion — headline rows AND full table both stay), the.ai-factblock..chapCSS + desktop-open helper introduced by [mobile][W1] Rankings template: list-first first screen, fold intro/ai-fact/stats (39 pages) #321 (same wave — coordinate so there is ONE shared implementation; if [mobile][W1] Rankings template: list-first first screen, fold intro/ai-fact/stats (39 pages) #321 has not merged yet when you start, include the identical shared snippet and reconcile at merge).side-by-sidewith並べて.#wrapperdata-attrs + the recent-compare localStorage script (CSP-hashed — byte-identical), skills TOP5 section (visible), FAQ, cross-hub, related pairs, escape-routes.Invariants
§3.5 (title/meta/JSON-LD/H1 unchanged; sub-line fix is body copy). §3.1 floors; §3.2 tap areas. No new element
ids (internal-links baseline); classes only.Acceptance
/compare/kango-vs-helperat top AND mid-scroll (bar pinned); desktop ≥1280 after-shot showing.versus-herounchanged./compare/kango-vs-helper(0.6 / 0.5 with current data).bun run typecheck && bun run test && bun run verify:gates && bun run test:e2egreen; add a unit test for the new metric-row binding logic (none exists for_compare-bindings.tstoday).bun run capture:seo-baselinediff clean for title/meta/JSON-LD.bun run check:csp-hashes: recent-compare script hash unchanged; a new/updated hash only if the shared desktop-open snippet lands here.