docs(theme): accept immutable 1.0 release and local pilots

This commit is contained in:
Joseph Doherty
2026-11-13 16:17:12 -05:00
parent 70c5aa2b4d
commit 73e69ef2b8
119 changed files with 34816 additions and 65 deletions
@@ -0,0 +1,31 @@
"""One confirmation of disconnected-SSR-node measurements and viewport zoom captures."""
from pathlib import Path
import json
from playwright.sync_api import sync_playwright
from browser_zoom import zoom_browser,set_browser_zoom
ORIGIN='http://127.0.0.1:5199'
OUT=Path(__file__).parent/'scadabridge-confirmation';OUT.mkdir(exist_ok=True)
results=[]
with sync_playwright() as p:
with zoom_browser(p,width=1440,height=1000) as (context,worker):
for width,scheme,kind,zoom in [(w,s,'root',1) for w in (1440,1024,390) for s in ('light','dark')]+[(1440,s,'login',1) for s in ('light','dark')]+[(1440,s,'root',2) for s in ('light','dark')]:
page=context.new_page();page.set_viewport_size({'width':width,'height':1000});page.emulate_media(reduced_motion='reduce',color_scheme=scheme)
route='/login' if kind=='login' else '/';page.goto(ORIGIN+route,wait_until='domcontentloaded')
# Selecting the current element and reading styles in one synchronous JS call
# avoids holding a prerender node while Blazor swaps it during hydration.
motion=page.evaluate('''s=>{const e=document.querySelector(s);if(!e)return {missing:true};const c=getComputedStyle(e);return {connected:e.isConnected,animationName:c.animationName,animationDuration:c.animationDuration,opacity:c.opacity,transform:c.transform,reduced:matchMedia('(prefers-reduced-motion: reduce)').matches};}''','.login-wrap.rise' if kind=='login' else '#canary-rise')
page.wait_for_load_state('networkidle');page.evaluate('s=>window.sbTheme.set(s)',scheme)
record={'width':width,'scheme':scheme,'kind':kind,'zoom':zoom,'immediateMotion':motion,'passed':motion.get('connected') and motion.get('reduced') and motion.get('opacity')=='1' and motion.get('animationName')=='none'}
if zoom==2:
record['browserZoom']=set_browser_zoom(worker,page,2)
record['actualLayout']=page.evaluate('({innerWidth,scrollWidth:document.documentElement.scrollWidth,DPR:devicePixelRatio})')
record['passed']=record['passed'] and record['actualLayout']=={'innerWidth':720,'scrollWidth':720,'DPR':2}
record['screenshot']=f'{kind}-{scheme}-{width}-zoom2-viewport.png'
page.screenshot(path=str(OUT/record['screenshot']),full_page=False)
if kind=='root':
record['actualPairs']=page.evaluate('''()=>{let pairs={};for(const [name,s] of Object.entries({primary:'#canary-busy-success',hint:'#canary-field-hint',error:'#canary-field-error'})){const e=document.querySelector(s);const c=getComputedStyle(e);let p=e,bg;while(p){const pc=getComputedStyle(p);if(pc.backgroundColor!=='rgba(0, 0, 0, 0)'&&pc.backgroundColor!=='transparent'){bg=pc.backgroundColor;break;}p=p.parentElement;}pairs[name]={color:c.color,background:bg,opacity:c.opacity};}return pairs;}''')
results.append(record)
if zoom==2:set_browser_zoom(worker,page,1)
page.close()
(OUT/'results.json').write_text(json.dumps({'reason':'First-pass nine empty CSS results came from detached SSR nodes; no product/UI code change. Full-page capture at real zoom replaced by viewport capture.','results':results,'allPassed':all(x['passed'] for x in results)},indent=2)+'\n')
print('Confirmation cases',len(results),'passed',sum(x['passed'] for x in results),'failed',sum(not x['passed'] for x in results))
@@ -0,0 +1,146 @@
"""One bounded real-component inspection of the handed Theme package on loopback."""
from pathlib import Path
import json
from playwright.sync_api import sync_playwright
from browser_zoom import zoom_browser, set_browser_zoom
ORIGIN = 'http://127.0.0.1:5199'
OUT = Path(__file__).parent / 'scadabridge-first-inspection'
OUT.mkdir(exist_ok=True)
FAMILIES = {
'default': ('#2f5fd0','#1e3f99','#eef2fc'),
'historian': ('#2f855a','#1c6540','#edf5f0'),
'btdb': ('#1b7f8e','#125764','#eaf5f6'),
'overview': ('#6d28d9','#4c1d95','#f2ecfc'),
}
results=[]
def rgb(h): return 'rgb('+', '.join(str(int(h[i:i+2],16)) for i in (1,3,5))+')'
def css(page, selector):
return page.locator(selector).first.evaluate('''e=>{let c=getComputedStyle(e);return {color:c.color,background:c.backgroundColor,border:c.borderColor,outlineStyle:c.outlineStyle,outlineWidth:c.outlineWidth,outlineColor:c.outlineColor,boxShadow:c.boxShadow,opacity:c.opacity,animationName:c.animationName,animationDuration:c.animationDuration,transform:c.transform,focusVisible:e.matches(':focus-visible')};}''')
def check(record,name,passed,actual=None):
record['checks'].append({'name':name,'passed':bool(passed),'actual':actual})
def tab_to(page,selector):
page.locator('body').click(position={'x':2,'y':2})
for _ in range(40):
page.keyboard.press('Tab')
if page.locator(selector).first.evaluate('(e)=>e===document.activeElement'):return True
return False
def nav_probe(page,record):
shell=page.locator('details.app-shell').first
narrow=page.evaluate('innerWidth<992')
record['nativeNav']={'narrow':narrow,'pageVisibleClosed':page.locator('main.page').first.is_visible()}
if narrow:
toggle=page.locator('details.app-shell>summary.rail-toggle').first
if shell.get_attribute('open') is not None:toggle.click()
closed=page.locator('main.page').first.is_visible() and not page.locator('.theme-rail').first.is_visible()
toggle.click()
opened=shell.get_attribute('open') is not None and page.locator('.theme-rail').first.is_visible()
toggle.click()
reclosed=shell.get_attribute('open') is None and page.locator('main.page').first.is_visible()
check(record,'native nav opens/closes while retaining page',closed and opened and reclosed,{'closed':closed,'opened':opened,'reclosed':reclosed})
else:check(record,'desktop rail visible',page.locator('.theme-rail').first.is_visible())
def inspect(kind,width,scheme='light',family=None,zoom=1):
page=context.new_page()
page.set_viewport_size({'width':width,'height':1000})
page.emulate_media(reduced_motion='reduce',color_scheme=scheme)
errors=[]
page.on('pageerror',lambda e:errors.append(str(e)))
route='/accent?family='+family if kind=='accent' else ('/login' if kind=='login' else '/')
record={'kind':kind,'family':family,'scheme':scheme,'physicalViewport':width,'zoom':zoom,'checks':[]}
try:
response=page.goto(ORIGIN+route,wait_until='domcontentloaded')
record['status']=response.status
if kind in ('root','login'):
record['immediateReducedMotion']=css(page,'#canary-rise' if kind=='root' else '.login-wrap.rise')
c=record['immediateReducedMotion'];check(record,'reduced motion content immediately visible',c['opacity']=='1' and c['animationName']=='none',c)
page.wait_for_load_state('networkidle')
page.wait_for_function('window.Blazor!==undefined && window.sbTheme!==undefined')
if scheme=='dark':page.evaluate("window.sbTheme.set('dark')")
else:page.evaluate("window.sbTheme.set('light')")
if zoom!=1:
record['browserZoom']=set_browser_zoom(worker,page,zoom)
check(record,'real 200% browser zoom',page.evaluate('innerWidth')==width/2 and page.evaluate('devicePixelRatio')==2,{'innerWidth':page.evaluate('innerWidth'),'DPR':page.evaluate('devicePixelRatio')})
record['viewport']=page.evaluate('({innerWidth,innerHeight,DPR:devicePixelRatio})')
overflow=page.evaluate('document.documentElement.scrollWidth>innerWidth')
check(record,'no document horizontal overflow',not overflow)
if kind!='login':nav_probe(page,record)
if kind=='accent':
accent,deep,tint=FAMILIES[family]
record['activeNav']=css(page,'.rail-link.active')
check(record,'selected nav uses supplied tint',record['activeNav']['background']==rgb(tint),record['activeNav'])
record['primaryNormal']=css(page,'#canary-family-primary')
check(record,'primary normal uses supplied accent',record['primaryNormal']['background']==rgb(accent),record['primaryNormal'])
check(record,'light primary labels white',record['primaryNormal']['color']==rgb('#ffffff'))
record['link']=css(page,'#canary-family-link');record['ghost']=css(page,'#canary-family-ghost')
check(record,'links and ghost use deep ink',record['link']['color']==rgb(deep) and record['ghost']['color']==rgb(deep),{'link':record['link'],'ghost':record['ghost']})
page.locator('#canary-family-primary').hover()
page.wait_for_function("!document.querySelector('#canary-family-primary').getAnimations().some(a=>a.playState==='running')")
record['primaryHover']=css(page,'#canary-family-primary')
check(record,'primary hover uses supplied deep',record['primaryHover']['background']==rgb(deep),record['primaryHover'])
page.mouse.down()
record['primaryPressed']=css(page,'#canary-family-primary')
check(record,'primary pressed uses supplied deep',record['primaryPressed']['background']==rgb(deep),record['primaryPressed'])
page.mouse.up()
reached=tab_to(page,'#canary-family-primary');record['primaryFocus']=css(page,'#canary-family-primary')
check(record,'keyboard primary focus visible and supplied deep',reached and record['primaryFocus']['focusVisible'] and record['primaryFocus']['outlineStyle']=='solid' and record['primaryFocus']['outlineColor']==rgb(deep),record['primaryFocus'])
check(record,'caller-disabled remains disabled',page.locator('#canary-family-disabled').is_disabled())
record['disabledPrimary']=css(page,'#canary-family-disabled')
record['semanticInfo']=css(page,'.chip-info')
check(record,'semantic info independent blue',record['semanticInfo']['color']==rgb('#1e3f99'),record['semanticInfo'])
elif kind=='root':
field=page.locator('#canary-field')
record['fieldInitial']={'describedBy':field.get_attribute('aria-describedby'),'invalid':field.get_attribute('aria-invalid'),'labelFor':page.locator("label[for='canary-field']").get_attribute('for'),'errorText':page.locator('#canary-field-error').inner_text()}
check(record,'field label hint error association',record['fieldInitial']['describedBy']=='canary-field-hint canary-field-error' and record['fieldInitial']['invalid']=='true',record['fieldInitial'])
page.locator("label[for='canary-field']").click()
check(record,'label activates input',field.evaluate('(e)=>e===document.activeElement'))
field.fill('synthetic label')
page.wait_for_function("document.querySelector('#canary-field').getAttribute('aria-invalid')==='false'")
check(record,'field error clears and removes dead description',field.get_attribute('aria-describedby')=='canary-field-hint' and page.locator('#canary-field-error').count()==0)
reached=tab_to(page,'#canary-from');record['fieldFocus']=css(page,'#canary-from')
expected=rgb('#a7c1ff' if scheme=='dark' else '#1e3f99')
check(record,'actual date control receives visible family focus',reached and record['fieldFocus']['focusVisible'] and record['fieldFocus']['outlineStyle']=='solid' and record['fieldFocus']['outlineColor']==expected,record['fieldFocus'])
check(record,'caller-disabled local action remains disabled',page.locator('#canary-caller-disabled').is_disabled())
for case,busy_text,outcome in [('success','Saving local sample…','Local sample saved.'),('failure','Trying local sample…','Local sample failed. Try again.')]:
button=page.locator('#canary-busy-'+case);button.click()
page.wait_for_function("sel=>document.querySelector(sel).getAttribute('aria-busy')==='true'",arg='#canary-busy-'+case)
pending={'text':button.inner_text(),'disabled':button.is_disabled(),'ariaBusy':button.get_attribute('aria-busy')}
check(record,case+' pending busy label and disabled',busy_text in pending['text'] and pending['disabled'],pending)
page.wait_for_function("text=>document.querySelector('#canary-outcome').textContent===text",arg=outcome)
check(record,case+' local outcome distinct and action restored',not button.is_disabled() and button.get_attribute('aria-busy')=='false',page.locator('#canary-outcome').inner_text())
record['primary']=css(page,'#canary-busy-success')
if scheme=='dark':check(record,'proposed supported dark on-accent ink applied',record['primary']['color']==rgb('#111827'),record['primary'])
field.fill('')
page.wait_for_function("document.querySelector('#canary-field').getAttribute('aria-invalid')==='true'")
else:
reached=tab_to(page,'#username');record['loginFocus']=css(page,'#username')
check(record,'actual login keyboard focus visible',reached and record['loginFocus']['focusVisible'] and record['loginFocus']['outlineStyle']=='solid',record['loginFocus'])
page.evaluate('document.fonts.ready')
filename=f'{kind}-{family or "scadabridge"}-{scheme}-{width}-zoom{zoom}.png'
page.screenshot(path=str(OUT/filename),full_page=True)
record['screenshot']=filename
except Exception as e:
record['exception']=str(e)
check(record,'inspection completed',False,str(e))
try:page.screenshot(path=str(OUT/f'error-{kind}-{family or scheme}-{width}-zoom{zoom}.png'),full_page=True)
except Exception:pass
finally:
record['pageErrors']=errors
check(record,'no browser page errors',not errors,errors)
if zoom!=1 and page.url.startswith(ORIGIN):set_browser_zoom(worker,page,1)
page.close()
results.append(record)
(OUT/'results.json').write_text(json.dumps({'origin':ORIGIN,'scope':'4 approved LIGHT accent families; actual CentralUI supported DARK with fixture-only proposed aliases; no other brand dark palettes','results':results},indent=2)+'\n')
print(kind,family or scheme,width,zoom,'failed checks',[x['name'] for x in record['checks'] if not x['passed']],flush=True)
with sync_playwright() as p:
with zoom_browser(p,width=1440,height=1000) as (context,worker):
for width in (1440,1024,390):
for family in FAMILIES:inspect('accent',width,family=family)
for scheme in ('light','dark'):inspect('root',width,scheme=scheme)
for scheme in ('light','dark'):
inspect('root',1440,scheme=scheme,zoom=2)
inspect('login',1440,scheme=scheme)
print('TOTAL CASES',len(results),'FAILED CHECKS',sum(not c['passed'] for r in results for c in r['checks']),flush=True)
@@ -0,0 +1,36 @@
from pathlib import Path
import json, hashlib
from playwright.sync_api import sync_playwright
out=Path('/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/components/ui-theme/validation/theme-1.0.0/scadabridge-pilot');out.mkdir(exist_ok=True)
def lum(rgb):
a=[v/255 for v in rgb];a=[v/12.92 if v<=.04045 else ((v+.055)/1.055)**2.4 for v in a];return sum(a[i]*[.2126,.7152,.0722][i] for i in range(3))
def contrast(a,b):
import re
a=[float(x) for x in re.findall(r'[\d.]+',a)][:3];b=[float(x) for x in re.findall(r'[\d.]+',b)][:3];x,y=sorted([lum(a),lum(b)]);return round((y+.05)/(x+.05),3)
with sync_playwright() as p:
browser=p.chromium.launch(channel='chromium',headless=True);page=browser.new_page(viewport={'width':1440,'height':1100},reduced_motion='reduce');errors=[];page.on('pageerror',lambda e:errors.append(str(e)))
page.goto('http://127.0.0.1:5199/',wait_until='networkidle');page.evaluate("window.sbTheme.set('dark')")
page.locator('.canary-status-row .chip').first.wait_for()
styles=page.evaluate('''()=>{const selectors={primary:'#canary-busy-success',link:'main.page a',selected:'.rail-link.active',ok:'.canary-status-row .chip-ok',warn:'.canary-status-row .chip-warn',bad:'.canary-status-row .chip-bad',idle:'.canary-status-row .chip-idle',info:'.canary-status-row .chip-info',secondary:'#canary-busy-failure'};let result={};for(let [key,sel] of Object.entries(selectors)){const e=document.querySelector(sel);if(!e){result[key]={missing:true};continue;}const c=getComputedStyle(e);let node=e,bg;while(node){const b=getComputedStyle(node).backgroundColor;if(b!=='rgba(0, 0, 0, 0)'&&b!=='transparent'){bg=b;break;}node=node.parentElement;}result[key]={color:c.color,background:bg,selector:sel};}let root=getComputedStyle(document.documentElement);return {pairs:result,tokens:Object.fromEntries(['--accent','--accent-deep','--accent-tint','--accent-focus','--on-accent','--ink-faint','--ok','--warn','--bad','--idle'].map(k=>[k,root.getPropertyValue(k).trim()])),layout:{innerWidth,scrollWidth:document.documentElement.scrollWidth}};}''')
# Keyboard focus, not locator.focus(), to exercise :focus-visible.
page.locator('#canary-field').focus();page.keyboard.press('Tab');styles['focus']=page.locator('#canary-busy-success').evaluate('(e)=>{const c=getComputedStyle(e);return {active:document.activeElement===e,visible:e.matches(":focus-visible"),color:c.outlineColor,width:c.outlineWidth,style:c.outlineStyle}}')
styles['secondaryStates']={}
for state in ['normal','hover','active']:
if state=='hover':page.locator('#canary-busy-failure').hover()
if state=='active':page.mouse.down()
page.wait_for_timeout(200)
pair=page.locator('#canary-busy-failure').evaluate('(e)=>{const c=getComputedStyle(e);return {color:c.color,background:c.backgroundColor}}')
if pair['background']=='rgba(0, 0, 0, 0)':pair['background']='rgb(37, 40, 45)'
pair['contrast']=contrast(pair['color'],pair['background']);styles['secondaryStates'][state]=pair
if state=='active':page.mouse.up()
page.locator('h1').hover()
page.screenshot(path=str(out/'actual-dark-adoption.png'),full_page=True)
for k,v in styles['pairs'].items():
if 'color' in v:v['contrast']=contrast(v['color'],v['background'])
css=page.request.get('http://127.0.0.1:5199/_content/ZB.MOM.WW.ScadaBridge.CentralUI/css/site.css').body();actual=Path('/Users/dohertj2/Desktop/ScadaBridge/src/ZB.MOM.WW.ScadaBridge.CentralUI/wwwroot/css/site.css').read_bytes()
styles['actualStylesheetParity']=hashlib.sha256(css).hexdigest()==hashlib.sha256(actual).hexdigest();styles['siteCssSha256']=hashlib.sha256(actual).hexdigest()
page.locator('h1').hover();page.wait_for_timeout(100);page.evaluate("window.sbTheme.set('light')");styles['lightControl']=page.locator('#canary-busy-success').evaluate('(e)=>{let c=getComputedStyle(e);return {color:c.color,background:c.backgroundColor}}')
styles['browserErrors']=errors
# Secondary is a recorded pre-existing Bootstrap local limitation, not an assertion on the new aliases.
styles['passed']=styles['actualStylesheetParity'] and all(styles['pairs'][k].get('contrast',0)>=4.5 for k in ['primary','ok','warn','bad','idle','info']) and all(not styles['pairs'][k].get('missing') for k in ['link','selected']) and styles['focus']['visible'] and styles['focus']['width']=='2px' and all(v['contrast']>=4.5 for v in styles['secondaryStates'].values()) and not errors
(out/'actual-dark-adoption.json').write_text(json.dumps(styles,indent=2)+'\n');print(json.dumps(styles,indent=2));browser.close()
@@ -0,0 +1,272 @@
[
{
"width": 1440,
"group": "selected",
"text": "Overview",
"foreground": "rgb(76, 29, 149)",
"background": "rgb(242, 236, 252)",
"ratio": 9.483,
"transparentBackgroundConservativePaper": false
},
{
"width": 1440,
"group": "status",
"text": "Polling",
"foreground": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"ratio": 5.555,
"transparentBackgroundConservativePaper": false
},
{
"width": 1440,
"group": "status",
"text": "Up",
"foreground": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"ratio": 5.555,
"transparentBackgroundConservativePaper": false
},
{
"width": 1440,
"group": "status",
"text": "Up",
"foreground": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"ratio": 5.555,
"transparentBackgroundConservativePaper": false
},
{
"width": 1440,
"group": "values",
"text": "1",
"foreground": "rgb(35, 111, 52)",
"background": "rgba(0, 0, 0, 0)",
"ratio": 5.614,
"transparentBackgroundConservativePaper": true
},
{
"width": 1440,
"group": "values",
"text": "0",
"foreground": "rgb(83, 93, 102)",
"background": "rgba(0, 0, 0, 0)",
"ratio": 6.097,
"transparentBackgroundConservativePaper": true
},
{
"width": 1024,
"group": "selected",
"text": "Overview",
"foreground": "rgb(76, 29, 149)",
"background": "rgb(242, 236, 252)",
"ratio": 9.483,
"transparentBackgroundConservativePaper": false
},
{
"width": 1024,
"group": "status",
"text": "Polling",
"foreground": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"ratio": 5.555,
"transparentBackgroundConservativePaper": false
},
{
"width": 1024,
"group": "status",
"text": "Up",
"foreground": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"ratio": 5.555,
"transparentBackgroundConservativePaper": false
},
{
"width": 1024,
"group": "status",
"text": "Up",
"foreground": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"ratio": 5.555,
"transparentBackgroundConservativePaper": false
},
{
"width": 1024,
"group": "values",
"text": "1",
"foreground": "rgb(35, 111, 52)",
"background": "rgba(0, 0, 0, 0)",
"ratio": 5.614,
"transparentBackgroundConservativePaper": true
},
{
"width": 1024,
"group": "values",
"text": "0",
"foreground": "rgb(83, 93, 102)",
"background": "rgba(0, 0, 0, 0)",
"ratio": 6.097,
"transparentBackgroundConservativePaper": true
},
{
"width": 390,
"group": "selected",
"text": "Overview",
"foreground": "rgb(76, 29, 149)",
"background": "rgb(242, 236, 252)",
"ratio": 9.483,
"transparentBackgroundConservativePaper": false
},
{
"width": 390,
"group": "status",
"text": "Polling",
"foreground": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"ratio": 5.555,
"transparentBackgroundConservativePaper": false
},
{
"width": 390,
"group": "status",
"text": "Up",
"foreground": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"ratio": 5.555,
"transparentBackgroundConservativePaper": false
},
{
"width": 390,
"group": "status",
"text": "Up",
"foreground": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"ratio": 5.555,
"transparentBackgroundConservativePaper": false
},
{
"width": 390,
"group": "values",
"text": "1",
"foreground": "rgb(35, 111, 52)",
"background": "rgba(0, 0, 0, 0)",
"ratio": 5.614,
"transparentBackgroundConservativePaper": true
},
{
"width": 390,
"group": "values",
"text": "0",
"foreground": "rgb(83, 93, 102)",
"background": "rgba(0, 0, 0, 0)",
"ratio": 6.097,
"transparentBackgroundConservativePaper": true
},
{
"width": 390,
"group": "selected",
"text": "Overview",
"foreground": "rgb(76, 29, 149)",
"background": "rgb(242, 236, 252)",
"ratio": 9.483,
"transparentBackgroundConservativePaper": false
},
{
"width": 390,
"group": "status",
"text": "Polling",
"foreground": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"ratio": 5.555,
"transparentBackgroundConservativePaper": false
},
{
"width": 390,
"group": "status",
"text": "Up",
"foreground": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"ratio": 5.555,
"transparentBackgroundConservativePaper": false
},
{
"width": 390,
"group": "status",
"text": "Up",
"foreground": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"ratio": 5.555,
"transparentBackgroundConservativePaper": false
},
{
"width": 390,
"group": "values",
"text": "1",
"foreground": "rgb(35, 111, 52)",
"background": "rgba(0, 0, 0, 0)",
"ratio": 5.614,
"transparentBackgroundConservativePaper": true
},
{
"width": 390,
"group": "values",
"text": "0",
"foreground": "rgb(83, 93, 102)",
"background": "rgba(0, 0, 0, 0)",
"ratio": 6.097,
"transparentBackgroundConservativePaper": true
},
{
"width": 390,
"group": "selected",
"text": "Overview",
"foreground": "rgb(76, 29, 149)",
"background": "rgb(242, 236, 252)",
"ratio": 9.483,
"transparentBackgroundConservativePaper": false
},
{
"width": 390,
"group": "status",
"text": "Polling",
"foreground": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"ratio": 5.555,
"transparentBackgroundConservativePaper": false
},
{
"width": 390,
"group": "status",
"text": "Up",
"foreground": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"ratio": 5.555,
"transparentBackgroundConservativePaper": false
},
{
"width": 390,
"group": "status",
"text": "Up",
"foreground": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"ratio": 5.555,
"transparentBackgroundConservativePaper": false
},
{
"width": 390,
"group": "values",
"text": "1",
"foreground": "rgb(35, 111, 52)",
"background": "rgba(0, 0, 0, 0)",
"ratio": 5.614,
"transparentBackgroundConservativePaper": true
},
{
"width": 390,
"group": "values",
"text": "0",
"foreground": "rgb(83, 93, 102)",
"background": "rgba(0, 0, 0, 0)",
"ratio": 6.097,
"transparentBackgroundConservativePaper": true
}
]
Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

