diff --git a/Docs/Sprints/2026-11-03-overnight.md b/Docs/Sprints/2026-11-03-overnight.md index 17a1015f..50425498 100644 --- a/Docs/Sprints/2026-11-03-overnight.md +++ b/Docs/Sprints/2026-11-03-overnight.md @@ -116,3 +116,9 @@ Live protected HTTPS requests redirect through an HTTP login URL. Development ng Next action for infrastructure review: verify the TLS proxy's forwarded scheme and trusted source addresses, then preserve that scheme at the Development origin with a narrowly trusted configuration. Existing cookies remain Secure, and the edge upgrades HTTP. This is the only deferred confirmed defect. No Production configuration was accessed or modified. The ee9bbec deployment briefly contained the application-only attempt; final deployment will restore the fully verified application behaviour while retaining all sprint improvements through 2f99a3c. No user data or schema changed. + +### B2 follow-up — Literal segmented presentation in the PWA ribbon + +Final visual review showed the two mutually exclusive hierarchy choices were using standard ribbon tiles. Added a declarative segmented contribution style so the existing bound buttons render as compact connected label-only segments. Marked the group essential to retain immediate access; source controls, handlers, persisted mode and help remain canonical. + +Verification: build passed (0 warnings/errors). New real-Razor browser/PWA regression passed across all four themes, checking connected edges, compact height, keyboard activation, pressed state, source-state synchronisation and restored preference. Existing drag/reparent/relationship browser regression passed. Final full harness and toolbar reruns in progress. diff --git a/PlotLine.Tests/Browser/location-controls.cjs b/PlotLine.Tests/Browser/location-controls.cjs new file mode 100644 index 00000000..e04c7e8d --- /dev/null +++ b/PlotLine.Tests/Browser/location-controls.cjs @@ -0,0 +1,33 @@ +const {chromium}=require('playwright'); +const assert=require('node:assert/strict'); +(async()=>{const browser=await chromium.launch();try{ + for(const pwa of [false,true]){ + const context=await browser.newContext({viewport:{width:1440,height:1000}}); + if(pwa)await context.addInitScript(()=>Object.defineProperty(navigator,'standalone',{value:true})); + const page=await context.newPage(),errors=[];page.on('pageerror',e=>errors.push(e.message)); + for(const theme of ['modern-light','modern-dark','warm-light','warm-dark']){ + await page.goto('http://127.0.0.1:5238/fixture?desktop=Locations'); + await page.evaluate(theme=>document.documentElement.dataset.appTheme=theme,theme); + const toolbar=page.locator('.location-hierarchy-toolbar'); + assert.equal(await toolbar.isVisible(),!pwa); + const group=pwa?page.locator('[data-pwa-context-controls] .pd-context-group[aria-label="Location hierarchy"]'):toolbar; + const parent=group.getByRole('button',{name:'Change parent',exact:true}),relationship=group.getByRole('button',{name:'Create relationship',exact:true}); + await parent.waitFor();await relationship.waitFor(); + if(pwa){ + assert.equal(await group.locator('.pd-context-segmented').count(),1); + const a=await parent.boundingBox(),b=await relationship.boundingBox(); + assert.ok(Math.abs(a.x+a.width-b.x)<2,'Segments join without a gap'); + assert.ok(a.height<=36&&b.height<=36,'Compact label-only controls'); + assert.equal(await parent.locator('svg').isVisible(),false); + } + await relationship.focus();await page.keyboard.press('Enter'); + assert.equal(await parent.getAttribute('aria-pressed'),'false');assert.equal(await relationship.getAttribute('aria-pressed'),'true'); + assert.equal(await page.locator('[data-location-drag-action]').inputValue(),'relationship'); + await page.reload(); + assert.equal(await relationship.getAttribute('aria-pressed'),'true','Persisted preference restores through ribbon binding'); + await parent.click(); + } + assert.deepEqual(errors,[]);await context.close(); + } + console.log('PASS compact connected Location hierarchy segments, keyboard selection, persisted state and browser/PWA fallback in four themes'); +}finally{await browser.close();}})().catch(error=>{console.error(error);process.exitCode=1;}); diff --git a/PlotLine/Views/Locations/Index.cshtml b/PlotLine/Views/Locations/Index.cshtml index bd622e28..b88b6844 100644 --- a/PlotLine/Views/Locations/Index.cshtml +++ b/PlotLine/Views/Locations/Index.cshtml @@ -31,7 +31,7 @@ { } -
+
On drop:
diff --git a/PlotLine/wwwroot/css/application-shell.css b/PlotLine/wwwroot/css/application-shell.css index 328577df..27d8c8a8 100644 --- a/PlotLine/wwwroot/css/application-shell.css +++ b/PlotLine/wwwroot/css/application-shell.css @@ -691,3 +691,15 @@ html[data-standalone="true"] .story-calendar-toolbar .button-row { html[data-standalone="true"] .story-calendar-toolbar .button-row .btn { width: auto; } + +/* Compact mutually exclusive choices declared by the canonical page controls. */ +.pd-shell .pd-context-segmented { align-items:center; gap:0; } +.pd-shell .pd-context-segmented > .pd-ribbon-command { + flex-direction:row; min-width:0; min-height:32px; padding:5px 10px; + border:1px solid var(--pd-border); border-radius:0; box-shadow:none; + background:var(--pd-control); position:relative; +} +.pd-shell .pd-context-segmented > .pd-ribbon-command:first-child { border-radius:5px 0 0 5px; } +.pd-shell .pd-context-segmented > .pd-ribbon-command:last-child { border-radius:0 5px 5px 0; margin-left:-1px; } +.pd-shell .pd-context-segmented > .pd-ribbon-command[aria-pressed=true] { background:var(--pd-selected); border-color:var(--pd-accent); z-index:1; } +.pd-shell .pd-context-segmented > .pd-ribbon-command > svg { display:none; } diff --git a/PlotLine/wwwroot/js/application-page-context.js b/PlotLine/wwwroot/js/application-page-context.js index dce9b058..8b43e749 100644 --- a/PlotLine/wwwroot/js/application-page-context.js +++ b/PlotLine/wwwroot/js/application-page-context.js @@ -356,6 +356,7 @@ if (region.parentElement?.closest('[data-pwa-header], [data-pwa-context]')) continue; const label = region.dataset.pwaContext || region.dataset.pwaTools || 'Page tools'; if (region.dataset.pwaEssential === 'true') group(label).element.parentElement.dataset.essential = 'true'; + if (region.dataset.pwaSegmented === 'true') group(label).element.classList.add('pd-context-segmented'); if (region.dataset.pwaMenuIcon) group(label, 50, region.dataset.pwaCompact === 'true').icon = region.dataset.pwaMenuIcon; if (region.matches('[data-pwa-help]')) { helpSource ||= region.querySelector(region.matches('h1') ? '[data-help-icon]' : 'h1 [data-help-icon]'); continue; } const commands = region.matches('a, button') ? [region] : region.matches('[data-pwa-context]') ? [...region.querySelectorAll('a, button')] : [...region.querySelectorAll('a.btn, a.dropdown-item, button.btn, button.dropdown-item')];