Unify result widths and add accessible in-page screenshot inspection

This commit is contained in:
Nick Beckley 2026-11-02 13:03:56 +00:00
parent d62cc54642
commit fcb9ed9a74
20 changed files with 892 additions and 22 deletions

View File

@ -0,0 +1 @@
PASS clean URLs: 52 direct pages; private evidence/refresh/fresh sharing; Back/Forward; revised diagnosis; 390/1440; JS/no-JS; canonical/OG/structured data; robots; sitemap Development noindex

View File

@ -0,0 +1 @@
PASS editorial: all 52 metadata/content/direct-entry pages; nine crawlable groups reach all 52; nine families × four widths; no overflow; no-JS; preserved previews.

View File

@ -0,0 +1 @@
PASS all 52 real screenshot mappings; 11 view families at 390/768/1440/1920; one responsive variant per primary/secondary demonstration, AVIF/WebP fallback, alt, stable dimensions, clean URLs, full-width canvas, readable column and no overflow.

View File

@ -0,0 +1 @@
PASS dead-end repair: reported four-answer route; changed hypothesis; knowledge search; six-answer rescue/POV/intended-main routes; Plot Lines, timeline/continuity, relationships, scene/chapter, series, knowledge and character arc; evidence variants; optional secondary/article; explicit missing visuals; no article dump; reassurance/insufficient evidence; no-JS; 390/1440px; Back/Forward/Restart; public theme and noindex; signed-out tour CTA; signed-in authorised project/character selector and real workspace redirects.

View File

@ -0,0 +1,366 @@
[
{
"width": 390,
"family": "overview",
"main": 350,
"prose": 350,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/plot-lines-weave.webp",
"bytes": 56158
}
]
},
{
"width": 390,
"family": "plot-map",
"main": 350,
"prose": 350,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/plot-lines-weave.webp",
"bytes": 0
}
]
},
{
"width": 390,
"family": "workflow",
"main": 350,
"prose": 350,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/plot-lines-weave.webp",
"bytes": 0
}
]
},
{
"width": 390,
"family": "chronology",
"main": 350,
"prose": 350,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/timeline-scene-overview.webp",
"bytes": 65928
}
]
},
{
"width": 390,
"family": "people",
"main": 350,
"prose": 350,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/character-records.webp",
"bytes": 31548
}
]
},
{
"width": 390,
"family": "trace",
"main": 350,
"prose": 350,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/character-records.webp",
"bytes": 0
}
]
},
{
"width": 390,
"family": "progression",
"main": 350,
"prose": 350,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/timeline-story-values.webp",
"bytes": 58786
}
]
},
{
"width": 768,
"family": "overview",
"main": 720,
"prose": 720,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/plot-lines-weave.webp",
"bytes": 56158
}
]
},
{
"width": 768,
"family": "plot-map",
"main": 720,
"prose": 720,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/plot-lines-weave.webp",
"bytes": 0
}
]
},
{
"width": 768,
"family": "workflow",
"main": 720,
"prose": 720,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/plot-lines-weave.webp",
"bytes": 0
}
]
},
{
"width": 768,
"family": "chronology",
"main": 720,
"prose": 720,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/timeline-scene-overview.webp",
"bytes": 65928
}
]
},
{
"width": 768,
"family": "people",
"main": 720,
"prose": 720,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/character-records.webp",
"bytes": 31548
}
]
},
{
"width": 768,
"family": "trace",
"main": 720,
"prose": 720,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/character-records.webp",
"bytes": 0
}
]
},
{
"width": 768,
"family": "progression",
"main": 720,
"prose": 720,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/timeline-story-values.webp",
"bytes": 58786
}
]
},
{
"width": 1440,
"family": "overview",
"main": 1140,
"prose": 896,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/plot-lines-weave.webp",
"bytes": 56158
}
]
},
{
"width": 1440,
"family": "plot-map",
"main": 1140,
"prose": 896,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/plot-lines-weave.webp",
"bytes": 0
}
]
},
{
"width": 1440,
"family": "workflow",
"main": 1140,
"prose": 896,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/plot-lines-weave.webp",
"bytes": 0
}
]
},
{
"width": 1440,
"family": "chronology",
"main": 1140,
"prose": 896,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/timeline-scene-overview.webp",
"bytes": 65928
}
]
},
{
"width": 1440,
"family": "people",
"main": 1140,
"prose": 896,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/character-records.webp",
"bytes": 31548
}
]
},
{
"width": 1440,
"family": "trace",
"main": 1140,
"prose": 896,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/character-records.webp",
"bytes": 0
}
]
},
{
"width": 1440,
"family": "progression",
"main": 1140,
"prose": 896,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/timeline-story-values.webp",
"bytes": 58786
}
]
},
{
"width": 1920,
"family": "overview",
"main": 1140,
"prose": 896,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/plot-lines-weave.webp",
"bytes": 56158
}
]
},
{
"width": 1920,
"family": "plot-map",
"main": 1140,
"prose": 896,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/plot-lines-weave.webp",
"bytes": 0
}
]
},
{
"width": 1920,
"family": "workflow",
"main": 1140,
"prose": 896,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/plot-lines-weave.webp",
"bytes": 0
}
]
},
{
"width": 1920,
"family": "chronology",
"main": 1140,
"prose": 896,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/timeline-scene-overview.webp",
"bytes": 65928
}
]
},
{
"width": 1920,
"family": "people",
"main": 1140,
"prose": 896,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/character-records.webp",
"bytes": 31548
}
]
},
{
"width": 1920,
"family": "trace",
"main": 1140,
"prose": 896,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/character-records.webp",
"bytes": 0
}
]
},
{
"width": 1920,
"family": "progression",
"main": 1140,
"prose": 896,
"cls": 0,
"inspectionBytes": [
{
"url": "http://127.0.0.1:5238/images/writing-solver/timeline-story-values.webp",
"bytes": 58786
}
]
}
]

View File

@ -0,0 +1 @@
PASS seven result families × four widths: aligned main/action, shared wider prose/related area; modal fit/aspect, deferred image, keyboard focus/Tab/Escape, close/backdrop, scroll lock/restoration, no new tab or overflow; reassurance recap; no-JS image fallback.

View File

