diff --git a/Docs/ApplicationTheme/PlotDirector.md b/Docs/ApplicationTheme/PlotDirector.md index ad71b456..79710a73 100644 --- a/Docs/ApplicationTheme/PlotDirector.md +++ b/Docs/ApplicationTheme/PlotDirector.md @@ -53,7 +53,7 @@ The standard canvas/section/nested/card/control/chip/event and disabled-text ali ## Typography and visualisation -Existing application sans-serif typography remains structurally unchanged, including page titles; no serif overrides were introduced. UI fonts remain Segoe UI/system sans-serif. The 11 `pd-data-*` colours form the coordinated analytical palette. Story Health/Timeline metric charts consume those tokens, including on live theme changes; axis and chapter labels now use theme text/grid tokens rather than fixed low-contrast literals. Legends/toggles retain named metrics, point markers, and visibility controls. Existing author-chosen plot-line/entity colours are preserved so visual identity and meaning do not change on switching themes. The house theme does not recolour manuscript data. +Typography remains structurally unchanged: dense UI uses the existing application sans-serif; existing low-density editorial headings retain their styling. No new serif overrides were introduced. UI fonts remain Segoe UI/system sans-serif. The 11 `pd-data-*` colours form the coordinated analytical palette. Story Health/Timeline metric charts consume those tokens, including on live theme changes; axis and chapter labels now use theme text/grid tokens rather than fixed low-contrast literals. Legends/toggles retain named metrics, point markers, and visibility controls. Existing author-chosen plot-line/entity colours are preserved so visual identity and meaning do not change on switching themes. The house theme does not recolour manuscript data. ## Preference and public isolation @@ -72,10 +72,10 @@ Select the theme: sign into Development, open the account/name menu at the top r - Metric browser geometry/interaction suite passed after token-based series and label changes. - House palette tests passed on dashboard, Timeline and Relationships at 390/768/1440. -Contrast: primary text 10.45–13.51:1 and muted text 4.59–5.94:1 on six principal surfaces; primary button 11.55:1 (hover 14.47:1); control boundary 3.24:1; focus indicator 5.77–7.35:1; status badges >=5.69:1; all 11 chart series >=4.78:1 against the chart surface. Soft decorative separators are intentionally lighter; colour is not the only state cue. Disabled text is a darker mix of muted/body tokens and retained at full opacity in the house controls. +Contrast: primary text 10.45–13.51:1 and muted text 4.59–5.94:1 on six principal surfaces; primary button 11.55:1 (hover 14.47:1); control boundary 3.24:1; focus indicator 5.77–7.35:1; status badges >=5.69:1; all 11 chart series >=4.09:1 against surface, nested and workspace backgrounds. Soft decorative separators are intentionally lighter; colour is not the only state cue. Disabled text is a darker mix of muted/body tokens and retained at full opacity in the house controls. ## Bounded legacy audit -Corrected the metric-chart hard-coded chapter/axis label styling and fixed per-series palette as part of this theme. Existing authored plot-line colours and relationship type/state colours remain intentional data encodings, not brand overrides. Older illustration/import/review surfaces retain some page-level decorative colours and gradients in plotline-theme.css/site.css; this task does not rewrite those large legacy stylesheets. Their shared controls now consume house primitives. A future audit may standardise those decorative treatments; do not blanket-recolour user-authored data or replace all historical literals. +Corrected the metric-chart hard-coded chapter/axis label styling, fixed per-series palette, analytical/filter panels using literal white, and native range accent as part of this theme. Existing authored plot-line colours and relationship type/state colours remain intentional data encodings, not brand overrides. Older illustration/import/review surfaces retain some page-level decorative colours and gradients in plotline-theme.css/site.css; this task does not rewrite those large legacy stylesheets. Their shared controls now consume house primitives. A future audit may standardise those decorative treatments; do not blanket-recolour user-authored data or replace all historical literals. Deployment and real Development verification are recorded in Deployment.md. diff --git a/PlotLine.Tests/Browser/house-theme-dev.cjs b/PlotLine.Tests/Browser/house-theme-dev.cjs index 96e0ae1d..c7fe3cee 100644 --- a/PlotLine.Tests/Browser/house-theme-dev.cjs +++ b/PlotLine.Tests/Browser/house-theme-dev.cjs @@ -15,10 +15,11 @@ async function inspect(p,mode,width){await p.setViewportSize({width,height:1000} await inspect(page,'web',1440);await inspect(page,'web',390); stage='theme persistence';await page.goto(base+'/Projects');await page.locator('#accountMenuButton').click();assert.equal(await page.locator('[data-app-theme-choice]').count(),7);await page.locator('[data-app-theme-choice=modern-dark]').click();await page.waitForFunction(()=>!document.querySelector('[data-app-theme-choice]').disabled);await page.reload();assert.equal(await page.locator('html').getAttribute('data-app-theme'),'modern-dark');await page.locator('#accountMenuButton').click();await page.locator('[data-app-theme-choice=plotdirector]').click();await page.waitForFunction(()=>!document.querySelector('[data-app-theme-choice]').disabled); stage='install';await page.goto(base+'/Projects');const manifestId=base+'/Projects';await cdp.send('PWA.install',{manifestId,installUrlOrBundleUrl:base+'/Projects'});installed=true;await cdp.send('PWA.changeAppUserSettings',{manifestId,displayMode:'standalone'});const opened=ctx.waitForEvent('page');await cdp.send('PWA.launch',{manifestId,url:base+'/Projects'});const app=await opened;await app.waitForLoadState();assert(await app.evaluate(()=>matchMedia('(display-mode: standalone)').matches));await inspect(app,'pwa',1440);await inspect(app,'pwa',390); -stage='scene areas';await app.setViewportSize({width:1440,height:1000});await app.goto(base+'/Scenes/Edit/'+id.SceneID);for(const area of ['overview','story','people','world','writer','continuity']){await app.locator(`[data-scene-area-command=${area}]`).click();assert.equal(await app.locator(`[data-scene-area-command=${area}]`).getAttribute('aria-pressed'),'true');} -stage='context menu';await app.goto(base+'/Books/Details/'+id.BookID);const target=app.locator('[data-pd-context]').first();assert(await target.count());await target.click({button:'right'});await app.screenshot({path:'/tmp/house-theme-live-context-menu.png'});await app.keyboard.press('Escape'); +stage='scene areas';await app.setViewportSize({width:1440,height:1000});await app.goto(base+'/Scenes/Edit/'+id.SceneID);for(const area of ['overview','story','people','world','writer','continuity']){if(await app.locator('#ribbon-surface').isHidden())await app.locator('[data-ribbon-tab][aria-selected=true]').click();const g=app.locator('.pd-context-group[aria-label="Edit Scene"]');const compact=g.locator('details[data-compact=true]');if(await compact.count()&&!await compact.getAttribute('open'))await compact.locator('summary').click();await g.locator('button.pd-context-command').filter({hasText:new RegExp('^'+area+'$','i')}).click();assert.equal(await app.locator('[data-scene-workspace]').getAttribute('data-scene-area'),area);} +stage='context menu';await app.goto(base+'/Books/Details/'+id.BookID);const target=app.locator('[data-pd-context]').first();assert(await target.count());await target.click({button:'right'});assert(await app.locator('body > .pd-context-popup').isVisible());await app.screenshot({path:'/tmp/house-theme-live-context-menu.png'});await app.keyboard.press('Escape'); stage='modal';await app.locator('#customiseToolbar').evaluate(e=>bootstrap.Modal.getOrCreateInstance(e).show());await app.locator('#customiseToolbar.show').waitFor();await app.screenshot({path:'/tmp/house-theme-live-modal.png'});await app.locator('#customiseToolbar').evaluate(e=>bootstrap.Modal.getInstance(e).hide()); stage='public isolation';for(const theme of ['plotdirector','modern-dark','baby-blue']){await page.evaluate(t=>localStorage.setItem('plotdirector.applicationTheme',t),theme);for(const url of ['/','/features','/writing-problems','/writing-problems/comparing-different-story-versions','/Account/Login']){await page.goto(base+url);assert.equal(await page.locator('html').getAttribute('data-site-theme'),'public');assert.equal(await page.locator('html').getAttribute('data-app-theme'),null);}} stage='PWA login';await app.evaluate(()=>localStorage.setItem('plotdirector.applicationTheme','plotdirector'));await app.goto(base+'/Account/Login');assert.equal(await app.locator('html').getAttribute('data-app-theme'),'plotdirector');await app.screenshot({path:'/tmp/house-theme-live-pwa-login.png'}); +for(const url of ['/','/writing-problems']){await app.goto(base+url);assert.equal(await app.locator('html').getAttribute('data-site-theme'),'public');assert.equal(await app.locator('html').getAttribute('data-app-theme'),null);} console.log('PASS real Development: new-user default; explicit alternate persistence; 10 pages at 390/1440 in web and actual installed PWA; Focus/Weave; six Scene areas; modal/context menu; public and web-login isolation across three cached themes; PWA login.'); }catch(e){console.error('FAILED',stage,e.message);process.exitCode=1;}finally{if(installed)await cdp.send('PWA.uninstall',{manifestId:base+'/Projects'}).catch(()=>{});await ctx.close();fs.rmSync(profile,{recursive:true,force:true});}})(); diff --git a/PlotLine.Tests/Browser/house-theme.cjs b/PlotLine.Tests/Browser/house-theme.cjs index b78a2821..3da4fb21 100644 --- a/PlotLine.Tests/Browser/house-theme.cjs +++ b/PlotLine.Tests/Browser/house-theme.cjs @@ -9,7 +9,7 @@ const pairs=await page.evaluate(()=>{ checks.push(['button',ratio(token('on-accent'),token('accent')),4.5],['button hover',ratio(token('on-accent'),token('accent-hover')),4.5],['control boundary',ratio(token('border'),token('surface')),3]); for(const bg of ['workspace','surface','selected'])checks.push(['focus/'+bg,ratio(token('focus'),token(bg)),3]); for(const fg of ['success','danger','warning','info'])checks.push([fg+' badge',ratio(token('on-accent'),token(fg)),4.5]); - for(let i=1;i<=11;i++)checks.push(['data '+i,ratio(token('data-'+i),token('surface')),3]);return checks; + for(let i=1;i<=11;i++)for(const bg of ['surface','surface-2','workspace'])checks.push(['data '+i+'/'+bg,ratio(token('data-'+i),token(bg)),3]);return checks; });for(const[name,value,minimum]of pairs)assert(value>=minimum,`${name}: ${value}`);console.log('CONTRAST',JSON.stringify(pairs)); for(const size of [390,768,1440]){await page.setViewportSize({width:size,height:1000});for(const view of ['dashboard','timeline','relationships']){await page.goto('http://127.0.0.1:5238/fixture?page='+view);assert.equal(await page.locator('html').getAttribute('data-app-theme'),'plotdirector');await page.screenshot({path:`/tmp/house-theme-${view}-${size}.png`});}} console.log('PASS house theme: seven choices, selection persists, all surface text/button/status/focus/data contrasts; dashboard, Timeline, relationships at 390/768/1440'); diff --git a/PlotLine/wwwroot/css/application-shell.css b/PlotLine/wwwroot/css/application-shell.css index 43123d9b..bace7c21 100644 --- a/PlotLine/wwwroot/css/application-shell.css +++ b/PlotLine/wwwroot/css/application-shell.css @@ -665,3 +665,8 @@ html[data-app-theme="plotdirector"] .app-layout :is(.btn-outline-success,.btn-ou } html[data-app-theme="plotdirector"] .app-layout :is(.text-bg-warning,.text-bg-info) { color: var(--pd-on-accent) !important; } html[data-app-theme="plotdirector"] .pd-shell [aria-disabled="true"] { opacity: 1; color: var(--pd-disabled-text) !important; } +/* Legacy analytical/filter panels used literal white instead of the shared surface token. */ +html[data-app-theme="plotdirector"] .app-layout :is(.warning-filter-panel,.analytics-section) { + background: var(--pd-section); color: var(--pd-text); border-color: var(--pd-border-subtle); +} +html[data-app-theme="plotdirector"] .app-layout input[type="range"] { accent-color: var(--pd-accent); }