diff --git a/Docs/Sprints/2026-11-03-overnight.md b/Docs/Sprints/2026-11-03-overnight.md index 37b1424d..6e532abd 100644 --- a/Docs/Sprints/2026-11-03-overnight.md +++ b/Docs/Sprints/2026-11-03-overnight.md @@ -15,8 +15,8 @@ 1. Completed: B1 ribbon order and regression coverage. 2. Completed: B2 compact Locations drag controls and PWA width. -3. In progress: B3 clickable project/book covers and titles. -4. B4 investigate and retire obsolete Phase 1 Checklist safely. +3. Completed: B3 clickable project/book covers and titles. +4. In progress: B4 investigate and retire obsolete Phase 1 Checklist safely. 5. C shared workspace resizing and maximisation, starting with Relationships reference. 6. D UX audit and repairs. 7. E functional reliability repairs. @@ -46,3 +46,9 @@ Replaced the standalone dropdown panel with compact Change parent / Create relat Verification: solution build passed (0 warnings/errors); location browser regression passed, including keyboard activation, persistence, both drag modes, confirmation/cancellation, invalid targets, concurrent server rejection and scroll preservation. Repaired a stale fixture to read the shared confirmation partial, and explicitly scrolled the dragged source into view after toolbar keyboard use. Full harness rerun in progress. B1 commit: 7f19319. + +### B3 — Project and book cover navigation + +Linked active project cover stacks and missing-cover initials to the same Projects/Details route as Open. Linked Project Overview book covers (including the default placeholder) to the existing Books/Details route. Existing titles already use those routes. Edit, Archive and More remain independent siblings. Added pointer, hover and visible keyboard focus treatment. + +Verification: solution build passed; rendered Razor browser regression passed for real covers, missing covers, title/Open route equality, keyboard activation and focus in browser/PWA modes. Added isolated Projects listing data to the existing browser host. B2 full harness rerun passed (exit 0). B2 commit: d6be496. diff --git a/PlotLine.Tests/Browser/cover-navigation.cjs b/PlotLine.Tests/Browser/cover-navigation.cjs new file mode 100644 index 00000000..558a28a9 --- /dev/null +++ b/PlotLine.Tests/Browser/cover-navigation.cjs @@ -0,0 +1,35 @@ +const { chromium } = require('playwright'); +const assert = require('node:assert/strict'); +(async () => { + const browser = await chromium.launch({ executablePath: process.env.CHROMIUM_PATH }); + try { + for (const standalone of [false, true]) { + const context = await browser.newContext({ viewport: { width: 1440, height: 1000 } }); + if (standalone) await context.addInitScript(() => Object.defineProperty(navigator, 'standalone', { value: true })); + const page = await context.newPage(); + for (const [surface, cardSelector, openLabel] of [['projects', '.project-card', 'Open'], ['dashboard', '.dashboard-book-card', 'Open Book']]) { + await page.goto(`http://127.0.0.1:5238/fixture?page=${surface}`); + const cards = page.locator(cardSelector); + assert.ok(await cards.count()); + for (const card of await cards.all()) { + const cover = card.locator('a.cover-navigation'); + const open = card.getByRole('link', { name: openLabel, exact: true }); + const title = card.locator('h2 a, h3 a'); + const href = await open.getAttribute('href'); + assert.equal(await cover.getAttribute('href'), href); + assert.equal(await title.getAttribute('href'), href); + assert.equal(await cover.locator('a, button, form').count(), 0, 'No nested actions'); + await cover.focus(); + assert.equal(await cover.evaluate(node => node.matches(':focus-visible')), true); + assert.equal(await cover.evaluate(node => getComputedStyle(node).cursor), 'pointer'); + await page.route('**' + href, route => route.fulfill({ body: '

Opened

' })); + await cover.press('Enter'); + await page.waitForURL('**' + href); + await page.goBack(); + } + } + await context.close(); + } + console.log('PASS project/book covers, placeholders and titles share Open routes, keyboard focus and activation in browser/PWA'); + } finally { await browser.close(); } +})().catch(error => { console.error(error); process.exitCode = 1; }); diff --git a/PlotLine.Tests/ToolbarBrowserHost.cs b/PlotLine.Tests/ToolbarBrowserHost.cs index 33037d96..262a6bd7 100644 --- a/PlotLine.Tests/ToolbarBrowserHost.cs +++ b/PlotLine.Tests/ToolbarBrowserHost.cs @@ -275,6 +275,17 @@ internal static class ToolbarBrowserHost NeedsAttention = new() { Warnings = [new() { SeverityName = "Review", WarningTypeName = "Chronology", Message = "Check the order of events at the harbour.", LocationLabel = "Book 1 · Chapter 12" }] } }); } + if (context.Request.Query["page"] == "projects") + { + route.Values["controller"] = "Projects"; + route.Values["action"] = "Index"; + surface = await Render("Projects/Index", new ProjectIndexViewModel { + ActiveProjects = [ + new() { ProjectID = 7, ProjectName = "With cover", CoverThumbnailPaths = ["/images/placeholders/book-cover.svg"] }, + new() { ProjectID = 8, ProjectName = "Without cover" } + ] + }); + } var desktopPage = context.Request.Query["desktop"].ToString(); if (!string.IsNullOrEmpty(desktopPage)) { diff --git a/PlotLine/Views/Projects/Details.cshtml b/PlotLine/Views/Projects/Details.cshtml index bb6e29c9..af767c65 100644 --- a/PlotLine/Views/Projects/Details.cshtml +++ b/PlotLine/Views/Projects/Details.cshtml @@ -133,12 +133,12 @@
-
+ Cover for @book.BookTitle -
+
diff --git a/PlotLine/Views/Projects/Index.cshtml b/PlotLine/Views/Projects/Index.cshtml index 5542dcfc..1b65c7ba 100644 --- a/PlotLine/Views/Projects/Index.cshtml +++ b/PlotLine/Views/Projects/Index.cshtml @@ -149,7 +149,7 @@ else @foreach (var project in Model.ActiveProjects) {
- +
diff --git a/PlotLine/wwwroot/css/site.css b/PlotLine/wwwroot/css/site.css index 3ce953b6..31ac33f9 100644 --- a/PlotLine/wwwroot/css/site.css +++ b/PlotLine/wwwroot/css/site.css @@ -7648,3 +7648,7 @@ html[data-standalone="true"] .scene-workspace .scene-workspace-workbench { heigh html[data-standalone="true"] .plotline-shell.location-workspace-shell { max-width: none; } + +.cover-navigation { cursor: pointer; text-decoration: none; } +.cover-navigation:hover { filter: brightness(.94); } +.cover-navigation:focus-visible { outline: 3px solid var(--bs-primary); outline-offset: -3px; }