@ -0,0 +1,386 @@
[
{
"slug": "too-many-storylines-to-manage",
"width": 390,
"run": 0,
"lcp": {
"ms": 236,
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"tag": "DIV"
},
"cls": 0,
"resources": [
{
"url": "https://dev.plotdirector.com/css/writing-solver.css?v=rugBH6BDVIaAYOvoikzmDKHG4HFxy2Mhg1dLZwRY8w4",
"transfer": 19979,
"encoded": 19679,
"initiator": "link"
},
{
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"transfer": 176969,
"encoded": 176669,
"initiator": "css"
},
{
"url": "https://dev.plotdirector.com/images/writing-solver/plot-lines-weave-640.avif",
"transfer": 14501,
"encoded": 14201,
"initiator": "img"
}
],
"totalBytes": 922228
},
{
"slug": "too-many-storylines-to-manage",
"width": 390,
"run": 1,
"lcp": {
"ms": 240,
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"tag": "DIV"
},
"cls": 0,
"resources": [
{
"url": "https://dev.plotdirector.com/css/writing-solver.css?v=rugBH6BDVIaAYOvoikzmDKHG4HFxy2Mhg1dLZwRY8w4",
"transfer": 19979,
"encoded": 19679,
"initiator": "link"
},
{
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"transfer": 176969,
"encoded": 176669,
"initiator": "css"
},
{
"url": "https://dev.plotdirector.com/images/writing-solver/plot-lines-weave-640.avif",
"transfer": 14501,
"encoded": 14201,
"initiator": "img"
}
],
"totalBytes": 922228
},
{
"slug": "too-many-storylines-to-manage",
"width": 1440,
"run": 0,
"lcp": {
"ms": 292,
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"tag": "DIV"
},
"cls": 0,
"resources": [
{
"url": "https://dev.plotdirector.com/css/writing-solver.css?v=rugBH6BDVIaAYOvoikzmDKHG4HFxy2Mhg1dLZwRY8w4",
"transfer": 19979,
"encoded": 19679,
"initiator": "link"
},
{
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"transfer": 176969,
"encoded": 176669,
"initiator": "css"
},
{
"url": "https://dev.plotdirector.com/images/writing-solver/plot-lines-weave-960.avif",
"transfer": 24833,
"encoded": 24533,
"initiator": "img"
}
],
"totalBytes": 932560
},
{
"slug": "too-many-storylines-to-manage",
"width": 1440,
"run": 1,
"lcp": {
"ms": 276,
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"tag": "DIV"
},
"cls": 0,
"resources": [
{
"url": "https://dev.plotdirector.com/css/writing-solver.css?v=rugBH6BDVIaAYOvoikzmDKHG4HFxy2Mhg1dLZwRY8w4",
"transfer": 19979,
"encoded": 19679,
"initiator": "link"
},
{
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"transfer": 176969,
"encoded": 176669,
"initiator": "css"
},
{
"url": "https://dev.plotdirector.com/images/writing-solver/plot-lines-weave-960.avif",
"transfer": 24833,
"encoded": 24533,
"initiator": "img"
}
],
"totalBytes": 932560
},
{
"slug": "relationship-stops-developing",
"width": 390,
"run": 0,
"lcp": {
"ms": 228,
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"tag": "DIV"
},
"cls": 0,
"resources": [
{
"url": "https://dev.plotdirector.com/css/writing-solver.css?v=rugBH6BDVIaAYOvoikzmDKHG4HFxy2Mhg1dLZwRY8w4",
"transfer": 19979,
"encoded": 19679,
"initiator": "link"
},
{
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"transfer": 176969,
"encoded": 176669,
"initiator": "css"
},
{
"url": "https://dev.plotdirector.com/images/writing-solver/relationship-map-640.avif",
"transfer": 12036,
"encoded": 11736,
"initiator": "img"
}
],
"totalBytes": 919763
},
{
"slug": "relationship-stops-developing",
"width": 390,
"run": 1,
"lcp": {
"ms": 212,
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"tag": "DIV"
},
"cls": 0,
"resources": [
{
"url": "https://dev.plotdirector.com/css/writing-solver.css?v=rugBH6BDVIaAYOvoikzmDKHG4HFxy2Mhg1dLZwRY8w4",
"transfer": 19979,
"encoded": 19679,
"initiator": "link"
},
{
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"transfer": 176969,
"encoded": 176669,
"initiator": "css"
},
{
"url": "https://dev.plotdirector.com/images/writing-solver/relationship-map-640.avif",
"transfer": 12036,
"encoded": 11736,
"initiator": "img"
}
],
"totalBytes": 919763
},
{
"slug": "relationship-stops-developing",
"width": 1440,
"run": 0,
"lcp": {
"ms": 228,
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"tag": "DIV"
},
"cls": 0,
"resources": [
{
"url": "https://dev.plotdirector.com/css/writing-solver.css?v=rugBH6BDVIaAYOvoikzmDKHG4HFxy2Mhg1dLZwRY8w4",
"transfer": 19979,
"encoded": 19679,
"initiator": "link"
},
{
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"transfer": 176969,
"encoded": 176669,
"initiator": "css"
},
{
"url": "https://dev.plotdirector.com/images/writing-solver/relationship-map-960.avif",
"transfer": 20434,
"encoded": 20134,
"initiator": "img"
}
],
"totalBytes": 928161
},
{
"slug": "relationship-stops-developing",
"width": 1440,
"run": 1,
"lcp": {
"ms": 372,
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"tag": "DIV"
},
"cls": 0,
"resources": [
{
"url": "https://dev.plotdirector.com/css/writing-solver.css?v=rugBH6BDVIaAYOvoikzmDKHG4HFxy2Mhg1dLZwRY8w4",
"transfer": 19979,
"encoded": 19679,
"initiator": "link"
},
{
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"transfer": 176969,
"encoded": 176669,
"initiator": "css"
},
{
"url": "https://dev.plotdirector.com/images/writing-solver/relationship-map-960.avif",
"transfer": 20434,
"encoded": 20134,
"initiator": "img"
}
],
"totalBytes": 928161
},
{
"slug": "story-order-differs-from-chronology",
"width": 390,
"run": 0,
"lcp": {
"ms": 264,
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"tag": "DIV"
},
"cls": 0,
"resources": [
{
"url": "https://dev.plotdirector.com/css/writing-solver.css?v=rugBH6BDVIaAYOvoikzmDKHG4HFxy2Mhg1dLZwRY8w4",
"transfer": 19979,
"encoded": 19679,
"initiator": "link"
},
{
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"transfer": 176969,
"encoded": 176669,
"initiator": "css"
},
{
"url": "https://dev.plotdirector.com/images/writing-solver/timeline-chronology-640.avif",
"transfer": 18348,
"encoded": 18048,
"initiator": "img"
}
],
"totalBytes": 926075
},
{
"slug": "story-order-differs-from-chronology",
"width": 390,
"run": 1,
"lcp": {
"ms": 208,
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"tag": "DIV"
},
"cls": 0,
"resources": [
{
"url": "https://dev.plotdirector.com/css/writing-solver.css?v=rugBH6BDVIaAYOvoikzmDKHG4HFxy2Mhg1dLZwRY8w4",
"transfer": 19979,
"encoded": 19679,
"initiator": "link"
},
{
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"transfer": 176969,
"encoded": 176669,
"initiator": "css"
},
{
"url": "https://dev.plotdirector.com/images/writing-solver/timeline-chronology-640.avif",
"transfer": 18348,
"encoded": 18048,
"initiator": "img"
}
],
"totalBytes": 926075
},
{
"slug": "story-order-differs-from-chronology",
"width": 1440,
"run": 0,
"lcp": {
"ms": 244,
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"tag": "DIV"
},
"cls": 0,
"resources": [
{
"url": "https://dev.plotdirector.com/css/writing-solver.css?v=rugBH6BDVIaAYOvoikzmDKHG4HFxy2Mhg1dLZwRY8w4",
"transfer": 19979,
"encoded": 19679,
"initiator": "link"
},
{
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"transfer": 176969,
"encoded": 176669,
"initiator": "css"
},
{
"url": "https://dev.plotdirector.com/images/writing-solver/timeline-chronology.avif",
"transfer": 43174,
"encoded": 42874,
"initiator": "img"
}
],
"totalBytes": 950901
},
{
"slug": "story-order-differs-from-chronology",
"width": 1440,
"run": 1,
"lcp": {
"ms": 228,
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"tag": "DIV"
},
"cls": 0,
"resources": [
{
"url": "https://dev.plotdirector.com/css/writing-solver.css?v=rugBH6BDVIaAYOvoikzmDKHG4HFxy2Mhg1dLZwRY8w4",
"transfer": 19979,
"encoded": 19679,
"initiator": "link"
},
{
"url": "https://dev.plotdirector.com/images/public/writing-solver-desk.avif",
"transfer": 176969,
"encoded": 176669,
"initiator": "css"
},
{
"url": "https://dev.plotdirector.com/images/writing-solver/timeline-chronology.avif",
"transfer": 43174,
"encoded": 42874,
"initiator": "img"
}
],
"totalBytes": 950901
}
]