@@ -0,0 +1,478 @@
{
"packageSha256": "834d2aad4e61cebff3fb48bbf608d412547d4aa39bdda142d0c7caf24c9e10d0",
"packageSourceRevision": "3d61456d6150145a525a3a646721f865f5680c1b",
"fixture": "Actual Overview host, one registry entry pointing only at its own loopback health",
"assets": {
"css/theme.css": "e3d54b82a1da74fe1cb8386f99d26412f88640ef4042a2a3ce831566c06046ce",
"css/layout.css": "1a4960c5552110f9d1521621816117e6496646b55d919c85f3a815ae98e3a781",
"fonts/ibm-plex-sans-400.woff2": "db71f8a28ad8501544fb4e7668e3c6d0b731760b6f20de3525ebaeba597f1922",
"fonts/ibm-plex-sans-600.woff2": "31535a91ce3f6b8ed3ddedadab1e49957e2220263a640df1a3f14f6fdfe15eb6",
"fonts/ibm-plex-mono-500.woff2": "756026ff72eb76fd971ac4b7504cec55eef62109d2684c2cad8da32170b80b37"
},
"cases": [
{
"url": "http://127.0.0.1:5198/",
"innerWidth": 1440,
"innerHeight": 900,
"devicePixelRatio": 1,
"scrollWidth": 1440,
"mainVisible": true,
"navOpen": false,
"active": {
"tag": "BODY",
"name": "\u2630\n \n \u25aeSCADA OverviewOverviewApplications\n ThemeCanaryread-only \u00b7 anonym",
"outline": "rgb(27, 29, 33) none 0px",
"focusVisible": false
},
"selected": [
{
"text": "Overview",
"color": "rgb(76, 29, 149)",
"background": "rgb(242, 236, 252)",
"opacity": "1"
}
],
"status": [
{
"text": "Polling",
"color": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"opacity": "1"
},
{
"text": "Up",
"color": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"opacity": "1"
},
{
"text": "Up",
"color": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"opacity": "1"
}
],
"values": [
{
"text": "1",
"color": "rgb(35, 111, 52)",
"background": "rgba(0, 0, 0, 0)",
"opacity": "1"
},
{
"text": "0",
"color": "rgb(83, 93, 102)",
"background": "rgba(0, 0, 0, 0)",
"opacity": "1"
}
],
"rise": [
{
"animation": "none",
"opacity": "1",
"transform": "none"
},
{
"animation": "none",
"opacity": "1",
"transform": "none"
},
{
"animation": "none",
"opacity": "1",
"transform": "none"
}
],
"fonts": true
},
{
"url": "http://127.0.0.1:5198/",
"innerWidth": 1024,
"innerHeight": 768,
"devicePixelRatio": 1,
"scrollWidth": 1024,
"mainVisible": true,
"navOpen": false,
"active": {
"tag": "H1",
"name": "Fleet Overview",
"outline": "rgb(76, 29, 149) solid 2px",
"focusVisible": true
},
"selected": [
{
"text": "Overview",
"color": "rgb(76, 29, 149)",
"background": "rgb(242, 236, 252)",
"opacity": "1"
}
],
"status": [
{
"text": "Polling",
"color": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"opacity": "1"
},
{
"text": "Up",
"color": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"opacity": "1"
},
{
"text": "Up",
"color": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"opacity": "1"
}
],
"values": [
{
"text": "1",
"color": "rgb(35, 111, 52)",
"background": "rgba(0, 0, 0, 0)",
"opacity": "1"
},
{
"text": "0",
"color": "rgb(83, 93, 102)",
"background": "rgba(0, 0, 0, 0)",
"opacity": "1"
}
],
"rise": [
{
"animation": "none",
"opacity": "1",
"transform": "none"
},
{
"animation": "none",
"opacity": "1",
"transform": "none"
},
{
"animation": "none",
"opacity": "1",
"transform": "none"
}
],
"fonts": true
},
{
"url": "http://127.0.0.1:5198/",
"innerWidth": 390,
"innerHeight": 844,
"devicePixelRatio": 1,
"scrollWidth": 390,
"mainVisible": true,
"navOpen": false,
"active": {
"tag": "H1",
"name": "Fleet Overview",
"outline": "rgb(76, 29, 149) solid 2px",
"focusVisible": true
},
"selected": [
{
"text": "Overview",
"color": "rgb(76, 29, 149)",
"background": "rgb(242, 236, 252)",
"opacity": "1"
}
],
"status": [
{
"text": "Polling",
"color": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"opacity": "1"
},
{
"text": "Up",
"color": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"opacity": "1"
},
{
"text": "Up",
"color": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"opacity": "1"
}
],
"values": [
{
"text": "1",
"color": "rgb(35, 111, 52)",
"background": "rgba(0, 0, 0, 0)",
"opacity": "1"
},
{
"text": "0",
"color": "rgb(83, 93, 102)",
"background": "rgba(0, 0, 0, 0)",
"opacity": "1"
}
],
"rise": [
{
"animation": "none",
"opacity": "1",
"transform": "none"
},
{
"animation": "none",
"opacity": "1",
"transform": "none"
},
{
"animation": "none",
"opacity": "1",
"transform": "none"
}
],
"fonts": true
},
{
"url": "http://127.0.0.1:5198/",
"innerWidth": 390,
"innerHeight": 844,
"devicePixelRatio": 1,
"scrollWidth": 390,
"mainVisible": true,
"navOpen": true,
"active": {
"tag": "SUMMARY",
"name": "\u2630",
"outline": "rgb(255, 255, 255) none 0px",
"focusVisible": false
},
"selected": [
{
"text": "Overview",
"color": "rgb(76, 29, 149)",
"background": "rgb(242, 236, 252)",
"opacity": "1"
}
],
"status": [
{
"text": "Polling",
"color": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"opacity": "1"
},
{
"text": "Up",
"color": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"opacity": "1"
},
{
"text": "Up",
"color": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"opacity": "1"
}
],
"values": [
{
"text": "1",
"color": "rgb(35, 111, 52)",
"background": "rgba(0, 0, 0, 0)",
"opacity": "1"
},
{
"text": "0",
"color": "rgb(83, 93, 102)",
"background": "rgba(0, 0, 0, 0)",
"opacity": "1"
}
],
"rise": [
{
"animation": "none",
"opacity": "1",
"transform": "none"
},
{
"animation": "none",
"opacity": "1",
"transform": "none"
},
{
"animation": "none",
"opacity": "1",
"transform": "none"
}
],
"fonts": true
},
{
"url": "http://127.0.0.1:5198/",
"innerWidth": 390,
"innerHeight": 844,
"devicePixelRatio": 1,
"scrollWidth": 390,
"mainVisible": true,
"navOpen": false,
"active": {
"tag": "SUMMARY",
"name": "\u2630",
"outline": "rgb(255, 255, 255) none 0px",
"focusVisible": false
},
"selected": [
{
"text": "Overview",
"color": "rgb(76, 29, 149)",
"background": "rgb(242, 236, 252)",
"opacity": "1"
}
],
"status": [
{
"text": "Polling",
"color": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"opacity": "1"
},
{
"text": "Up",
"color": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"opacity": "1"
},
{
"text": "Up",
"color": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"opacity": "1"
}
],
"values": [
{
"text": "1",
"color": "rgb(35, 111, 52)",
"background": "rgba(0, 0, 0, 0)",
"opacity": "1"
},
{
"text": "0",
"color": "rgb(83, 93, 102)",
"background": "rgba(0, 0, 0, 0)",
"opacity": "1"
}
],
"rise": [
{
"animation": "none",
"opacity": "1",
"transform": "none"
},
{
"animation": "none",
"opacity": "1",
"transform": "none"
},
{
"animation": "none",
"opacity": "1",
"transform": "none"
}
],
"fonts": true
}
],
"keyboard": {
"tag": "SUMMARY",
"name": "2 checks",
"outline": "rgb(76, 29, 149) solid 2px",
"focusVisible": true
},
"actualBrowserZoom": {
"url": "http://127.0.0.1:5198/",
"innerWidth": 720,
"innerHeight": 450,
"devicePixelRatio": 2,
"scrollWidth": 720,
"mainVisible": true,
"navOpen": false,
"active": {
"tag": "SUMMARY",
"name": "2 checks",
"outline": "rgb(76, 29, 149) solid 2px",
"focusVisible": true
},
"selected": [
{
"text": "Overview",
"color": "rgb(76, 29, 149)",
"background": "rgb(242, 236, 252)",
"opacity": "1"
}
],
"status": [
{
"text": "Polling",
"color": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"opacity": "1"
},
{
"text": "Up",
"color": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"opacity": "1"
},
{
"text": "Up",
"color": "rgb(35, 111, 52)",
"background": "rgb(233, 246, 236)",
"opacity": "1"
}
],
"values": [
{
"text": "1",
"color": "rgb(35, 111, 52)",
"background": "rgba(0, 0, 0, 0)",
"opacity": "1"
},
{
"text": "0",
"color": "rgb(83, 93, 102)",
"background": "rgba(0, 0, 0, 0)",
"opacity": "1"
}
],
"rise": [
{
"animation": "none",
"opacity": "1",
"transform": "none"
},
{
"animation": "none",
"opacity": "1",
"transform": "none"
},
{
"animation": "none",
"opacity": "1",
"transform": "none"
}
],
"fonts": true
},
"pageErrors": [],
"zoomScreenshotNote": "Viewport capture used: Playwright full_page capture at real browser zoom changes/crops capture dimensions. Actual layout verified innerWidth=scrollWidth=720,DPR=2 before viewport capture.",
"zoomViewportConfirmation": {
"innerWidth": 720,
"devicePixelRatio": 2,
"scrollWidth": 720,
"bodyWidth": 720
}
}
@@ -0,0 +1,24 @@
[
{
"class": "inst up stale",
"text": "Five-minute stale healthy\n 127.0.0.1:5200\n Stale\n\n Latency\n 12 ms\n Stale since\n 5 min ago\n Checks\n 1 / 1 healthy1 check\n synthetic-check\n Local fixture observation\n\n no management linkready 200",
"bodyOpacity": "1",
"hostOpacity": "1",
"hostColor": "rgb(98, 105, 112)",
"background": "rgb(255, 255, 255)",
"width": 1440,
"scrollWidth": 1440,
"overflow": []
},
{
"class": "inst up stale",
"text": "Five-minute stale healthy\n 127.0.0.1:5200\n Stale\n\n Latency\n 12 ms\n Stale since\n 5 min ago\n Checks\n 1 / 1 healthy1 check\n synthetic-check\n Local fixture observation\n\n no management linkready 200",
"bodyOpacity": "",
"hostOpacity": "",
"hostColor": "",
"background": "",
"width": 390,
"scrollWidth": 390,
"overflow": []
}
]
@@ -0,0 +1,39 @@
{
"fixture": "Frozen synthetic healthy reading five minutes old; actual Overview components, no polling",
"samples": [
{
"class": "inst up stale",
"text": "Five-minute stale healthy\n 127.0.0.1:5200\n Stale\n\n Latency\n 12 ms\n Stale since\n 5 min ago\n Checks\n 1 / 1 healthy1 check\n synthetic-check\n Local fixture observation\n\n no management linkready 200",
"bodyOpacity": "1",
"hostOpacity": "1",
"hostColor": "rgb(98, 105, 112)",
"background": "rgb(255, 255, 255)",
"width": 1440,
"devicePixelRatio": 1,
"scrollWidth": 1440
},
{
"class": "inst up stale",
"text": "Five-minute stale healthy\n 127.0.0.1:5200\n Stale\n\n Latency\n 12 ms\n Stale since\n 5 min ago\n Checks\n 1 / 1 healthy1 check\n synthetic-check\n Local fixture observation\n\n no management linkready 200",
"bodyOpacity": "1",
"hostOpacity": "1",
"hostColor": "rgb(98, 105, 112)",
"background": "rgb(255, 255, 255)",
"width": 390,
"devicePixelRatio": 1,
"scrollWidth": 390
}
],
"actualZoom": {
"class": "inst up stale",
"text": "Five-minute stale healthy\n 127.0.0.1:5200\n Stale\n\n Latency\n 12 ms\n Stale since\n 5 min ago\n Checks\n 1 / 1 healthy1 check\n synthetic-check\n Local fixture observation\n\n no management linkready 200",
"bodyOpacity": "1",
"hostOpacity": "1",
"hostColor": "rgb(98, 105, 112)",
"background": "rgb(255, 255, 255)",
"width": 720,
"devicePixelRatio": 2,
"scrollWidth": 720
},
"initialHarnessFailure": "Locator-bound SSR element detached during hydration and yielded empty styles; original observations retained. Synchronous current-node confirmation fixes the measurement without UI change."
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../../../../../../ZB.MOM.WW.Overview/src/ZB.MOM.WW.Overview/ZB.MOM.WW.Overview.csproj" />
</ItemGroup>
</Project>
@@ -0,0 +1,87 @@
using Microsoft.AspNetCore.DataProtection;
using Microsoft.Extensions.FileProviders;
using ZB.MOM.WW.Overview.Components;
using ZB.MOM.WW.Overview.Polling;
// Actual Overview App/Routes/layout/cards, synthetic immutable snapshots only.
// No polling, HTTP client, authentication or fleet service is registered.
var builder = WebApplication.CreateBuilder(args);
builder.WebHost.UseStaticWebAssets();
builder.Services.AddDataProtection().UseEphemeralDataProtectionProvider();
builder.Services.AddRazorComponents().AddInteractiveServerComponents();
var clock = new FixtureClock();
var store = new OverviewSnapshotStore();
store.Publish(Scenes.Create("mixed", clock.GetUtcNow()));
builder.Services.AddSingleton(store);
builder.Services.AddSingleton<TimeProvider>(clock);
var app = builder.Build();
var sourceRoot = builder.Configuration["Canary:OverviewRoot"] ?? Path.GetFullPath(Path.Combine(
builder.Environment.ContentRootPath, "../../../../../../ZB.MOM.WW.Overview/src/ZB.MOM.WW.Overview"));
app.UseStaticFiles(new StaticFileOptions { FileProvider = new PhysicalFileProvider(Path.Combine(sourceRoot, "wwwroot")) });
app.UseStaticFiles();
app.UseAntiforgery();
app.MapRazorComponents<App>().AddInteractiveServerRenderMode();
app.MapGet("/canary-provenance", () => new
{
purpose = "Actual Overview components with synthetic frozen snapshots; no production registry or probes",
themeAssembly = typeof(ZB.MOM.WW.Theme.ThemeShell).Assembly.GetName().Version?.ToString(),
generatedUtc = clock.GetUtcNow(),
sourceRoot,
});
app.MapPost("/canary/scene/{scene}", (string scene) =>
{
if (scene is not ("mixed" or "empty" or "stale" or "long-error")) return Results.NotFound();
store.Publish(Scenes.Create(scene, clock.GetUtcNow()));
return Results.Ok(new { scene, fixtureOnly = true });
});
app.Run();
internal sealed class FixtureClock : TimeProvider
{
private readonly DateTimeOffset _now = new(2026, 11, 13, 20, 0, 0, TimeSpan.Zero);
public override DateTimeOffset GetUtcNow() => _now;
}
internal static class Scenes
{
public static OverviewSnapshot Create(string scene, DateTimeOffset now)
{
if (scene == "empty") return OverviewSnapshot.Empty;
var rows = scene switch
{
"stale" => new[] { Row("Five-minute stale healthy", InstanceStatus.Up, now.AddMinutes(-5)) },
"long-error" => new[] { Row("Unreachable long diagnostic", InstanceStatus.Unreachable, now,
"Synthetic probe failure: " + new string('x', 2000) + " diagnostic end") },
_ => new[]
{
Row("Healthy fixture", InstanceStatus.Up, now),
Row("Degraded fixture", InstanceStatus.Degraded, now),
Row("Down fixture", InstanceStatus.Down, now),
Row("Unreachable fixture", InstanceStatus.Unreachable, now, "Synthetic loopback probe failure"),
Row("Five-minute stale healthy", InstanceStatus.Up, now.AddMinutes(-5)),
Row("Five-minute stale unreachable", InstanceStatus.Unreachable, now.AddMinutes(-5)),
Row("Pending fixture", null, null),
},
};
return new OverviewSnapshot(now, new[]
{
new ApplicationSnapshot("Synthetic local SCADA", rows, LeaderResolver.Resolve(rows)),
});
}
private static InstanceSnapshot Row(string name, InstanceStatus? status, DateTimeOffset? at, string? error = null) => new()
{
Application = "Synthetic local SCADA", Instance = name,
Group = "Local fixtures", BaseUrl = "http://127.0.0.1:5200",
Status = status, LastPolledUtc = at, LastReachableUtc = at,
Latency = TimeSpan.FromMilliseconds(12), StaleAfter = TimeSpan.FromSeconds(45), Error = error,
Report = status == InstanceStatus.Unreachable || status is null ? null : new ZbHealthReport
{
Status = status == InstanceStatus.Up ? "Healthy" : status == InstanceStatus.Degraded ? "Degraded" : "Unhealthy",
Entries = new Dictionary<string, ZbHealthEntry>
{
["synthetic-check"] = new() { Status = status == InstanceStatus.Up ? "Healthy" : "Degraded", Description = "Local fixture observation" },
},
},
};
}
@@ -0,0 +1,98 @@
"""Bounded actual Overview loopback candidate checks; no external fleet probes."""
import hashlib
import json
from pathlib import Path
from urllib.request import urlopen
import zipfile
from playwright.sync_api import sync_playwright, expect
from browser_zoom import zoom_browser, set_browser_zoom
ROOT = Path(__file__).resolve().parents[5]
OUT = Path(__file__).resolve().parent / "overview-after"
OUT.mkdir(exist_ok=True)
BASE = "http://127.0.0.1:5198"
PACKAGE = ROOT / "ZB.MOM.WW.Theme/artifacts/ZB.MOM.WW.Theme.1.0.0.nupkg"
def state(page):
return page.evaluate("""() => {
const styles = selector => [...document.querySelectorAll(selector)].map(e => {
const s=getComputedStyle(e); return {text:e.textContent.trim().slice(0,100),
color:s.color, background:s.backgroundColor, opacity:s.opacity};
});
const active=document.activeElement;
return {url:location.href, innerWidth, innerHeight, devicePixelRatio,
scrollWidth:document.documentElement.scrollWidth,
mainVisible:document.querySelector('main').getBoundingClientRect().height>0,
navOpen:document.querySelector('.app-shell').open,
active:{tag:active.tagName, name:active.textContent.trim().slice(0,80),
outline:getComputedStyle(active).outline,focusVisible:active.matches(':focus-visible')},
selected:styles('.rail-link.active'), status:styles('.chip,.conn-pill'),
values:styles('.agg-card.good .agg-value,.agg-card.quiet .agg-value'),
rise:[...document.querySelectorAll('.rise')].map(e=>({
animation:getComputedStyle(e).animationName,opacity:getComputedStyle(e).opacity,
transform:getComputedStyle(e).transform})),
fonts:document.fonts.check('14px "IBM Plex Sans"')};
}""")
results = {"packageSha256": hashlib.sha256(PACKAGE.read_bytes()).hexdigest(),
"packageSourceRevision": "3d61456d6150145a525a3a646721f865f5680c1b",
"fixture": "Actual Overview host, one registry entry pointing only at its own loopback health", "assets": {}, "cases": []}
with zipfile.ZipFile(PACKAGE) as package:
for name in ["css/theme.css", "css/layout.css", "fonts/ibm-plex-sans-400.woff2",
"fonts/ibm-plex-sans-600.woff2", "fonts/ibm-plex-mono-500.woff2"]:
response=urlopen(BASE + "/_content/ZB.MOM.WW.Theme/" + name)
data=response.read()
assert response.status == 200 and data == package.read("staticwebassets/" + name), name
results["assets"][name] = hashlib.sha256(data).hexdigest()
with sync_playwright() as p:
with zoom_browser(p) as (context, worker):
page=context.pages[0]
errors=[]
page.on("pageerror", lambda error: errors.append(str(error)))
page.emulate_media(reduced_motion="reduce")
for width,height in [(1440,900),(1024,768),(390,844)]:
page.set_viewport_size({"width":width,"height":height})
page.goto(BASE)
expect(page.get_by_role("heading",name="Fleet Overview",exact=True)).to_be_visible()
page.evaluate("document.fonts.ready")
data=state(page)
assert data["scrollWidth"] <= data["innerWidth"], data
assert data["mainVisible"] and data["fonts"]
assert all(x["animation"]=="none" and x["opacity"]=="1" and x["transform"]=="none" for x in data["rise"])
assert data["selected"][0]["background"] == "rgb(242, 236, 252)"
page.screenshot(path=str(OUT/f"overview-{width}.png"),full_page=True)
results["cases"].append(data)
if width==390:
toggle=page.locator("summary.rail-toggle")
# Native user interaction opens/closes only navigation; content stays visible.
for _ in range(2):
toggle.click()
changed=state(page)
assert changed["mainVisible"] and changed["scrollWidth"] <= changed["innerWidth"]
results["cases"].append(changed)
page.set_viewport_size({"width":1440,"height":900})
page.goto(BASE)
expect(page.get_by_test_id("pause-toggle")).to_be_visible()
# Wait for the real InteractiveServer control; this only pauses the local UI view.
pause=page.get_by_test_id("pause-toggle")
pause.click()
expect(pause).to_have_text("Resume auto-refresh")
pause.click()
expect(pause).to_have_text("Pause auto-refresh")
page.keyboard.press("Tab")
keyboard=state(page)
assert keyboard["active"]["focusVisible"] and "2px" in keyboard["active"]["outline"], keyboard["active"]
results["keyboard"] = keyboard["active"]
assert set_browser_zoom(worker,page,2)==2
zoom=state(page)
assert zoom["innerWidth"]==720 and zoom["devicePixelRatio"]==2
assert zoom["mainVisible"] and zoom["scrollWidth"] <= zoom["innerWidth"]
page.screenshot(path=str(OUT/"overview-200-percent.png"),full_page=False)
results["actualBrowserZoom"] = zoom
results["pageErrors"]=errors
assert not errors, errors
(OUT/"results.json").write_text(json.dumps(results,indent=2)+"\n")
print(json.dumps({"cases":len(results["cases"]),"allFiveAssetBytesMatch":True,"actualZoom":2,"pageErrors":results["pageErrors"]}))
@@ -0,0 +1,59 @@
"""Frozen five-minute-old real Overview card; no poller or external services."""
import json
from pathlib import Path
from urllib.request import Request, urlopen
from playwright.sync_api import sync_playwright
from browser_zoom import zoom_browser, set_browser_zoom
BASE = "http://127.0.0.1:5200"
OUT = Path(__file__).resolve().parent / "overview-stale"
OUT.mkdir(exist_ok=True)
urlopen(Request(BASE + "/canary/scene/stale", method="POST")).read()
def current_state(page):
# Select and measure the CURRENT node in the same synchronous JS turn.
# A locator-bound SSR node can detach during hydration and yield empty styles.
return page.evaluate("""() => {
const e=document.querySelector('.inst.stale');
return {class:e.className,text:e.textContent,
bodyOpacity:getComputedStyle(e.querySelector('.inst-body')).opacity,
hostOpacity:getComputedStyle(e.querySelector('.inst-host')).opacity,
hostColor:getComputedStyle(e.querySelector('.inst-host')).color,
background:getComputedStyle(e).backgroundColor,
width:innerWidth,devicePixelRatio,scrollWidth:document.documentElement.scrollWidth};
}""")
samples=[]
with sync_playwright() as p:
with zoom_browser(p) as (context, worker):
page=context.pages[0]
page.emulate_media(reduced_motion="reduce")
session=context.new_cdp_session(page)
for width,height in [(1440,900),(390,844)]:
page.set_viewport_size({"width":width,"height":height})
page.goto(BASE)
page.evaluate("document.fonts.ready")
data=current_state(page)
assert data["bodyOpacity"]==data["hostOpacity"]=="1",data
assert "up" in data["class"] and "Stale" in data["text"]
assert data["width"]==data["scrollWidth"],data
session.send("Emulation.setEmulatedVisionDeficiency",{"type":"achromatopsia"})
page.screenshot(path=str(OUT/f"stale-{width}-grayscale.png"),full_page=True)
session.send("Emulation.setEmulatedVisionDeficiency",{"type":"none"})
samples.append(data)
page.set_viewport_size({"width":1440,"height":900})
page.goto(BASE)
page.evaluate("document.fonts.ready")
assert set_browser_zoom(worker,page,2)==2
zoom=current_state(page)
assert zoom["width"]==zoom["scrollWidth"]==720 and zoom["devicePixelRatio"]==2
page.screenshot(path=str(OUT/"stale-200-percent.png"),full_page=False)
session.detach()
(OUT/"results.json").write_text(json.dumps({
"fixture":"Frozen synthetic healthy reading five minutes old; actual Overview components, no polling",
"samples":samples,"actualZoom":zoom,
"initialHarnessFailure":"Locator-bound SSR element detached during hydration and yielded empty styles; original observations retained. Synchronous current-node confirmation fixes the measurement without UI change.",
},indent=2)+"\n")
print("Stale text remains fully opaque and bounded at both viewports and real 200% browser zoom.")
@@ -0,0 +1,18 @@
{
"sourceCommit": "3d61456d6150145a525a3a646721f865f5680c1b",
"packageSha256": "834d2aad4e61cebff3fb48bbf608d412547d4aa39bdda142d0c7caf24c9e10d0",
"servedCss": {
"theme.css": {
"sha256": "e3d54b82a1da74fe1cb8386f99d26412f88640ef4042a2a3ce831566c06046ce",
"matchesExactCandidate": true
},
"layout.css": {
"sha256": "1a4960c5552110f9d1521621816117e6496646b55d919c85f3a815ae98e3a781",
"matchesExactCandidate": true
}
},
"runtimeThemeAssembly": "1.0.0.0",
"packageFolder": "/tmp/scadabridge-ui-canary-candidate-packages",
"localPackageSource": "/tmp/scadabridge-canary-feed",
"notes": "Temporary authenticated NuGet.Config remains private under /tmp and is excluded from evidence."
}
@@ -0,0 +1,306 @@
{
"reason": "First-pass nine empty CSS results came from detached SSR nodes; no product/UI code change. Full-page capture at real zoom replaced by viewport capture.",
"results": [
{
"width": 1440,
"scheme": "light",
"kind": "root",
"zoom": 1,
"immediateMotion": {
"connected": true,
"animationName": "none",
"animationDuration": "0s",
"opacity": "1",
"transform": "none",
"reduced": true
},
"passed": true,
"actualPairs": {
"primary": {
"color": "rgb(255, 255, 255)",
"background": "rgb(47, 95, 208)",
"opacity": "1"
},
"hint": {
"color": "rgba(33, 37, 41, 0.75)",
"background": "rgb(255, 255, 255)",
"opacity": "1"
},
"error": {
"color": "rgb(180, 33, 33)",
"background": "rgb(255, 255, 255)",
"opacity": "1"
}
}
},
{
"width": 1440,
"scheme": "dark",
"kind": "root",
"zoom": 1,
"immediateMotion": {
"connected": true,
"animationName": "none",
"animationDuration": "0s",
"opacity": "1",
"transform": "none",
"reduced": true
},
"passed": true,
"actualPairs": {
"primary": {
"color": "rgb(17, 24, 39)",
"background": "rgb(122, 160, 239)",
"opacity": "1"
},
"hint": {
"color": "rgba(222, 226, 230, 0.75)",
"background": "rgb(37, 40, 45)",
"opacity": "1"
},
"error": {
"color": "rgb(255, 157, 157)",
"background": "rgb(37, 40, 45)",
"opacity": "1"
}
}
},
{
"width": 1024,
"scheme": "light",
"kind": "root",
"zoom": 1,
"immediateMotion": {
"connected": true,
"animationName": "none",
"animationDuration": "0s",
"opacity": "1",
"transform": "none",
"reduced": true
},
"passed": true,
"actualPairs": {
"primary": {
"color": "rgb(255, 255, 255)",
"background": "rgb(47, 95, 208)",
"opacity": "1"
},
"hint": {
"color": "rgba(33, 37, 41, 0.75)",
"background": "rgb(255, 255, 255)",
"opacity": "1"
},
"error": {
"color": "rgb(180, 33, 33)",
"background": "rgb(255, 255, 255)",
"opacity": "1"
}
}
},
{
"width": 1024,
"scheme": "dark",
"kind": "root",
"zoom": 1,
"immediateMotion": {
"connected": true,
"animationName": "none",
"animationDuration": "0s",
"opacity": "1",
"transform": "none",
"reduced": true
},
"passed": true,
"actualPairs": {
"primary": {
"color": "rgb(17, 24, 39)",
"background": "rgb(122, 160, 239)",
"opacity": "1"
},
"hint": {
"color": "rgba(222, 226, 230, 0.75)",
"background": "rgb(37, 40, 45)",
"opacity": "1"
},
"error": {
"color": "rgb(255, 157, 157)",
"background": "rgb(37, 40, 45)",
"opacity": "1"
}
}
},
{
"width": 390,
"scheme": "light",
"kind": "root",
"zoom": 1,
"immediateMotion": {
"connected": true,
"animationName": "none",
"animationDuration": "0s",
"opacity": "1",
"transform": "none",
"reduced": true
},
"passed": true,
"actualPairs": {
"primary": {
"color": "rgb(255, 255, 255)",
"background": "rgb(47, 95, 208)",
"opacity": "1"
},
"hint": {
"color": "rgba(33, 37, 41, 0.75)",
"background": "rgb(255, 255, 255)",
"opacity": "1"
},
"error": {
"color": "rgb(180, 33, 33)",
"background": "rgb(255, 255, 255)",
"opacity": "1"
}
}
},
{
"width": 390,
"scheme": "dark",
"kind": "root",
"zoom": 1,
"immediateMotion": {
"connected": true,
"animationName": "none",
"animationDuration": "0s",
"opacity": "1",
"transform": "none",
"reduced": true
},
"passed": true,
"actualPairs": {
"primary": {
"color": "rgb(17, 24, 39)",
"background": "rgb(122, 160, 239)",
"opacity": "1"
},
"hint": {
"color": "rgba(222, 226, 230, 0.75)",
"background": "rgb(37, 40, 45)",
"opacity": "1"
},
"error": {
"color": "rgb(255, 157, 157)",
"background": "rgb(37, 40, 45)",
"opacity": "1"
}
}
},
{
"width": 1440,
"scheme": "light",
"kind": "login",
"zoom": 1,
"immediateMotion": {
"connected": true,
"animationName": "none",
"animationDuration": "0s",
"opacity": "1",
"transform": "none",
"reduced": true
},
"passed": true
},
{
"width": 1440,
"scheme": "dark",
"kind": "login",
"zoom": 1,
"immediateMotion": {
"connected": true,
"animationName": "none",
"animationDuration": "0s",
"opacity": "1",
"transform": "none",
"reduced": true
},
"passed": true
},
{
"width": 1440,
"scheme": "light",
"kind": "root",
"zoom": 2,
"immediateMotion": {
"connected": true,
"animationName": "none",
"animationDuration": "0s",
"opacity": "1",
"transform": "none",
"reduced": true
},
"passed": true,
"browserZoom": 2,
"actualLayout": {
"innerWidth": 720,
"scrollWidth": 720,
"DPR": 2
},
"screenshot": "root-light-1440-zoom2-viewport.png",
"actualPairs": {
"primary": {
"color": "rgb(255, 255, 255)",
"background": "rgb(47, 95, 208)",
"opacity": "1"
},
"hint": {
"color": "rgba(33, 37, 41, 0.75)",
"background": "rgb(255, 255, 255)",
"opacity": "1"
},
"error": {
"color": "rgb(180, 33, 33)",
"background": "rgb(255, 255, 255)",
"opacity": "1"
}
}
},
{
"width": 1440,
"scheme": "dark",
"kind": "root",
"zoom": 2,
"immediateMotion": {
"connected": true,
"animationName": "none",
"animationDuration": "0s",
"opacity": "1",
"transform": "none",
"reduced": true
},
"passed": true,
"browserZoom": 2,
"actualLayout": {
"innerWidth": 720,
"scrollWidth": 720,
"DPR": 2
},
"screenshot": "root-dark-1440-zoom2-viewport.png",
"actualPairs": {
"primary": {
"color": "rgb(17, 24, 39)",
"background": "rgb(122, 160, 239)",
"opacity": "1"
},
"hint": {
"color": "rgba(222, 226, 230, 0.75)",
"background": "rgb(37, 40, 45)",
"opacity": "1"
},
"error": {
"color": "rgb(255, 157, 157)",
"background": "rgb(37, 40, 45)",
"opacity": "1"
}
}
}
],
"allPassed": true
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

@@ -16,6 +16,13 @@
<input id="canary-field" class="form-control" @bind="_sample" @bind:event="oninput" @bind:after="ValidateSample"
aria-describedby="@FieldDescription" aria-invalid="@(_fieldError is not null ? "true" : "false")" />
</TechField>
<div class="canary-status-row" aria-label="Synthetic status samples">
<StatusPill State="StatusState.Ok">OK sample</StatusPill>
<StatusPill State="StatusState.Warn">Warning sample</StatusPill>
<StatusPill State="StatusState.Bad">Failure sample</StatusPill>
<StatusPill State="StatusState.Idle">Idle sample</StatusPill>
<StatusPill State="StatusState.Info">Information sample</StatusPill>
</div>
<div class="canary-action-row">
<TechButton id="canary-busy-success" Busy="@SuccessBusy" BusyText="Saving local sample…"
disabled="@IsWorking" @onclick="() => WorkAsync(false)">Save local sample</TechButton>
@@ -25,7 +32,7 @@
<TechButton @onclick="ShowDialog">Open local confirmation</TechButton>
</div>
<div id="canary-outcome" role="status" aria-live="polite">@_outcome</div>
<p>Dark-mode candidate tokens below are fixture-only proposed adoption aliases, not current ScadaBridge production styling.</p>
<p>Supported dark tokens come from actual CentralUI site.css under the limited candidate adoption; this host still uses synthetic local data only.</p>
</div>
</section>
@code {
@@ -1,5 +1,5 @@
/* Fixture-only proposed ScadaBridge dark adoption aliases. This stylesheet is never
copied into the production app. Load after the actual CentralUI stylesheet. */
/* Fixture layout only. Supported dark tokens now come from the actual CentralUI
site.css under the limited SB-01 candidate adoption; no fixture palette override. */
html[data-canary="scadabridge"] .canary-action-row {
display: flex;
flex-wrap: wrap;
@@ -7,20 +7,3 @@ html[data-canary="scadabridge"] .canary-action-row {
gap: .75rem;
margin-block: 1rem;
}
html[data-canary="scadabridge"][data-bs-theme="dark"] {
/* Existing dark accent #4d7fe8 is only 3.88:1 as link text on --card.
The same blue hue is lightened here for body-sized links. */
--accent: #7aa0ef;
--accent-deep: #9dbaf6;
--accent-tint: #1e2640;
--accent-border: #566d9c;
--accent-focus: #a7c1ff;
--on-accent: #111827;
--ok-ink: #8ada96;
--warn-ink: #efbd63;
--warn-ink-deep: #efbd63;
--bad-ink: #ff9d9d;
--idle-ink: #c3cad5;
--info-ink: #b4c6ff;
--ink-faint: #a8b0bc;
}