View File

@ -0,0 +1,4 @@
dotnet build PlotLine.slnx: success, zero errors.
dotnet run --no-build --project PlotLine.Tests/PlotLine.Tests.csproj: 395 PASS, including unchanged acceptance/prefix/dead-end/exhaustive checks.
Browser: all 52 editorial/metadata pages; real screenshot mappings/variants; normal journeys including neutral/insufficient, multi-select, Back/Forward/restart and no-JS; Review Mode feedback/export/replay/resume; new seven-family × four-width modal/alignment suite.
Secondary workflow screenshot also opens the same dialog with its correct alt text at 390/1440px.

View File

@ -0,0 +1 @@
PASS Development review: admin-only opt-in; collapsed observer; signal arithmetic; result snapshot/export/replay/resolve/resume; filters; direct-entry unchanged; revision and Back/Forward; multi-select; neutral and insufficient outcomes; no-JS at 390/1440; forged cookie denied.

View File

@ -0,0 +1,26 @@
# Shared result presentation polish
## Width hierarchy
The main result container had expanded to 1140px, while the next-step callout retained a 950px cap, headings a 1050px cap, secondary images an 850px cap, and prose/related sections separate 780/800px caps. These independent leftovers caused accidental steps in the page edges.
The shared solver stylesheet now defines two result widths: `--solver-result-width:71.25rem` (1140px at the normal root size) and `--solver-reading-width:56rem` (896px). The full-width warm visual canvas is unchanged. The result container remains constrained to the main width; the next-step callout fills it naturally without its own max-width. Headings no longer have an additional cap. Recognition, deeper prose, mental-model parent, related material, supporting prose and secondary explanation use the shared reading width. Secondary demonstrations intentionally share that reading measure rather than inventing another image width. The reassurance card uses the reading measure and its introduction fills the card.
Question/entry/discovery layout widths remain separate, established layouts; this does not redesign the public site. Typography, content, hierarchy, primary and secondary recommendations and all image mappings are unchanged. The shared implementation covers all seven diagnostic families; reassurance retains its distinct approved treatment.
## Screenshot inspection
A single shared native `<dialog>` serves all primary and secondary screenshot triggers. The existing anchor and optimised picture/srcset remain, with the new-tab target removed. With JavaScript enabled the link opens the in-page dialog; without JavaScript or native dialog support it remains a working same-tab image link.
The native top layer supplies modal semantics and an inert background. The dialog has a generic accessible heading, one obvious Close control and the selected screenshot's meaningful alt text on the image, without repeating that alt in hidden chrome. Enter opens the keyboard-accessible trigger. Focus moves to Close; Tab/Shift+Tab stay on the sole modal control. Escape, Close and backdrop clicks dismiss it. Closing restores the original trigger focus and the page's prior scroll/overflow/padding state. Scrollbar compensation avoids shifting the underlying content. Normal browser zoom/pinch remains available; no custom zoom application or gallery dependency.
Desktop maximum dimensions are 90vw/90dvh, with a proportional uncropped image. Mobile uses a 12px outer margin and responsive fitted image. The dialog lives inside the existing solver canvas so the public shell's direct-child content-width rule cannot override its viewport dimensions; an initial tablet test identified this additional wrapper interaction.
Normal pages continue to load responsive AVIF/WebP variants. The dialog has no image src until opened, when it loads the existing optimised 1280px WebP (31,248–94,090 bytes across the library). No screenshot derivative, mapping or master changed. A previously inspected image can be reused from the browser cache on a later page with zero transferred bytes; cold initial-page checks do not fetch the inspection image. The lightweight script is scoped to diagnostic pages and adds no dependency.
## Small presentation changes
- “Also indicated by your answers” is now **“You may also want to look at”**. Existing supporting result selection, disclosures and evidence remain untouched.
- The conversation recap has its own `.solver-recap` styling rather than breadcrumb styling: modest gold accent, slightly larger/darker text, clear introductory label and light separators. Its answer text, accessible navigation label and Restart link remain unchanged. It remains secondary to the diagnosis and Start Here.
No scoring, routes, diagnosis data, thresholds, permanent editorial copy, metadata, sitemap, Review Mode or feedback/replay changes. Development deployment and verification are recorded in Deployment.md.

View File

@ -8,5 +8,5 @@ const areas=await page.locator('.solver-browse-areas a').evaluateAll(es=>es.map(
for(const area of areas){await page.goto(base+area);for(const link of await page.locator('.solver-problem-links a').evaluateAll(es=>es.map(e=>e.getAttribute('href'))))discovered.add(link);}
assert.equal(discovered.size,52);
for(const solution of graph.solutions){const article=catalog.pages.find(p=>p.solution===solution.id),path='/writing-problems/'+solution.slug;assert(discovered.has(path));assert.equal((await page.goto(base+path)).status(),200);assert.equal(await page.locator('h1').innerText(),solution.title);assert((await page.title()).includes(article.title));assert.equal(await page.locator('meta[name=description]').getAttribute('content'),article.description);assert((await page.locator('meta[property="og:title"]').getAttribute('content')).includes(article.title));assert.equal(await page.locator('meta[property="og:description"]').getAttribute('content'),article.description);const canonical=await page.locator('link[rel=canonical]').getAttribute('href');assert.equal(canonical,'https://plotdirector.com'+path);assert.equal(await page.locator('meta[property="og:url"]').getAttribute('content'),canonical);const schema=(await page.locator('script[type="application/ld+json"]').allTextContents()).join('');assert(schema.includes(canonical));assert(!schema.includes('FAQPage'));assert.equal(await page.locator('.solver-result-evidence').count(),0);assert.equal(await page.locator('.solver-permanent-copy').count(),1);assert.equal(await page.locator('.solver-permanent-copy li').count(),3);assert.equal(await page.locator('.solver-related li').count(),article.related.length);assert.equal(await page.locator('.solver-result-cta').count(),1);assert.equal(await page.locator('meta[name=robots]').getAttribute('content'),indexed?'index, follow':'noindex, follow');assert(!(await page.locator('body').innerText()).includes('DEVELOPMENT PREVIEW'));}
for(const width of [390,768,1440,1920]){await page.setViewportSize({width,height:1000});for(const id of ['d01','d16','d21','d28','d30','d34','d43','d49','d50']){const s=graph.solutions.find(s=>s.id===id);await page.goto(base+'/writing-problems/'+s.slug);assert.equal(await page.evaluate(()=>document.documentElement.scrollWidth>innerWidth),false);const canvas=await page.locator('.solver-space').boundingBox();assert(canvas.width>=width-2);const copy=await page.locator('.solver-permanent-copy').boundingBox();assert(copy.width<=782);await page.locator('.solver-start').scrollIntoViewIfNeeded();await page.waitForTimeout(100);const img=page.locator('.solver-result-visual img');if(await img.count())assert(await img.evaluate(e=>e.complete&&e.naturalWidth>0));if(id==='d01'&&process.env.EDITORIAL_CAPTURE_DIR){fs.mkdirSync(process.env.EDITORIAL_CAPTURE_DIR,{recursive:true});await page.screenshot({path:process.env.EDITORIAL_CAPTURE_DIR+'/after-'+width+'.png',fullPage:true});}}}
for(const width of [390,768,1440,1920]){await page.setViewportSize({width,height:1000});for(const id of ['d01','d16','d21','d28','d30','d34','d43','d49','d50']){const s=graph.solutions.find(s=>s.id===id);await page.goto(base+'/writing-problems/'+s.slug);assert.equal(await page.evaluate(()=>document.documentElement.scrollWidth>innerWidth),false);const canvas=await page.locator('.solver-space').boundingBox();assert(canvas.width>=width-2);const copy=await page.locator('.solver-permanent-copy').boundingBox();assert(copy.width<=898);await page.locator('.solver-start').scrollIntoViewIfNeeded();await page.waitForTimeout(100);const img=page.locator('.solver-result-visual img');if(await img.count())assert(await img.evaluate(e=>e.complete&&e.naturalWidth>0));if(id==='d01'&&process.env.EDITORIAL_CAPTURE_DIR){fs.mkdirSync(process.env.EDITORIAL_CAPTURE_DIR,{recursive:true});await page.screenshot({path:process.env.EDITORIAL_CAPTURE_DIR+'/after-'+width+'.png',fullPage:true});}}}
await context.close();const nojs=await browser.newContext({javaScriptEnabled:false,viewport:{width:390,height:1000}});const np=await nojs.newPage();await np.goto(base+'/writing-problems/'+graph.solutions[0].slug);assert.equal(await np.locator('.solver-permanent-copy').count(),1);assert.equal(await np.evaluate(()=>document.documentElement.scrollWidth>innerWidth),false);await nojs.close();console.log('PASS editorial: all 52 metadata/content/direct-entry pages; nine crawlable groups reach all 52; nine families × four widths; no overflow; no-JS; preserved previews.');}finally{await browser.close();}})().catch(e=>{console.error(e);process.exit(1)});

View File

@ -0,0 +1,9 @@
const{chromium}=require('playwright'),assert=require('node:assert/strict'),fs=require('node:fs');
const base=process.env.SOLVER_BASE_URL||'http://127.0.0.1:5238';
const graph=JSON.parse(fs.readFileSync('PlotLine/Content/WritingSolver/Candidates/curated-v2-stage1-repair/writing-solver-curated-v2-stage1-repair.json'));
const catalog=JSON.parse(fs.readFileSync('PlotLine/Content/WritingSolver/Presentation/payoff-v1.json'));
(async()=>{const b=await chromium.launch();try{const measurements=[];for(const width of [390,768,1440,1920]){const c=await b.newContext({viewport:{width,height:1000}});await c.addCookies([{name:'solver-anonymous',value:'true',url:base}]);const p=await c.newPage();await p.addInitScript(()=>{window.testCLS=0;new PerformanceObserver(l=>{for(const e of l.getEntries())if(!e.hadRecentInput)window.testCLS+=e.value;}).observe({type:'layout-shift',buffered:true});});
for(const family of [...new Set(catalog.results.map(r=>r.family))]){const map=catalog.results.find(r=>r.family===family),s=graph.solutions.find(s=>s.id===map.solution);const images=[];p.on('request',r=>{if(r.url().includes('/images/writing-solver/'))images.push(r.url())});await p.goto(base+'/writing-problems/'+s.slug);await p.waitForLoadState('networkidle');const main=await p.locator('.solver-content').boundingBox(),action=await p.locator('.solver-author-action').boundingBox(),copy=await p.locator('.solver-permanent-copy').boundingBox(),related=await p.locator('.solver-related').boundingBox();assert(Math.abs(main.x-action.x)<1&&Math.abs(main.width-action.width)<1);assert(Math.abs(copy.x-main.x)<1);assert(Math.abs(related.width-copy.width)<1);assert(copy.width<=896.5);if(width>=1440)assert(copy.width>850);assert.equal(await p.evaluate(()=>document.documentElement.scrollWidth>innerWidth),false);
const trigger=p.locator('.solver-start [data-solver-image]');await trigger.scrollIntoViewIfNeeded();await p.locator('.solver-start .solver-tool-visual img').evaluate(e=>e.decode());const full=await trigger.getAttribute('href');const initialResources=await p.evaluate(()=>performance.getEntriesByType('resource').map(r=>({url:r.name,bytes:r.transferSize})));assert(!initialResources.some(r=>r.url===base+full&&r.bytes>0),'Full inspection WebP transferred before opening '+JSON.stringify({width,family,initialResources}));await trigger.focus();const before=await trigger.boundingBox(),scrollBefore=await p.evaluate(()=>scrollY);await p.keyboard.press('Enter');const dialog=p.getByRole('dialog',{name:'Application screenshot'});await dialog.waitFor({state:'visible'});const large=dialog.locator('img');await large.evaluate(e=>e.decode());assert.equal(await large.getAttribute('alt'),await trigger.locator('img').getAttribute('alt'));assert.equal(await p.evaluate(()=>document.documentElement.style.overflow),'hidden');assert.equal(c.pages().length,1);const box=await dialog.boundingBox(),image=await large.boundingBox();assert(box.width<=(width<=700?width-23:width*.9+1),JSON.stringify({width,family,box}));assert(box.height<=(width<=700?976:901));assert(image.x>=box.x&&image.x+image.width<=box.x+box.width+1);const ratio=await large.evaluate(e=>e.naturalWidth/e.naturalHeight);assert(Math.abs(image.width/image.height-ratio)<.01,'Image was distorted/cropped');assert(await dialog.getByRole('button',{name:'Close screenshot'}).evaluate(e=>e===document.activeElement));await p.keyboard.press('Tab');await p.keyboard.press('Shift+Tab');assert(await p.evaluate(()=>document.activeElement.closest('dialog')!==null),'Tab escaped dialog');await p.keyboard.press('Escape');await dialog.waitFor({state:'hidden'});await p.waitForFunction(()=>document.documentElement.style.overflow!=='hidden');assert(await trigger.evaluate(e=>e===document.activeElement));assert.equal(await p.evaluate(()=>document.documentElement.style.overflow),'');assert.equal(await p.evaluate(()=>scrollY),scrollBefore);const after=await trigger.boundingBox();assert(Math.abs(before.x-after.x)<1&&Math.abs(before.width-after.width)<1,'Scrollbar lock shifted layout');await trigger.click();await dialog.getByRole('button',{name:'Close screenshot'}).click();await dialog.waitFor({state:'hidden'});await trigger.click();await p.mouse.click(2,2);await dialog.waitFor({state:'hidden'});assert.equal(await p.evaluate(()=>document.documentElement.scrollWidth>innerWidth),false);assert((await p.evaluate(()=>window.testCLS))<.01);measurements.push({width,family,main:main.width,prose:copy.width,cls:await p.evaluate(()=>window.testCLS),inspectionBytes:(await p.evaluate(()=>performance.getEntriesByType('resource').filter(r=>r.name.endsWith('.webp')).map(r=>({url:r.name,bytes:r.transferSize})))).filter(r=>r.url===base+full)});p.removeAllListeners('request');}
await p.goto(base+'/writing-problems');for(const choice of ['story-not-working','too-many','lost','deliberate']){await p.locator(`input[name=choices][value="${choice}"]`).check();await p.locator('.solver-form button[type=submit]').click();}assert.equal(await p.locator('.solver-reassurance').count(),1);assert.equal(await p.locator('.solver-recap').count(),1);assert.equal(await p.locator('.solver-recap a').innerText(),'Restart');assert.equal(await p.locator('.solver-recap').getAttribute('aria-label'),'Areas discussed');assert.equal(await p.evaluate(()=>document.documentElement.scrollWidth>innerWidth),false);await c.close();}
const nojs=await b.newContext({javaScriptEnabled:false});const p=await nojs.newPage();await p.goto(base+'/writing-problems/'+graph.solutions[0].slug);assert.equal(await p.locator('[data-solver-image]').first().getAttribute('target'),null);assert((await p.locator('[data-solver-image]').first().getAttribute('href')).endsWith('.webp'));await nojs.close();fs.writeFileSync(process.env.POLISH_METRICS||'/tmp/polish-metrics.json',JSON.stringify(measurements,null,2));console.log('PASS seven result families × four widths: aligned main/action, shared wider prose/related area; modal fit/aspect, deferred image, keyboard focus/Tab/Escape, close/backdrop, scroll lock/restoration, no new tab or overflow; reassurance recap; no-JS image fallback.');}finally{await b.close();}})().catch(e=>{console.error(e);process.exit(1)});

View File

@ -3,7 +3,7 @@ const base=process.env.SOLVER_BASE_URL||'http://127.0.0.1:5238';assert(['127.0.0
const graph=JSON.parse(fs.readFileSync('PlotLine/Content/WritingSolver/Candidates/curated-v2-stage1-repair/writing-solver-curated-v2-stage1-repair.json'));
const catalog=JSON.parse(fs.readFileSync('PlotLine/Content/WritingSolver/Presentation/results-v1.json'));
(async()=>{const b=await chromium.launch();try{const representatives=[];for(const cap of catalog.capabilities){if(representatives.some(c=>c.captureView===cap.captureView))continue;representatives.push(cap);}assert.equal(representatives.length,11);
for(const width of [390,768,1440,1920]){const c=await b.newContext({viewport:{width,height:1100}});const p=await c.newPage();for(const cap of representatives){const result=catalog.results.find(r=>r.capability===cap.id);const solution=graph.solutions.find(s=>s.id===result.solution);const images=[];p.on('requestfinished',r=>{if(r.url().includes('/images/writing-solver/'))images.push(r.url());});await p.goto(base+'/writing-problems/'+solution.slug);const img=p.locator('.solver-start .solver-tool-visual img');await img.scrollIntoViewIfNeeded();await img.evaluate(e=>e.decode());assert(await img.evaluate(e=>e.complete&&e.naturalWidth>0));assert.equal(await img.getAttribute('alt'),cap.imageAlt);assert.equal(await p.locator('.solver-visual-placeholder').count(),0);assert.equal(await p.locator('.solver-start .solver-tool-visual picture').count(),1);assert.equal(await p.locator('.solver-start .solver-tool-visual img').count(),1);assert(!(await p.locator('main').innerText()).includes('Development preview'));assert.equal(await p.locator('.solver-space').evaluate(e=>e.getBoundingClientRect().width),width);assert.equal(await p.evaluate(()=>document.documentElement.scrollWidth>innerWidth),false);assert.equal(new URL(p.url()).search,'');assert(images.length>=1&&images.length<=2&&new Set(images).size===images.length,'Only one variant per primary/secondary demonstration should download');assert.equal(await p.locator('.solver-start .solver-image-link').getAttribute('target'),'_blank');assert((await p.locator('.solver-content').boundingBox()).width<=1140);p.removeAllListeners('requestfinished');}await c.close();}
for(const width of [390,768,1440,1920]){const c=await b.newContext({viewport:{width,height:1100}});const p=await c.newPage();for(const cap of representatives){const result=catalog.results.find(r=>r.capability===cap.id);const solution=graph.solutions.find(s=>s.id===result.solution);const images=[];p.on('requestfinished',r=>{if(r.url().includes('/images/writing-solver/'))images.push(r.url());});await p.goto(base+'/writing-problems/'+solution.slug);const img=p.locator('.solver-start .solver-tool-visual img');await img.scrollIntoViewIfNeeded();await img.evaluate(e=>e.decode());assert(await img.evaluate(e=>e.complete&&e.naturalWidth>0));assert.equal(await img.getAttribute('alt'),cap.imageAlt);assert.equal(await p.locator('.solver-visual-placeholder').count(),0);assert.equal(await p.locator('.solver-start .solver-tool-visual picture').count(),1);assert.equal(await p.locator('.solver-start .solver-tool-visual img').count(),1);assert(!(await p.locator('main').innerText()).includes('Development preview'));assert.equal(await p.locator('.solver-space').evaluate(e=>e.getBoundingClientRect().width),width);assert.equal(await p.evaluate(()=>document.documentElement.scrollWidth>innerWidth),false);assert.equal(new URL(p.url()).search,'');assert(images.length>=1&&images.length<=2&&new Set(images).size===images.length,'Only one variant per primary/secondary demonstration should download');assert.equal(await p.locator('.solver-start .solver-image-link').getAttribute('target'),null);assert.equal(await p.locator('.solver-start .solver-image-link').getAttribute('aria-haspopup'),'dialog');assert((await p.locator('.solver-content').boundingBox()).width<=1140);p.removeAllListeners('requestfinished');}await c.close();}
const c=await b.newContext();const p=await c.newPage();for(const solution of graph.solutions){await p.goto(base+'/writing-problems/'+solution.slug);const img=p.locator('.solver-start .solver-tool-visual img');await img.scrollIntoViewIfNeeded();await img.evaluate(e=>e.decode());assert.equal(await img.count(),1);assert(await img.evaluate(e=>e.naturalWidth>0));assert.equal(await p.locator('.solver-visual-placeholder').count(),0);}
// Test the normal browser fallback when AVIF is unsupported, without changing the application.
await p.route('**/writing-problems/*',async route=>{const response=await route.fetch();await route.fulfill({response,body:(await response.text()).replace('type="image/avif"','type="image/unsupported"')});});await p.goto(base+'/writing-problems/'+graph.solutions[0].slug);await p.locator('.solver-start .solver-tool-visual img').scrollIntoViewIfNeeded();await p.locator('.solver-start .solver-tool-visual img').evaluate(e=>e.decode());assert((await p.locator('.solver-start .solver-tool-visual img').evaluate(e=>e.currentSrc)).endsWith('.webp'));

View File

@ -0,0 +1,5 @@
<dialog id="solver-image-dialog" class="solver-image-dialog" aria-labelledby="solver-image-dialog-title">
<header><h2 id="solver-image-dialog-title">Application screenshot</h2><button type="button" data-solver-image-close aria-label="Close screenshot">Close <span aria-hidden="true">×</span></button></header>
<img alt="" />
<p>Use your browser’s zoom controls for a closer look.</p>
</dialog>

View File

@ -68,7 +68,7 @@
}
@if(Model.Outcome.Answers.Count > 0)
{
<nav class="solver-trail" aria-label="Areas discussed">
<nav class="solver-recap" aria-label="Areas discussed">
<span>We’ve talked about:</span>
@for(var i=0; i<Model.Outcome.Answers.Count; i++)
{
@ -82,6 +82,7 @@
else { <p><a class="editorial-link" href="/writing-problems/browse">Browse writing problems →</a></p><p class="solver-promises">A few quiet minutes <span>·</span> No sign-up required <span>·</span> Advice you can use straight away</p> }
@if(Model.Graph.IsDemo) { <p class="solver-demo">Preview journey · This small plot-line demonstration will grow into a curated collection of writing problems.</p> }
<partial name="Review" model="Model" />
@if(presentation is not null){<partial name="ImageDialog" />}
</div>
</section>
@section Scripts { <script src="~/js/writing-solver.js" asp-append-version="true"></script> }
@section Scripts { @if(presentation is not null){<script src="~/js/writing-solver-image-dialog.js" asp-append-version="true"></script>} <script src="~/js/writing-solver.js" asp-append-version="true"></script> }

View File

@ -29,7 +29,7 @@
@if(ViewData["BackState"] is string back) { <a class="editorial-link" href="/writing-problems?state=@back">← Back</a> }
<a class="marketing-btn marketing-btn--secondary" href="/writing-problems">Start again</a>
</div>
<nav class="solver-trail" aria-label="Areas discussed"><span>We’ve talked about:</span>
<nav class="solver-recap" aria-label="Areas discussed"><span>We’ve talked about:</span>
@foreach(var answer in completed.Outcome.Answers)
{ <span>@string.Join(", ",Model.Graph.Nodes.Single(n=>n.Id==answer.Node).Choices.Where(c=>answer.Choices.Contains(c.Id)).Select(c=>c.Text))</span> }
<a href="/writing-problems">Restart</a>
@ -56,5 +56,8 @@
}
@if(Model.Page.Questions.Count>0 && (Model.IsFeature || Editorial.Find(Model.Page.Id) is null)) { <h2>Questions this helps answer</h2><ul>@foreach(var question in Model.Page.Questions) { <li>@question</li> }</ul> }
<a class="editorial-link" href="/writing-problems">Find a way through your writing problem →</a>
@if(!Model.IsFeature){<partial name="ImageDialog" />}
</div>
</div>
@section Scripts { @if(!Model.IsFeature){<script src="~/js/writing-solver-image-dialog.js" asp-append-version="true"></script>} }

View File

@ -40,7 +40,7 @@
{
var secondary=Results.Capability(content.Secondary);
<aside class="solver-also solver-workflow-next"><strong>Then check</strong><h3><a href="@secondary.Tour">@secondary.Name →</a></h3><p>@content.SecondaryReason</p>
@if(treatment.Family=="workflow"){ ViewData["SolverVisualSizes"]="(max-width: 700px) calc(100vw - 40px), (max-width: 900px) calc(100vw - 48px), 850px"; <partial name="ResultVisual" model="secondary" />}
@if(treatment.Family=="workflow"){ ViewData["SolverVisualSizes"]="(max-width: 700px) calc(100vw - 40px), (max-width: 944px) calc(100vw - 48px), 896px"; <partial name="ResultVisual" model="secondary" />}
</aside>
}
@if(treatment.Family=="progression"){<aside class="solver-principle solver-principle--compact"><strong>Evidence, not a target</strong><p>Read the scenes behind a rise, pause or dip. A graph does not need to be smooth for a novel to work.</p></aside>}
@ -59,7 +59,7 @@
@if(Model.Supporting.Count>0)
{
<section class="solver-supporting" aria-label="Other patterns indicated by your answers">
<h2>Also indicated by your answers</h2>
<h2>You may also want to look at</h2>
@foreach(var item in Model.Supporting)
{
<details class="solver-result solver-result--support"><summary>@item.Solution.Title</summary>

View File

@ -5,7 +5,7 @@
<figure class="solver-tool-visual">
@if(Results.HasImage(Model))
{
<a class="solver-image-link" href="@Model.Image" target="_blank" rel="noopener" aria-label="Enlarge: @Model.ImageAlt (opens in a new tab)">
<a class="solver-image-link" href="@Model.Image" data-solver-image aria-haspopup="dialog" aria-controls="solver-image-dialog">
<picture>
<source type="image/avif" srcset="@Results.ImageSourceSet(Model,"avif")" sizes="@sizes" />
<img src="@Model.Image" srcset="@Results.ImageSourceSet(Model,"webp")" sizes="@sizes" alt="@Model.ImageAlt" width="@Model.ImageWidth" height="@Model.ImageHeight" loading="lazy" decoding="async" />

View File

@ -1,5 +1,6 @@
/* Public-only refinement; application theme tokens never participate. */
html[data-site-theme="public"] {
--solver-result-width:71.25rem; --solver-reading-width:56rem;
--solver-desk-image:url('/images/public/writing-solver-desk.png');
--paper:#fcf3e5; --paper-deep:#f0e2cf; --ink:#30242b; --muted:#71625c;
--line:#dfcdb9; --sage:#e8eadc; --gold:#c7ac67; --gold-dark:#7c733d; --plum:#54223f;
@ -42,9 +43,9 @@ html[data-site-theme="public"] {
.solver-trail { display:flex; flex-wrap:wrap; gap:8px 14px; font-size:.8rem; color:var(--muted); border-top:1px solid var(--line); padding-top:18px; margin:25px 0; }
.solver-trail span:not(:first-child) { max-width:360px; }
.solver-resolution { color:#536b48; margin-bottom:10px; font-size:1rem; }
.solver-principle { padding:22px 26px; background:#f0e3ed; border-left:3px solid #875979; margin:25px 0; max-width:780px; }
.solver-principle { padding:22px 26px; background:#f0e3ed; border-left:3px solid #875979; margin:25px 0; max-width:var(--solver-reading-width); }
.solver-principle p { margin:6px 0 0; font:1.2rem/1.5 Georgia,serif; }
.solver-editorial { font-size:1.06rem; line-height:1.85; max-width:780px; }
.solver-editorial { font-size:1.06rem; line-height:1.85; max-width:var(--solver-reading-width); }
.solver-result .solver-intro { margin-left:0; }
.solver-space h2,.solver-library h2 { font-size:clamp(1.8rem,3vw,2.6rem); margin:35px 0 22px; }
.solver-space h3 { font-size:1.8rem; margin-bottom:12px; }
@ -61,12 +62,12 @@ html[data-site-theme="public"] {
html[data-site-theme="public"] main.marketing-shell > .solver-space { max-width:none; width:100%; }
html[data-site-theme="public"] .public-footer { background:#f0e5d4; }
html[data-site-theme="public"] .solver-neutral { max-width:760px; margin-inline:auto; }
html[data-site-theme="public"] .solver-neutral .solver-intro { margin-left:0; }
html[data-site-theme="public"] .solver-neutral { max-width:var(--solver-reading-width); margin-inline:auto; }
html[data-site-theme="public"] .solver-neutral .solver-intro { margin-left:0; max-width:none; }
/* Conversation results: the existing warm public palette, with a compact practical payoff. */
html[data-site-theme="public"] .solver-result-panel h1 { font-size:clamp(2.15rem,4vw,3.4rem); margin:12px 0 20px; }
html[data-site-theme="public"] .solver-result-evidence { max-width:900px; font:1.12rem/1.6 Georgia,serif; }
html[data-site-theme="public"] .solver-result-evidence { max-width:var(--solver-reading-width); font:1.12rem/1.6 Georgia,serif; }
html[data-site-theme="public"] .solver-result-evidence p { margin:0 0 8px; }
html[data-site-theme="public"] .solver-result-inference { color:var(--plum); }
html[data-site-theme="public"] .solver-principle--compact { padding:14px 20px; margin:20px 0; max-width:none; }
@ -91,11 +92,11 @@ html[data-site-theme="public"] .solver-tool-visual figcaption { font-size:.82rem
html[data-site-theme="public"] .solver-also,html[data-site-theme="public"] .solver-deeper,html[data-site-theme="public"] .solver-supporting { border-top:1px solid var(--line); margin-top:24px; padding-top:18px; }
html[data-site-theme="public"] .solver-also>strong { font-size:.85rem; color:var(--muted); }
html[data-site-theme="public"] .solver-also h3 { font-size:1.3rem; margin:8px 0; }
html[data-site-theme="public"] .solver-also p,html[data-site-theme="public"] .solver-deeper p { margin-bottom:8px; max-width:800px; }
html[data-site-theme="public"] .solver-also p,html[data-site-theme="public"] .solver-deeper p { margin-bottom:8px; max-width:var(--solver-reading-width); }
html[data-site-theme="public"] .solver-supporting h2 { font-size:1.5rem; margin:0 0 15px; }
html[data-site-theme="public"] .solver-result--support { padding:12px 0; border-bottom:1px solid var(--line); }
html[data-site-theme="public"] .solver-result--support summary { cursor:pointer; font:1.18rem/1.4 Georgia,serif; color:var(--plum); }
html[data-site-theme="public"] .solver-result--support p { margin:12px 0 0; }
html[data-site-theme="public"] .solver-result--support p { margin:12px 0 0; max-width:var(--solver-reading-width); }
html[data-site-theme="public"] .solver-workspace-picker { max-width:650px; }
html[data-site-theme="public"] .solver-workspace-picker .marketing-btn { max-width:100%; white-space:normal; }
html[data-site-theme="public"] .solver-workspace-picker select { width:100%; padding:12px; margin:12px 0 20px; background:#fffaf2; border:1px solid #aa8799; border-radius:8px; }
@ -105,12 +106,12 @@ html[data-site-theme="public"] .solver-image-link { display:block; border-radius
html[data-site-theme="public"] .solver-image-link:focus-visible { outline:3px solid var(--plum); outline-offset:4px; }
html[data-site-theme="public"] .solver-image-link img { display:block; }
/* Permanent resources share the result canvas, with a narrower editorial measure. */
html[data-site-theme="public"] .solver-recognition { max-width:780px; font-size:1.13rem; line-height:1.65; margin:18px 0; }
html[data-site-theme="public"] .solver-permanent-copy { max-width:780px; line-height:1.7; margin:24px 0 30px; }
html[data-site-theme="public"] .solver-recognition { max-width:var(--solver-reading-width); font-size:1.13rem; line-height:1.65; margin:18px 0; }
html[data-site-theme="public"] .solver-permanent-copy { max-width:var(--solver-reading-width); line-height:1.7; margin:24px 0 30px; }
html[data-site-theme="public"] :is(.solver-permanent-copy,.solver-related,.solver-browse-areas,.solver-problem-links) h2 { font-size:1.5rem; line-height:1.25; margin:22px 0 12px; }
html[data-site-theme="public"] .solver-permanent-copy li { margin-block:7px; }
html[data-site-theme="public"] .solver-mental-model { border-left:3px solid var(--gold-dark); padding:2px 20px; margin-top:20px; }
html[data-site-theme="public"] .solver-related { max-width:780px; margin-block:30px; }
html[data-site-theme="public"] .solver-related { max-width:var(--solver-reading-width); margin-block:30px; }
html[data-site-theme="public"] :is(.solver-related,.solver-problem-links) ul,html[data-site-theme="public"] .solver-problem-links { list-style:none; padding:0; }
html[data-site-theme="public"] :is(.solver-related,.solver-problem-links) li { padding-block:10px; border-bottom:1px solid var(--line); }
html[data-site-theme="public"] .solver-related li p { margin:6px 0; color:var(--muted); line-height:1.6; }
@ -122,15 +123,15 @@ html[data-site-theme="public"] .solver-browse-areas { max-width:780px; display:g
}
/* Result payoff: one shared warm canvas, seven compositions chosen by the problem. */
html[data-site-theme="public"] .solver-space--article:has(.solver-payoff) .solver-content { width:min(1140px,100%); }
html[data-site-theme="public"] .solver-payoff h1 { max-width:1050px; font-size:clamp(2.1rem,3.6vw,3rem); margin-bottom:16px; }
html[data-site-theme="public"] .solver-space--article:has(.solver-payoff) .solver-content { width:min(var(--solver-result-width),100%); }
html[data-site-theme="public"] .solver-payoff h1 { max-width:none; font-size:clamp(2.1rem,3.6vw,3rem); margin-bottom:16px; }
html[data-site-theme="public"] .solver-payoff .solver-result-heading { margin-bottom:18px; }
html[data-site-theme="public"] .solver-payoff .solver-listening { max-width:none; display:grid; grid-template-columns:1fr 1fr; gap:30px; font:1rem/1.55 "Segoe UI",sans-serif; }
html[data-site-theme="public"] .solver-listening h2 { font:600 1rem/1.4 "Segoe UI",sans-serif; margin:0 0 8px; }
html[data-site-theme="public"] .solver-listening ul { list-style:none; margin:0; padding:0; }
html[data-site-theme="public"] .solver-listening li { position:relative; padding-left:23px; margin-bottom:7px; }
html[data-site-theme="public"] .solver-listening li::before { content:"✓"; position:absolute; left:0; color:#5b7854; }
html[data-site-theme="public"] .solver-author-action { background:var(--sage); border-left:3px solid #75816a; padding:12px 18px; max-width:950px; }
html[data-site-theme="public"] .solver-author-action { background:var(--sage); border-left:3px solid #75816a; padding:12px 18px; }
html[data-site-theme="public"] .solver-author-action strong { font-size:.85rem; color:var(--plum); }
html[data-site-theme="public"] .solver-author-action p { margin:4px 0 0; line-height:1.55; }
html[data-site-theme="public"] .solver-payoff .solver-start { margin-top:18px; }
@ -154,7 +155,7 @@ html[data-site-theme="public"] .solver-payoff--trace .solver-start-copy .solver-
html[data-site-theme="public"] .solver-payoff--overview .solver-author-action { padding:20px 24px; border-radius:14px; border-left:0; }
html[data-site-theme="public"] .solver-payoff--overview .solver-view-shows { color:var(--muted); }
html[data-site-theme="public"] .solver-payoff--workflow .solver-start { border-top:3px solid var(--gold-dark); }
html[data-site-theme="public"] .solver-workflow-next .solver-tool-visual { max-width:850px; margin-top:18px; }
html[data-site-theme="public"] .solver-workflow-next .solver-tool-visual { max-width:var(--solver-reading-width); margin-top:18px; }
html[data-site-theme="public"] .solver-deeper-editorial { border-top:1px solid var(--line); margin-top:32px; padding-top:18px; }
html[data-site-theme="public"] .solver-reassurance { background:linear-gradient(145deg,#e8eadced,#fffaf2e8); padding:30px; border:1px solid #c5ceb9; border-radius:18px; }
html[data-site-theme="public"] .solver-reassurance-seal { display:block; color:#5b7854; font:3rem Georgia,serif; }
@ -174,3 +175,18 @@ html[data-site-theme="public"] .solver-neutral-action h2 { font-size:1.5rem; }
html[data-site-theme="public"] :is(.solver-payoff--plot-map,.solver-payoff--chronology,.solver-payoff--trace) .solver-start-copy .solver-result-cta { grid-column:2; }
html[data-site-theme="public"] .solver-payoff--progression .solver-tool-visual { max-width:100%; }
}
/* Conversation recap, separate from navigation breadcrumbs. */
html[data-site-theme="public"] .solver-recap { display:flex; flex-wrap:wrap; align-items:baseline; gap:8px 16px; margin:26px 0; padding:14px 0 0 14px; border-left:2px solid var(--gold); color:var(--ink); font-size:.94rem; line-height:1.6; }
html[data-site-theme="public"] .solver-recap>span:first-child { color:var(--plum); font-weight:600; }
html[data-site-theme="public"] .solver-recap>span:not(:first-child) { border-bottom:1px solid var(--line); padding-bottom:3px; }
html[data-site-theme="public"] .solver-recap a { color:var(--plum); }
/* One image, no gallery; hidden dialog does not load an image. */
html[data-site-theme="public"] .solver-image-dialog { width:max-content; max-width:90vw; max-height:90dvh; margin:auto; padding:18px; border:1px solid var(--line); border-radius:12px; background:var(--paper); color:var(--ink); overflow:auto; }
html[data-site-theme="public"] .solver-image-dialog::backdrop { background:#20141fc9; }
html[data-site-theme="public"] .solver-image-dialog header { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:12px; }
html[data-site-theme="public"] .solver-image-dialog h2 { font:1.15rem/1.4 Georgia,serif; margin:0; }
html[data-site-theme="public"] .solver-image-dialog button { border:1px solid var(--line); background:var(--paper); color:var(--plum); border-radius:6px; padding:8px 12px; }
html[data-site-theme="public"] .solver-image-dialog img { display:block; width:auto; height:auto; max-width:100%; max-height:calc(90dvh - 9rem); object-fit:contain; margin:auto; }
html[data-site-theme="public"] .solver-image-dialog p { font-size:.85rem; margin:12px 0 0; }
@media(max-width:700px) { html[data-site-theme="public"] .solver-image-dialog { max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); padding:12px; } html[data-site-theme="public"] .solver-image-dialog img { max-height:calc(100dvh - 10rem); } }

View File

@ -0,0 +1,48 @@
(() => {
const dialog = document.getElementById('solver-image-dialog');
if (!dialog || typeof dialog.showModal !== 'function') return;
const image = dialog.querySelector('img');
let trigger, previous;
document.querySelectorAll('[data-solver-image]').forEach(link => {
link.addEventListener('click', event => {
if (event.button !== 0 || event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) return;
event.preventDefault();
trigger = link;
const preview = link.querySelector('img');
image.alt = preview.alt;
image.width = Number(preview.getAttribute('width'));
image.height = Number(preview.getAttribute('height'));
// The existing optimised 1280px WebP is fetched only on inspection.
image.src = link.href;
const gap = window.innerWidth - document.documentElement.clientWidth;
previous = { overflow: document.documentElement.style.overflow, padding: document.body.style.paddingRight };
document.body.style.paddingRight = `${parseFloat(getComputedStyle(document.body).paddingRight) + gap}px`;
document.documentElement.style.overflow = 'hidden';
dialog.showModal();
dialog.querySelector('[data-solver-image-close]').focus();
});
});
dialog.querySelector('[data-solver-image-close]').addEventListener('click', () => dialog.close());
dialog.addEventListener('click', event => {
if (event.target !== dialog) return;
const box = dialog.getBoundingClientRect();
if (event.clientX < box.left || event.clientX > box.right || event.clientY < box.top || event.clientY > box.bottom) dialog.close();
});
// Keep keyboard focus on the sole modal control, including Shift+Tab.
dialog.addEventListener('keydown', event => {
if (event.key === 'Tab') {
event.preventDefault();
dialog.querySelector('[data-solver-image-close]').focus();
}
});
// Native dialog supplies Escape and an inert background.
dialog.addEventListener('close', () => {
if (previous) {
document.documentElement.style.overflow = previous.overflow;
document.body.style.paddingRight = previous.padding;
previous = null;
}
image.removeAttribute('src');
trigger?.focus({ preventScroll: true });
});
})();