diff --git a/docs/ui-validation/browse_browser.py b/docs/ui-validation/browse_browser.py new file mode 100644 index 00000000..67324250 --- /dev/null +++ b/docs/ui-validation/browse_browser.py @@ -0,0 +1,53 @@ +"""Actual BrowsePage/real projection/index; only cached synthetic metadata and fake redacted reads.""" +import json,sys +from pathlib import Path +from playwright.sync_api import sync_playwright +ROOT=Path(__file__).resolve().parent +sys.path.insert(0,'/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/components/ui-theme/validation/theme-1.0.0/canary') +from browser_zoom import zoom_browser,set_browser_zoom +BASE=json.load(open('/tmp/mx-ui-browse-state.json'))['origin'];OUT=ROOT/'evidence/browse-confirmation';OUT.mkdir(exist_ok=True) +long='Pump01.'+'x'*200 +results=[];errors=[] +def flow(page,touch=False,capture=None): + page.goto(BASE+'/browse-fixture');page.wait_for_selector('html[data-mx-ready="true"]');page.evaluate('document.fonts.ready') + page.get_by_role('button',name='Expand SyntheticPlant',exact=True).tap() if touch else page.get_by_role('button',name='Expand SyntheticPlant',exact=True).press('Enter') + page.get_by_role('button',name='Expand Pump01',exact=True).tap() if touch else page.get_by_role('button',name='Expand Pump01',exact=True).press('Space') + watch=page.get_by_role('button',name='Watch Pump01.PV',exact=True);watch.tap() if touch else watch.press('Space') + page.wait_for_function("document.querySelectorAll('.sub-table tbody tr').length===1") + watch.tap() if touch else watch.press('Space');assert page.locator('.sub-table tbody tr').count()==1 + page.get_by_role('button',name='Watch '+long,exact=True).tap() if touch else page.get_by_role('button',name='Watch '+long,exact=True).press('Enter') + page.wait_for_function("document.querySelectorAll('.sub-table tbody tr').length===2") + assert long in page.locator('.sub-table').inner_text() + targets=page.locator('.tree-node-toggle,.tree-watch,.sub-actions-col button').evaluate_all('(es)=>es.map(e=>({name:e.getAttribute("aria-label")||e.textContent.trim(),width:e.getBoundingClientRect().width,height:e.getBoundingClientRect().height}))') + if capture:page.screenshot(path=str(OUT/f'expanded-{capture}.png'),full_page=False) + region=page.get_by_role('region',name='Watched attribute values',exact=True) + region.evaluate('(e)=>e.scrollLeft=0');region.focus();page.keyboard.press('Tab') + page.wait_for_function("document.querySelector('.sub-table').closest('[role=region]').scrollLeft>0") + assert page.get_by_role('button',name='Remove Pump01.PV',exact=True).evaluate('(e)=>e===document.activeElement') + search=page.get_by_role('searchbox',name='Filter Galaxy attributes');search.fill('PV') + page.get_by_test_id('browse-search-status').filter(has_text='2 matching attributes.').wait_for() + page.get_by_role('button',name='Watch Pump01.PV',exact=True).tap() if touch else page.get_by_role('button',name='Watch Pump01.PV',exact=True).press('Space');assert page.locator('.sub-table tbody tr').count()==2 + search.fill('no-such-fixture');page.get_by_text('No attributes match',exact=False).wait_for() + page.get_by_role('button',name='Clear search',exact=True).tap() if touch else page.get_by_role('button',name='Clear search',exact=True).click() + page.wait_for_function("document.activeElement.id==='browse-search'") + assert page.locator('.sub-table tbody tr').count()==2 + return {'viewport':page.evaluate('innerWidth'),'scroll':page.evaluate('document.documentElement.scrollWidth'),'coarse':page.evaluate("matchMedia('(pointer:coarse)').matches"),'targets':targets,'namedScrollRegions':page.get_by_role('region').count(),'workflow':['keyboardExpand','spaceWatch','repeatedWatchNoDuplicate','fullLongPathPreserved','searchWatchSameSubscription','noMatchClearFocus','subscriptionsRetained','namedScrollerTabReachesActions']} +with sync_playwright() as p: + with zoom_browser(p) as (ctx,worker): + page=ctx.new_page();page.on('pageerror',lambda e:errors.append(str(e))) + for width,zoom in [(1440,1),(1024,1),(390,1),(1440,2)]: + page.set_viewport_size({'width':width,'height':900});page.goto(BASE+'/browse-fixture');set_browser_zoom(worker,page,zoom) + result=flow(page,capture=f'{width}-zoom{zoom}');result['zoom']=zoom;result['dpr']=page.evaluate('devicePixelRatio');results.append(result) + page.screenshot(path=str(OUT/f'browse-{width}-zoom{zoom}.png'),full_page=False) + set_browser_zoom(worker,page,1) + browser=p.chromium.launch(channel='chromium',headless=True) + page=browser.new_page(viewport={'width':390,'height':844},is_mobile=True,has_touch=True) + page.on('pageerror',lambda e:errors.append(str(e))) + page.goto(BASE+'/browse-fixture');cdp=page.context.new_cdp_session(page);cdp.send('Emulation.setTouchEmulationEnabled',{'enabled':True,'maxTouchPoints':1}) + assert page.evaluate("matchMedia('(pointer:coarse)').matches && navigator.maxTouchPoints===1") + result=flow(page,touch=True,capture='coarse390');results.append(result) + page.screenshot(path=str(OUT/'browse-coarse390.png'),full_page=False);browser.close() +assert all(r['scroll']<=r['viewport'] for r in results) +assert all(min(t['width'],t['height'])>=44 for r in results if r['coarse'] for t in r['targets']) +(OUT/'results.json').write_text(json.dumps({'cases':results,'errors':errors},indent=2)) +print(json.dumps({'cases':len(results),'overflow':[(r['viewport'],r['scroll']) for r in results if r['scroll']>r['viewport']],'coarseBelow44':[t for r in results if r['coarse'] for t in r['targets'] if min(t['width'],t['height'])<44],'errors':errors},indent=2)) diff --git a/docs/ui-validation/evidence/browse-confirmation.log b/docs/ui-validation/evidence/browse-confirmation.log new file mode 100644 index 00000000..9f64d00b --- /dev/null +++ b/docs/ui-validation/evidence/browse-confirmation.log @@ -0,0 +1,6 @@ +{ + "cases": 5, + "overflow": [], + "coarseBelow44": [], + "errors": [] +} diff --git a/docs/ui-validation/evidence/browse-confirmation/browse-1024-zoom1.png b/docs/ui-validation/evidence/browse-confirmation/browse-1024-zoom1.png new file mode 100644 index 00000000..55792346 Binary files /dev/null and b/docs/ui-validation/evidence/browse-confirmation/browse-1024-zoom1.png differ diff --git a/docs/ui-validation/evidence/browse-confirmation/browse-1440-zoom1.png b/docs/ui-validation/evidence/browse-confirmation/browse-1440-zoom1.png new file mode 100644 index 00000000..9aec519b Binary files /dev/null and b/docs/ui-validation/evidence/browse-confirmation/browse-1440-zoom1.png differ diff --git a/docs/ui-validation/evidence/browse-confirmation/browse-1440-zoom2.png b/docs/ui-validation/evidence/browse-confirmation/browse-1440-zoom2.png new file mode 100644 index 00000000..2e05f75f Binary files /dev/null and b/docs/ui-validation/evidence/browse-confirmation/browse-1440-zoom2.png differ diff --git a/docs/ui-validation/evidence/browse-confirmation/browse-390-zoom1.png b/docs/ui-validation/evidence/browse-confirmation/browse-390-zoom1.png new file mode 100644 index 00000000..a01c36ba Binary files /dev/null and b/docs/ui-validation/evidence/browse-confirmation/browse-390-zoom1.png differ diff --git a/docs/ui-validation/evidence/browse-confirmation/browse-coarse390.png b/docs/ui-validation/evidence/browse-confirmation/browse-coarse390.png new file mode 100644 index 00000000..9b806f0a Binary files /dev/null and b/docs/ui-validation/evidence/browse-confirmation/browse-coarse390.png differ diff --git a/docs/ui-validation/evidence/browse-confirmation/expanded-1024-zoom1.png b/docs/ui-validation/evidence/browse-confirmation/expanded-1024-zoom1.png new file mode 100644 index 00000000..6a6d8634 Binary files /dev/null and b/docs/ui-validation/evidence/browse-confirmation/expanded-1024-zoom1.png differ diff --git a/docs/ui-validation/evidence/browse-confirmation/expanded-1440-zoom1.png b/docs/ui-validation/evidence/browse-confirmation/expanded-1440-zoom1.png new file mode 100644 index 00000000..8e9960de Binary files /dev/null and b/docs/ui-validation/evidence/browse-confirmation/expanded-1440-zoom1.png differ diff --git a/docs/ui-validation/evidence/browse-confirmation/expanded-1440-zoom2.png b/docs/ui-validation/evidence/browse-confirmation/expanded-1440-zoom2.png new file mode 100644 index 00000000..b694b226 Binary files /dev/null and b/docs/ui-validation/evidence/browse-confirmation/expanded-1440-zoom2.png differ diff --git a/docs/ui-validation/evidence/browse-confirmation/expanded-390-zoom1.png b/docs/ui-validation/evidence/browse-confirmation/expanded-390-zoom1.png new file mode 100644 index 00000000..e1cfbba5 Binary files /dev/null and b/docs/ui-validation/evidence/browse-confirmation/expanded-390-zoom1.png differ diff --git a/docs/ui-validation/evidence/browse-confirmation/expanded-coarse390.png b/docs/ui-validation/evidence/browse-confirmation/expanded-coarse390.png new file mode 100644 index 00000000..d4f4f4c6 Binary files /dev/null and b/docs/ui-validation/evidence/browse-confirmation/expanded-coarse390.png differ diff --git a/docs/ui-validation/evidence/browse-confirmation/results.json b/docs/ui-validation/evidence/browse-confirmation/results.json new file mode 100644 index 00000000..2fe81109 --- /dev/null +++ b/docs/ui-validation/evidence/browse-confirmation/results.json @@ -0,0 +1,278 @@ +{ + "cases": [ + { + "viewport": 1440, + "scroll": 1440, + "coarse": false, + "targets": [ + { + "name": "Collapse SyntheticPlant", + "width": 128.78125, + "height": 19.6875 + }, + { + "name": "Collapse Pump01", + "width": 86.09375, + "height": 19.6875 + }, + { + "name": "Watch Pump01.PV", + "width": 56.546875, + "height": 27.46875 + }, + { + "name": "Watch Pump01.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "width": 56.546875, + "height": 27.46875 + }, + { + "name": "Expand Sibling01", + "width": 91.375, + "height": 19.6875 + }, + { + "name": "Remove Pump01.PV", + "width": 66.515625, + "height": 27.46875 + }, + { + "name": "Remove Pump01.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "width": 66.515625, + "height": 27.46875 + } + ], + "namedScrollRegions": 2, + "workflow": [ + "keyboardExpand", + "spaceWatch", + "repeatedWatchNoDuplicate", + "fullLongPathPreserved", + "searchWatchSameSubscription", + "noMatchClearFocus", + "subscriptionsRetained", + "namedScrollerTabReachesActions" + ], + "zoom": 1, + "dpr": 1 + }, + { + "viewport": 1024, + "scroll": 1024, + "coarse": false, + "targets": [ + { + "name": "Collapse SyntheticPlant", + "width": 128.78125, + "height": 19.6875 + }, + { + "name": "Collapse Pump01", + "width": 86.09375, + "height": 19.6875 + }, + { + "name": "Watch Pump01.PV", + "width": 56.546875, + "height": 27.46875 + }, + { + "name": "Watch Pump01.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "width": 56.546875, + "height": 27.46875 + }, + { + "name": "Expand Sibling01", + "width": 91.375, + "height": 19.6875 + }, + { + "name": "Remove Pump01.PV", + "width": 66.515625, + "height": 27.46875 + }, + { + "name": "Remove Pump01.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "width": 66.515625, + "height": 27.46875 + } + ], + "namedScrollRegions": 2, + "workflow": [ + "keyboardExpand", + "spaceWatch", + "repeatedWatchNoDuplicate", + "fullLongPathPreserved", + "searchWatchSameSubscription", + "noMatchClearFocus", + "subscriptionsRetained", + "namedScrollerTabReachesActions" + ], + "zoom": 1, + "dpr": 1 + }, + { + "viewport": 390, + "scroll": 390, + "coarse": false, + "targets": [ + { + "name": "Collapse SyntheticPlant", + "width": 128.78125, + "height": 19.6875 + }, + { + "name": "Collapse Pump01", + "width": 86.09375, + "height": 19.6875 + }, + { + "name": "Watch Pump01.PV", + "width": 56.546875, + "height": 27.46875 + }, + { + "name": "Watch Pump01.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "width": 56.546875, + "height": 27.46875 + }, + { + "name": "Expand Sibling01", + "width": 91.375, + "height": 19.6875 + }, + { + "name": "Remove Pump01.PV", + "width": 66.515625, + "height": 27.46875 + }, + { + "name": "Remove Pump01.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "width": 66.515625, + "height": 27.46875 + } + ], + "namedScrollRegions": 2, + "workflow": [ + "keyboardExpand", + "spaceWatch", + "repeatedWatchNoDuplicate", + "fullLongPathPreserved", + "searchWatchSameSubscription", + "noMatchClearFocus", + "subscriptionsRetained", + "namedScrollerTabReachesActions" + ], + "zoom": 1, + "dpr": 1 + }, + { + "viewport": 720, + "scroll": 720, + "coarse": false, + "targets": [ + { + "name": "Collapse SyntheticPlant", + "width": 128.78125, + "height": 19.671875 + }, + { + "name": "Collapse Pump01", + "width": 86.078125, + "height": 19.671875 + }, + { + "name": "Watch Pump01.PV", + "width": 56.546875, + "height": 27.4609375 + }, + { + "name": "Watch Pump01.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "width": 56.546875, + "height": 27.4609375 + }, + { + "name": "Expand Sibling01", + "width": 91.359375, + "height": 19.671875 + }, + { + "name": "Remove Pump01.PV", + "width": 66.515625, + "height": 27.4609375 + }, + { + "name": "Remove Pump01.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "width": 66.515625, + "height": 27.4609375 + } + ], + "namedScrollRegions": 2, + "workflow": [ + "keyboardExpand", + "spaceWatch", + "repeatedWatchNoDuplicate", + "fullLongPathPreserved", + "searchWatchSameSubscription", + "noMatchClearFocus", + "subscriptionsRetained", + "namedScrollerTabReachesActions" + ], + "zoom": 2, + "dpr": 2 + }, + { + "viewport": 390, + "scroll": 390, + "coarse": true, + "targets": [ + { + "name": "Collapse SyntheticPlant", + "width": 128.78125, + "height": 44 + }, + { + "name": "Collapse Pump01", + "width": 86.09375, + "height": 44 + }, + { + "name": "Watch Pump01.PV", + "width": 56.546875, + "height": 44 + }, + { + "name": "Watch Pump01.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "width": 56.546875, + "height": 44 + }, + { + "name": "Expand Sibling01", + "width": 91.375, + "height": 44 + }, + { + "name": "Remove Pump01.PV", + "width": 66.515625, + "height": 44 + }, + { + "name": "Remove Pump01.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "width": 66.515625, + "height": 44 + } + ], + "namedScrollRegions": 2, + "workflow": [ + "keyboardExpand", + "spaceWatch", + "repeatedWatchNoDuplicate", + "fullLongPathPreserved", + "searchWatchSameSubscription", + "noMatchClearFocus", + "subscriptionsRetained", + "namedScrollerTabReachesActions" + ] + } + ], + "errors": [] +} \ No newline at end of file diff --git a/docs/ui-validation/evidence/browse-first.log b/docs/ui-validation/evidence/browse-first.log new file mode 100644 index 00000000..9f64d00b --- /dev/null +++ b/docs/ui-validation/evidence/browse-first.log @@ -0,0 +1,6 @@ +{ + "cases": 5, + "overflow": [], + "coarseBelow44": [], + "errors": [] +} diff --git a/docs/ui-validation/evidence/browse-first/browse-1024-zoom1.png b/docs/ui-validation/evidence/browse-first/browse-1024-zoom1.png new file mode 100644 index 00000000..245fe932 Binary files /dev/null and b/docs/ui-validation/evidence/browse-first/browse-1024-zoom1.png differ diff --git a/docs/ui-validation/evidence/browse-first/browse-1440-zoom1.png b/docs/ui-validation/evidence/browse-first/browse-1440-zoom1.png new file mode 100644 index 00000000..91e89266 Binary files /dev/null and b/docs/ui-validation/evidence/browse-first/browse-1440-zoom1.png differ diff --git a/docs/ui-validation/evidence/browse-first/browse-1440-zoom2.png b/docs/ui-validation/evidence/browse-first/browse-1440-zoom2.png new file mode 100644 index 00000000..e605e8ff Binary files /dev/null and b/docs/ui-validation/evidence/browse-first/browse-1440-zoom2.png differ diff --git a/docs/ui-validation/evidence/browse-first/browse-390-zoom1.png b/docs/ui-validation/evidence/browse-first/browse-390-zoom1.png new file mode 100644 index 00000000..ea2d6e49 Binary files /dev/null and b/docs/ui-validation/evidence/browse-first/browse-390-zoom1.png differ diff --git a/docs/ui-validation/evidence/browse-first/browse-coarse390.png b/docs/ui-validation/evidence/browse-first/browse-coarse390.png new file mode 100644 index 00000000..8255360f Binary files /dev/null and b/docs/ui-validation/evidence/browse-first/browse-coarse390.png differ diff --git a/docs/ui-validation/evidence/browse-first/results.json b/docs/ui-validation/evidence/browse-first/results.json new file mode 100644 index 00000000..7a83cd90 --- /dev/null +++ b/docs/ui-validation/evidence/browse-first/results.json @@ -0,0 +1,273 @@ +{ + "cases": [ + { + "viewport": 1440, + "scroll": 1440, + "coarse": false, + "targets": [ + { + "name": "Collapse SyntheticPlant", + "width": 128.78125, + "height": 19.6875 + }, + { + "name": "Collapse Pump01", + "width": 86.09375, + "height": 19.6875 + }, + { + "name": "Watch Pump01.PV", + "width": 56.546875, + "height": 27.46875 + }, + { + "name": "Watch Pump01.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "width": 56.546875, + "height": 27.46875 + }, + { + "name": "Expand Sibling01", + "width": 91.375, + "height": 19.6875 + }, + { + "name": "Remove", + "width": 66.515625, + "height": 27.46875 + }, + { + "name": "Remove", + "width": 66.515625, + "height": 27.46875 + } + ], + "namedScrollRegions": 0, + "workflow": [ + "keyboardExpand", + "spaceWatch", + "repeatedWatchNoDuplicate", + "fullLongPathPreserved", + "searchWatchSameSubscription", + "noMatchClearFocus", + "subscriptionsRetained" + ], + "zoom": 1, + "dpr": 1 + }, + { + "viewport": 1024, + "scroll": 1024, + "coarse": false, + "targets": [ + { + "name": "Collapse SyntheticPlant", + "width": 128.78125, + "height": 19.6875 + }, + { + "name": "Collapse Pump01", + "width": 86.09375, + "height": 19.6875 + }, + { + "name": "Watch Pump01.PV", + "width": 56.546875, + "height": 27.46875 + }, + { + "name": "Watch Pump01.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "width": 56.546875, + "height": 27.46875 + }, + { + "name": "Expand Sibling01", + "width": 91.375, + "height": 19.6875 + }, + { + "name": "Remove", + "width": 66.515625, + "height": 27.46875 + }, + { + "name": "Remove", + "width": 66.515625, + "height": 27.46875 + } + ], + "namedScrollRegions": 0, + "workflow": [ + "keyboardExpand", + "spaceWatch", + "repeatedWatchNoDuplicate", + "fullLongPathPreserved", + "searchWatchSameSubscription", + "noMatchClearFocus", + "subscriptionsRetained" + ], + "zoom": 1, + "dpr": 1 + }, + { + "viewport": 390, + "scroll": 390, + "coarse": false, + "targets": [ + { + "name": "Collapse SyntheticPlant", + "width": 128.78125, + "height": 19.6875 + }, + { + "name": "Collapse Pump01", + "width": 86.09375, + "height": 19.6875 + }, + { + "name": "Watch Pump01.PV", + "width": 56.546875, + "height": 27.46875 + }, + { + "name": "Watch Pump01.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "width": 56.546875, + "height": 27.46875 + }, + { + "name": "Expand Sibling01", + "width": 91.375, + "height": 19.6875 + }, + { + "name": "Remove", + "width": 66.515625, + "height": 27.46875 + }, + { + "name": "Remove", + "width": 66.515625, + "height": 27.46875 + } + ], + "namedScrollRegions": 0, + "workflow": [ + "keyboardExpand", + "spaceWatch", + "repeatedWatchNoDuplicate", + "fullLongPathPreserved", + "searchWatchSameSubscription", + "noMatchClearFocus", + "subscriptionsRetained" + ], + "zoom": 1, + "dpr": 1 + }, + { + "viewport": 720, + "scroll": 720, + "coarse": false, + "targets": [ + { + "name": "Collapse SyntheticPlant", + "width": 128.78125, + "height": 19.671875 + }, + { + "name": "Collapse Pump01", + "width": 86.078125, + "height": 19.671875 + }, + { + "name": "Watch Pump01.PV", + "width": 56.546875, + "height": 27.4609375 + }, + { + "name": "Watch Pump01.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "width": 56.546875, + "height": 27.4609375 + }, + { + "name": "Expand Sibling01", + "width": 91.359375, + "height": 19.671875 + }, + { + "name": "Remove", + "width": 66.515625, + "height": 27.4609375 + }, + { + "name": "Remove", + "width": 66.515625, + "height": 27.4609375 + } + ], + "namedScrollRegions": 0, + "workflow": [ + "keyboardExpand", + "spaceWatch", + "repeatedWatchNoDuplicate", + "fullLongPathPreserved", + "searchWatchSameSubscription", + "noMatchClearFocus", + "subscriptionsRetained" + ], + "zoom": 2, + "dpr": 2 + }, + { + "viewport": 390, + "scroll": 390, + "coarse": false, + "targets": [ + { + "name": "Collapse SyntheticPlant", + "width": 128.78125, + "height": 19.6875 + }, + { + "name": "Collapse Pump01", + "width": 86.09375, + "height": 19.6875 + }, + { + "name": "Watch Pump01.PV", + "width": 56.546875, + "height": 27.46875 + }, + { + "name": "Watch Pump01.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "width": 56.546875, + "height": 27.46875 + }, + { + "name": "Expand Sibling01", + "width": 91.375, + "height": 19.6875 + }, + { + "name": "Remove", + "width": 66.515625, + "height": 27.46875 + }, + { + "name": "Remove", + "width": 66.515625, + "height": 27.46875 + } + ], + "namedScrollRegions": 0, + "workflow": [ + "keyboardExpand", + "spaceWatch", + "repeatedWatchNoDuplicate", + "fullLongPathPreserved", + "searchWatchSameSubscription", + "noMatchClearFocus", + "subscriptionsRetained" + ] + } + ], + "errors": [] +} \ No newline at end of file diff --git a/docs/ui-validation/evidence/coarse-before.json b/docs/ui-validation/evidence/coarse-before.json new file mode 100644 index 00000000..853649df --- /dev/null +++ b/docs/ui-validation/evidence/coarse-before.json @@ -0,0 +1,52 @@ +{ + "viewport": 390, + "scroll": 390, + "coarse": true, + "targets": [ + { + "name": "Collapse SyntheticPlant", + "width": 128.78125, + "height": 19.6875 + }, + { + "name": "Collapse Pump01", + "width": 86.09375, + "height": 19.6875 + }, + { + "name": "Watch Pump01.PV", + "width": 56.546875, + "height": 27.46875 + }, + { + "name": "Watch Pump01.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "width": 56.546875, + "height": 27.46875 + }, + { + "name": "Expand Sibling01", + "width": 91.375, + "height": 19.687469482421875 + }, + { + "name": "Remove", + "width": 66.515625, + "height": 27.46875 + }, + { + "name": "Remove", + "width": 66.515625, + "height": 27.46875 + } + ], + "namedScrollRegions": 0, + "workflow": [ + "keyboardExpand", + "spaceWatch", + "repeatedWatchNoDuplicate", + "fullLongPathPreserved", + "searchWatchSameSubscription", + "noMatchClearFocus", + "subscriptionsRetained" + ] +} \ No newline at end of file diff --git a/docs/ui-validation/evidence/mx01/fixture-build.log b/docs/ui-validation/evidence/mx01/fixture-build.log new file mode 100644 index 00000000..e1f70f47 --- /dev/null +++ b/docs/ui-validation/evidence/mx01/fixture-build.log @@ -0,0 +1,13 @@ + Determining projects to restore... + Restored /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Contracts/ZB.MOM.WW.MxGateway.Contracts.csproj (in 159 ms). + Restored /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Server/ZB.MOM.WW.MxGateway.Server.csproj (in 198 ms). + Restored /Users/dohertj2/Desktop/MxAccessGateway/docs/ui-validation/host/MxUiCanary.csproj (in 198 ms). + ZB.MOM.WW.MxGateway.Contracts -> /tmp/mx-ui-browse-artifacts/bin/ZB.MOM.WW.MxGateway.Contracts/release_net10.0/ZB.MOM.WW.MxGateway.Contracts.dll + ZB.MOM.WW.MxGateway.Server -> /tmp/mx-ui-browse-artifacts/bin/ZB.MOM.WW.MxGateway.Server/release/ZB.MOM.WW.MxGateway.Server.dll + MxUiCanary -> /tmp/mx-ui-browse-artifacts/bin/MxUiCanary/release/MxUiCanary.dll + +Build succeeded. + 0 Warning(s) + 0 Error(s) + +Time Elapsed 00:00:02.91 diff --git a/docs/ui-validation/evidence/mx01/green.log b/docs/ui-validation/evidence/mx01/green.log new file mode 100644 index 00000000..944c1ebe --- /dev/null +++ b/docs/ui-validation/evidence/mx01/green.log @@ -0,0 +1,9 @@ + Determining projects to restore... + All projects are up-to-date for restore. + ZB.MOM.WW.MxGateway.Contracts -> /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Contracts/bin/Release/net10.0/ZB.MOM.WW.MxGateway.Contracts.dll + ZB.MOM.WW.MxGateway.Server -> /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Server/bin/Release/net10.0/ZB.MOM.WW.MxGateway.Server.dll + ZB.MOM.WW.MxGateway.Tests -> /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Tests/bin/Release/net10.0/ZB.MOM.WW.MxGateway.Tests.dll +Test run for /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Tests/bin/Release/net10.0/ZB.MOM.WW.MxGateway.Tests.dll (.NETCoreApp,Version=v10.0) +A total of 1 test files matched the specified pattern. + +Passed! - Failed: 0, Passed: 7, Skipped: 0, Total: 7, Duration: 23 ms - ZB.MOM.WW.MxGateway.Tests.dll (net10.0) diff --git a/docs/ui-validation/evidence/mx01/red.log b/docs/ui-validation/evidence/mx01/red.log new file mode 100644 index 00000000..637c1c19 --- /dev/null +++ b/docs/ui-validation/evidence/mx01/red.log @@ -0,0 +1,18 @@ + Determining projects to restore... + All projects are up-to-date for restore. + ZB.MOM.WW.MxGateway.Contracts -> /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Contracts/bin/Release/net10.0/ZB.MOM.WW.MxGateway.Contracts.dll + ZB.MOM.WW.MxGateway.Server -> /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Server/bin/Release/net10.0/ZB.MOM.WW.MxGateway.Server.dll + ZB.MOM.WW.MxGateway.Tests -> /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Tests/bin/Release/net10.0/ZB.MOM.WW.MxGateway.Tests.dll +Test run for /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Tests/bin/Release/net10.0/ZB.MOM.WW.MxGateway.Tests.dll (.NETCoreApp,Version=v10.0) +A total of 1 test files matched the specified pattern. +[xUnit.net 00:00:00.20] ZB.MOM.WW.MxGateway.Tests.Dashboard.BrowseTreeAccessibilityTests.LazyNode_HasNamedNativeExpansionAndControlledRegion [FAIL] + Failed ZB.MOM.WW.MxGateway.Tests.Dashboard.BrowseTreeAccessibilityTests.LazyNode_HasNamedNativeExpansionAndControlledRegion [1 ms] + Error Message: + Assert.Contains() Failure: Sub-string not found +String: "
/Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Contracts/bin/Release/net10.0/ZB.MOM.WW.MxGateway.Contracts.dll + ZB.MOM.WW.MxGateway.Server -> /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Server/bin/Release/net10.0/ZB.MOM.WW.MxGateway.Server.dll + ZB.MOM.WW.MxGateway.Tests -> /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Tests/bin/Release/net10.0/ZB.MOM.WW.MxGateway.Tests.dll +Test run for /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Tests/bin/Release/net10.0/ZB.MOM.WW.MxGateway.Tests.dll (.NETCoreApp,Version=v10.0) +A total of 1 test files matched the specified pattern. + +Passed! - Failed: 0, Passed: 12, Skipped: 0, Total: 12, Duration: 33 ms - ZB.MOM.WW.MxGateway.Tests.dll (net10.0) diff --git a/docs/ui-validation/evidence/mx03/fixture-build-confirmation.log b/docs/ui-validation/evidence/mx03/fixture-build-confirmation.log new file mode 100644 index 00000000..4fd33276 --- /dev/null +++ b/docs/ui-validation/evidence/mx03/fixture-build-confirmation.log @@ -0,0 +1,13 @@ + Determining projects to restore... + Restored /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Contracts/ZB.MOM.WW.MxGateway.Contracts.csproj (in 435 ms). + Restored /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Server/ZB.MOM.WW.MxGateway.Server.csproj (in 446 ms). + Restored /Users/dohertj2/Desktop/MxAccessGateway/docs/ui-validation/host/MxUiCanary.csproj (in 446 ms). + ZB.MOM.WW.MxGateway.Contracts -> /tmp/mx-ui-browse3-artifacts/bin/ZB.MOM.WW.MxGateway.Contracts/release_net10.0/ZB.MOM.WW.MxGateway.Contracts.dll + ZB.MOM.WW.MxGateway.Server -> /tmp/mx-ui-browse3-artifacts/bin/ZB.MOM.WW.MxGateway.Server/release/ZB.MOM.WW.MxGateway.Server.dll + MxUiCanary -> /tmp/mx-ui-browse3-artifacts/bin/MxUiCanary/release/MxUiCanary.dll + +Build succeeded. + 0 Warning(s) + 0 Error(s) + +Time Elapsed 00:00:02.56 diff --git a/docs/ui-validation/evidence/mx03/fixture-build.log b/docs/ui-validation/evidence/mx03/fixture-build.log new file mode 100644 index 00000000..8cc79262 --- /dev/null +++ b/docs/ui-validation/evidence/mx03/fixture-build.log @@ -0,0 +1,13 @@ + Determining projects to restore... + Restored /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Contracts/ZB.MOM.WW.MxGateway.Contracts.csproj (in 139 ms). + Restored /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Server/ZB.MOM.WW.MxGateway.Server.csproj (in 150 ms). + Restored /Users/dohertj2/Desktop/MxAccessGateway/docs/ui-validation/host/MxUiCanary.csproj (in 150 ms). + ZB.MOM.WW.MxGateway.Contracts -> /tmp/mx-ui-browse2-artifacts/bin/ZB.MOM.WW.MxGateway.Contracts/release_net10.0/ZB.MOM.WW.MxGateway.Contracts.dll + ZB.MOM.WW.MxGateway.Server -> /tmp/mx-ui-browse2-artifacts/bin/ZB.MOM.WW.MxGateway.Server/release/ZB.MOM.WW.MxGateway.Server.dll + MxUiCanary -> /tmp/mx-ui-browse2-artifacts/bin/MxUiCanary/release/MxUiCanary.dll + +Build succeeded. + 0 Warning(s) + 0 Error(s) + +Time Elapsed 00:00:02.25 diff --git a/docs/ui-validation/evidence/mx03/green.log b/docs/ui-validation/evidence/mx03/green.log new file mode 100644 index 00000000..1d333a41 --- /dev/null +++ b/docs/ui-validation/evidence/mx03/green.log @@ -0,0 +1,9 @@ + Determining projects to restore... + All projects are up-to-date for restore. + ZB.MOM.WW.MxGateway.Contracts -> /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Contracts/bin/Release/net10.0/ZB.MOM.WW.MxGateway.Contracts.dll + ZB.MOM.WW.MxGateway.Server -> /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Server/bin/Release/net10.0/ZB.MOM.WW.MxGateway.Server.dll + ZB.MOM.WW.MxGateway.Tests -> /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Tests/bin/Release/net10.0/ZB.MOM.WW.MxGateway.Tests.dll +Test run for /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Tests/bin/Release/net10.0/ZB.MOM.WW.MxGateway.Tests.dll (.NETCoreApp,Version=v10.0) +A total of 1 test files matched the specified pattern. + +Passed! - Failed: 0, Passed: 12, Skipped: 0, Total: 12, Duration: 30 ms - ZB.MOM.WW.MxGateway.Tests.dll (net10.0) diff --git a/docs/ui-validation/evidence/mx03/red.log b/docs/ui-validation/evidence/mx03/red.log new file mode 100644 index 00000000..a5930d2b --- /dev/null +++ b/docs/ui-validation/evidence/mx03/red.log @@ -0,0 +1,20 @@ + Determining projects to restore... + All projects are up-to-date for restore. + ZB.MOM.WW.MxGateway.Contracts -> /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Contracts/bin/Release/net10.0/ZB.MOM.WW.MxGateway.Contracts.dll + ZB.MOM.WW.MxGateway.Server -> /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Server/bin/Release/net10.0/ZB.MOM.WW.MxGateway.Server.dll + ZB.MOM.WW.MxGateway.Tests -> /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Tests/bin/Release/net10.0/ZB.MOM.WW.MxGateway.Tests.dll +Test run for /Users/dohertj2/Desktop/MxAccessGateway/src/ZB.MOM.WW.MxGateway.Tests/bin/Release/net10.0/ZB.MOM.WW.MxGateway.Tests.dll (.NETCoreApp,Version=v10.0) +A total of 1 test files matched the specified pattern. +[xUnit.net 00:00:00.21] ZB.MOM.WW.MxGateway.Tests.Dashboard.BrowseSearchAccessibilityTests.Search_HasPersistentLabelHintAndControlledResults [FAIL] + Failed ZB.MOM.WW.MxGateway.Tests.Dashboard.BrowseSearchAccessibilityTests.Search_HasPersistentLabelHintAndControlledResults [37 ms] + Error Message: + Assert.Contains() Failure: Sub-string not found +String: "\n\n

Synthetic cached Galaxy and redacted fixture values. No COM or worker.

+@code { protected override async Task OnAfterRenderAsync(bool firstRender){if(firstRender)await JS.InvokeVoidAsync("mxCanaryReady");} } diff --git a/docs/ui-validation/host/Components/FixtureApp.razor b/docs/ui-validation/host/Components/FixtureApp.razor index 3f7203ca..3bfe183c 100644 --- a/docs/ui-validation/host/Components/FixtureApp.razor +++ b/docs/ui-validation/host/Components/FixtureApp.razor @@ -1,2 +1,2 @@ @namespace MxUiCanary.Components - \ No newline at end of file + \ No newline at end of file diff --git a/docs/ui-validation/host/Components/FixtureRoutes.razor b/docs/ui-validation/host/Components/FixtureRoutes.razor new file mode 100644 index 00000000..68f56abb --- /dev/null +++ b/docs/ui-validation/host/Components/FixtureRoutes.razor @@ -0,0 +1,2 @@ +@namespace MxUiCanary.Components + \ No newline at end of file diff --git a/docs/ui-validation/host/Components/_Imports.razor b/docs/ui-validation/host/Components/_Imports.razor index 95b28279..f9713e0d 100644 --- a/docs/ui-validation/host/Components/_Imports.razor +++ b/docs/ui-validation/host/Components/_Imports.razor @@ -5,3 +5,5 @@ @using ZB.MOM.WW.Theme @using ZB.MOM.WW.MxGateway.Server.Dashboard.Components.Shared @using ZB.MOM.WW.MxGateway.Server.Dashboard.Components.Pages + +@using Microsoft.AspNetCore.Components.Routing diff --git a/docs/ui-validation/host/Fakes.cs b/docs/ui-validation/host/Fakes.cs index 9711f98d..2ceb7dd1 100644 --- a/docs/ui-validation/host/Fakes.cs +++ b/docs/ui-validation/host/Fakes.cs @@ -102,4 +102,33 @@ using ZB.MOM.WW.MxGateway.Server.Security.Authorization; authenticationType: "test", nameType: ClaimTypes.Name, roleType: ClaimTypes.Role)))); - } \ No newline at end of file + } +// In-memory Galaxy projection and read-only fake values for the actual BrowsePage. +internal sealed class FixtureGalaxyCache : ZB.MOM.WW.GalaxyRepository.IGalaxyHierarchyCache +{ + public ZB.MOM.WW.GalaxyRepository.GalaxyHierarchyCacheEntry Current { get; } + public FixtureGalaxyCache() + { + var plant = new ZB.MOM.WW.GalaxyRepository.Grpc.GalaxyObject { GobjectId = 1, TagName = "SyntheticPlant", BrowseName = "SyntheticPlant", IsArea = true }; + var pump = new ZB.MOM.WW.GalaxyRepository.Grpc.GalaxyObject { GobjectId = 2, ParentGobjectId = 1, TagName = "Pump01", BrowseName = "Pump01" }; + pump.Attributes.Add(new ZB.MOM.WW.GalaxyRepository.Grpc.GalaxyAttribute { AttributeName = "PV", FullTagReference = "Pump01.PV", DataTypeName = "Float" }); + pump.Attributes.Add(new ZB.MOM.WW.GalaxyRepository.Grpc.GalaxyAttribute { AttributeName = new string('x', 200), FullTagReference = "Pump01." + new string('x', 200), DataTypeName = "Float" }); + var sibling = new ZB.MOM.WW.GalaxyRepository.Grpc.GalaxyObject { GobjectId = 3, ParentGobjectId = 1, TagName = "Sibling01", BrowseName = "Sibling01" }; + sibling.Attributes.Add(new ZB.MOM.WW.GalaxyRepository.Grpc.GalaxyAttribute { AttributeName = "PV", FullTagReference = "Sibling01.PV", DataTypeName = "Float" }); + ZB.MOM.WW.GalaxyRepository.Grpc.GalaxyObject[] rows = [plant, pump, sibling]; + Current = ZB.MOM.WW.GalaxyRepository.GalaxyHierarchyCacheEntry.Empty with { + Status = ZB.MOM.WW.GalaxyRepository.GalaxyCacheStatus.Healthy, Sequence = 1, + Objects = rows, Index = ZB.MOM.WW.GalaxyRepository.GalaxyHierarchyIndex.Build(rows), ObjectCount = rows.Length, AttributeCount = 3, + LastSuccessAt = DateTimeOffset.UtcNow, + }; + } + public Task RefreshAsync(CancellationToken cancellationToken) => Task.CompletedTask; + public Task WaitForFirstLoadAsync(CancellationToken cancellationToken) => Task.CompletedTask; +} +internal sealed class FixtureLiveData : IDashboardLiveDataService +{ + public Task ReadAsync(IReadOnlyCollection tagAddresses, CancellationToken cancellationToken) => + Task.FromResult(new DashboardLiveReadResult(tagAddresses.Select(tag => new DashboardTagValue(tag, true, "[redacted]", "Float", 192, true, DateTimeOffset.UnixEpoch, null)).ToArray(), null, "synthetic-no-worker", null)); + public Task QueryAlarmsAsync(CancellationToken cancellationToken) => + Task.FromResult(new DashboardAlarmQueryResult([], null, null)); +} diff --git a/docs/ui-validation/host/Program.cs b/docs/ui-validation/host/Program.cs index 78ea5f5b..0a7d747f 100644 --- a/docs/ui-validation/host/Program.cs +++ b/docs/ui-validation/host/Program.cs @@ -10,6 +10,12 @@ builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddScoped(); var app = builder.Build(); app.UseStaticFiles(new StaticFileOptions { FileProvider = new PhysicalFileProvider(Path.GetFullPath("../../../src/ZB.MOM.WW.MxGateway.Server/wwwroot")) }); app.UseStaticFiles();app.UseAntiforgery(); diff --git a/docs/ui-validation/technical-light-browse.md b/docs/ui-validation/technical-light-browse.md new file mode 100644 index 00000000..5920b568 --- /dev/null +++ b/docs/ui-validation/technical-light-browse.md @@ -0,0 +1,61 @@ +# Keyboard, search and touch browse validation + +MX-01, MX-03 and MX-07 implemented against the actual BrowsePage and recursive +BrowseTreeNodeView. Existing lazy projection, search index/debounce/cap, +subscription deduplication, read scope, cancellation and live-read paths are retained. +Only synthetic cached Galaxy metadata and redacted fake reads were exercised here. +No COM, SQL, worker, LDAP or live key/session operation was involved. + +Each expandable node has one native named button, explicit expanded state and a +stable controlled container. Leaf objects do not advertise unavailable expansion. +Explicit Watch actions on hierarchy attributes and search hits call the same +AddTagAsync path as the retained mouse accelerators. A second Watch does not add +another subscription. Visible introductory copy now makes Watch the primary path. + +The search has a persistent visible label, cached-metadata boundary hint and +controlled-results relationship. Its caller-owned polite result summary follows +user searches, not the two-second value poll. Clear search cancels the existing +search through its established setter and restores input focus after render. +Search does not touch watched values; no-match/clear preserves subscribed rows. + +Named focusable hierarchy/search/table regions contain long content. Full 207-character +fixture references remain copyable and Watch stays at the tree's visible right edge. +Remove actions name their full tag; a keyboard user can Tab from the named table +scroller to a last-column action, which scrolls it into view. Pointer-coarse browse +controls have 44 px minimum hit areas; desktop row sizes retain their compact geometry. +The published Theme 1.0.1 supplies typography/tokens/focus; its package currently has +no generic coarse-pointer sizing utility, so these domain-specific sizes remain local +as allowed by the chapter's tree/control ownership. No shared-grid CSS was copied. + +## Observed evidence + +- Named expansion regression failed on the original generic toggle; leaf control + case remained green. Search label/hint/control regression failed before the field + contract. After implementation, 12 focused tree/search/projection/index tests pass. + Framework HtmlRenderer remains; no bUnit dependency was added. +- Actual synthetic routed fixture uses the production BrowsePage, recursive nodes, + DashboardBrowseService projection and real DashboardBrowseSearchIndex. Its singleton + cache/read providers are entirely in memory. The host now routes both native-dialog + and browse fixtures through a standard Router and provides HeadOutlet. +- One first batched inspection and one corrective confirmation cover 1440/1024/390px, + real 200% zoom (720 CSS px/DPR 2), and coarse-pointer 390px. All five final workflows pass: + keyboard expansion/Watch, repeated Watch with one row, preserved full long reference, + search-hit Watch without duplicate, no-match/Clear/focus and retained subscriptions. + Named scroller Tab reaches a full-context Remove action. No document overflow or + browser page errors. See `evidence/browse-confirmation/results.json` and images. +- The first touch-context request did not actually enable touch on this installed + Chromium: navigator.maxTouchPoints remained 0 and pointer:coarse was false. This + is visible in the first JSON and was not accepted as touch proof. Explicit browser + CDP touch emulation then establishes maxTouchPoints 1 and pointer:coarse=true. + `coarse-before.json` reproduces 19.7 px node/27.5 px Watch/Remove heights. The final + actual coarse mode reports 44 px heights; its primary expand/Watch/Clear path uses + touchscreen tap events. No CSS-only media override or screenshot relabeling. +- First/corrective screenshots were inspected together. The correction names scroll + regions, keeps Watch visible for long rows and expands only coarse-pointer targets. + Full gateway regression testing remains at the chapter phase boundary; current + evidence does not claim live COM/ACL integration or human screen-reader listening. + +The shared Theme compatibility/native-dialog checkpoint is documented separately in +`technical-light-dialogs.md`. Fault-first overview, remaining token/state cleanup, +recoverable diagnostic behavior, rail vocabulary and shared Secrets release adoption +remain separate chapter tasks; this browse checkpoint does not close them. diff --git a/src/ZB.MOM.WW.MxGateway.Server/Dashboard/Components/Pages/BrowsePage.razor b/src/ZB.MOM.WW.MxGateway.Server/Dashboard/Components/Pages/BrowsePage.razor index 69c4e0c8..979c2f68 100644 --- a/src/ZB.MOM.WW.MxGateway.Server/Dashboard/Components/Pages/BrowsePage.razor +++ b/src/ZB.MOM.WW.MxGateway.Server/Dashboard/Components/Pages/BrowsePage.razor @@ -24,10 +24,22 @@

Galaxy Hierarchy

- + +
+ + Clear search +
+
+
+ @if (!string.IsNullOrWhiteSpace(Search)) + { +

+ @(_searchPending ? "Searching cached attributes…" : _searchError is not null ? "Search unavailable." : $"{_searchMatches.Count} matching attribute{(_searchMatches.Count == 1 ? "" : "s")}{(_searchMatches.Count >= SearchResultLimit ? " shown; refine the filter for more specific results." : ".")}") +

+ } @if (_roots.Count == 0) { @@ -48,11 +60,11 @@ } else if (_searchMatches.Count == 0) { -
No attributes match “@Search”.
+
No attributes match “@Search”. Clear search to return to the hierarchy.
} else { -
+
@foreach (GalaxyAttribute hit in _searchMatches) { GalaxyAttribute row = hit; @@ -72,6 +84,10 @@ { hist } +
}
@@ -88,7 +104,7 @@
@_staleBanner
} -
+
@foreach (DashboardBrowseNode root in _roots) { }
-
Double-click a tag, or right-click for the menu.
+
Choose Watch to add an attribute. Double-click and the right-click menu are also available.
} +
@@ -135,14 +152,13 @@ @if (_subscribed.Count == 0) {
- No tags subscribed. Right-click a tag in the hierarchy and choose - Add to subscription panel (or double-click it) to watch its - live value, quality and source timestamp here. + No tags subscribed. Choose Watch beside an attribute to see its live value, quality and source timestamp here. + Double-click and Add to subscription panel in the context menu are also available.
} else { -
+
@@ -151,7 +167,7 @@ - + @@ -183,6 +199,7 @@ @@ -209,6 +226,25 @@ } @code { + private ElementReference _searchInput; + private bool _focusSearch; + private bool _disposing; + + private void ClearSearch() + { + Search = string.Empty; + _focusSearch = true; + } + + /// + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (!_focusSearch || _disposing) return; + _focusSearch = false; + try { await _searchInput.FocusAsync(); } + catch (Microsoft.JSInterop.JSDisconnectedException) { } + } + private const int SearchResultLimit = 300; // Keystrokes inside this window coalesce into one search: typing a tag name no @@ -653,6 +689,7 @@ /// public async ValueTask DisposeAsync() { + _disposing = true; try { await _cts.CancelAsync().ConfigureAwait(false); diff --git a/src/ZB.MOM.WW.MxGateway.Server/Dashboard/Components/Shared/BrowseTreeNodeView.razor b/src/ZB.MOM.WW.MxGateway.Server/Dashboard/Components/Shared/BrowseTreeNodeView.razor index 1b399927..e6908355 100644 --- a/src/ZB.MOM.WW.MxGateway.Server/Dashboard/Components/Shared/BrowseTreeNodeView.razor +++ b/src/ZB.MOM.WW.MxGateway.Server/Dashboard/Components/Shared/BrowseTreeNodeView.razor @@ -3,7 +3,7 @@ @* Recursive Browse hierarchy node. Renders one Galaxy object, its child objects (recursively, lazy-loaded on first expand), and its attributes as - right-clickable tag rows. Expansion state is local; children render only + explicitly watchable tag rows (with mouse accelerators). Expansion state is local; children render only while expanded. The expand triangle is shown whenever the server's child_has_children @@ -16,27 +16,36 @@
@if (ShowToggle()) { - } else { - + + + + @Node.DisplayName + @if (!string.IsNullOrWhiteSpace(Node.Object.TagName) + && !string.Equals(Node.Object.TagName, Node.DisplayName, StringComparison.Ordinal)) + { + @Node.Object.TagName + } + } - - @(Node.IsArea ? "▣" : "◇") - @Node.DisplayName - @if (!string.IsNullOrWhiteSpace(Node.Object.TagName) - && !string.Equals(Node.Object.TagName, Node.DisplayName, StringComparison.Ordinal)) - { - @Node.Object.TagName - } -
+ @code { + private readonly string ChildrenId = $"browse-children-{Guid.NewGuid():N}"; /// The hierarchy node this view renders. [Parameter] [EditorRequired] public DashboardBrowseNode Node { get; set; } = null!; - /// Raised with a tag's full reference when the operator double-clicks it. + /// Raised with a tag's full reference when Watch or its mouse accelerator is activated. [Parameter] public EventCallback OnAddTag { get; set; } diff --git a/src/ZB.MOM.WW.MxGateway.Server/wwwroot/css/site.css b/src/ZB.MOM.WW.MxGateway.Server/wwwroot/css/site.css index 67864335..2a651362 100644 --- a/src/ZB.MOM.WW.MxGateway.Server/wwwroot/css/site.css +++ b/src/ZB.MOM.WW.MxGateway.Server/wwwroot/css/site.css @@ -547,3 +547,22 @@ code { .dashboard-native-dialog .modal-header, .dashboard-native-dialog .modal-footer { flex-shrink: 0; } .dashboard-native-dialog.api-key-create-modal .modal-body { min-height: 0; max-height: none; overflow-y: auto; } .dashboard-native-dialog .native-dialog-feedback { margin: 0; border-radius: 0; flex-shrink: 0; } + +/* One native expansion target per node; Watch uses the existing subscription path. */ +.tree-node-toggle { + display: flex; align-items: center; gap: .35rem; min-width: 0; + padding: 0; border: 0; background: transparent; color: inherit; + font: inherit; text-align: left; cursor: pointer; +} +.tree-leaf-label { cursor: default; } +.tree-watch { margin-left: auto; flex-shrink: 0; } + +.browse-search-controls { display: flex; align-items: start; flex-wrap: wrap; gap: .5rem; } +.browse-search-controls .browse-search { flex: 1 1 12rem; min-width: 0; } + +/* Domain tree/table containment; compact desktop rows retain their existing size. */ +.browse-panel { min-width: 0; } +.tree-watch { position: sticky; right: 0; } +@media (pointer: coarse) { + .browse-layout button, .browse-search-controls .form-control { min-width: 44px; min-height: 44px; } +} diff --git a/src/ZB.MOM.WW.MxGateway.Tests/Dashboard/BrowseSearchAccessibilityTests.cs b/src/ZB.MOM.WW.MxGateway.Tests/Dashboard/BrowseSearchAccessibilityTests.cs new file mode 100644 index 00000000..739f88e2 --- /dev/null +++ b/src/ZB.MOM.WW.MxGateway.Tests/Dashboard/BrowseSearchAccessibilityTests.cs @@ -0,0 +1,58 @@ +using Microsoft.AspNetCore.Components.Web; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using ZB.MOM.WW.GalaxyRepository; +using ZB.MOM.WW.GalaxyRepository.Grpc; +using ZB.MOM.WW.MxGateway.Server.Dashboard; +using ZB.MOM.WW.MxGateway.Server.Dashboard.Components.Pages; + +namespace ZB.MOM.WW.MxGateway.Tests.Dashboard; + +/// Persistent search semantics against real cache projection; interaction uses browser fixtures. +public sealed class BrowseSearchAccessibilityTests +{ + /// The purpose and metadata-only boundary remain visible after typing. + [Fact] + public async Task Search_HasPersistentLabelHintAndControlledResults() + { + ServiceCollection services = new(); + services.AddLogging(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddScoped(); + services.AddSingleton(); + await using ServiceProvider provider = services.BuildServiceProvider(); + await using HtmlRenderer renderer = new(provider, provider.GetRequiredService()); + string html = await renderer.Dispatcher.InvokeAsync(async () => + (await renderer.RenderComponentAsync()).ToHtmlString()); + Assert.Contains("for=\"browse-search\"", html, StringComparison.Ordinal); + Assert.Contains("id=\"browse-search\"", html, StringComparison.Ordinal); + Assert.Contains("Filter Galaxy attributes", html, StringComparison.Ordinal); + Assert.Contains("aria-describedby=\"browse-search-hint\"", html, StringComparison.Ordinal); + Assert.Contains("id=\"browse-search-hint\"", html, StringComparison.Ordinal); + Assert.Contains("aria-controls=\"browse-results\"", html, StringComparison.Ordinal); + Assert.Contains("id=\"browse-results\"", html, StringComparison.Ordinal); + Assert.Contains("Clear search", html, StringComparison.Ordinal); + } + + private sealed class InMemoryCache : IGalaxyHierarchyCache + { + public GalaxyHierarchyCacheEntry Current { get; } + public InMemoryCache() + { + GalaxyObject row = new() { GobjectId = 1, TagName = "SyntheticPump", BrowseName = "SyntheticPump" }; + row.Attributes.Add(new GalaxyAttribute { AttributeName = "PV", FullTagReference = "SyntheticPump.PV" }); + Current = GalaxyHierarchyCacheEntry.Empty with { Status = GalaxyCacheStatus.Healthy, Sequence = 1, + Objects = [row], Index = GalaxyHierarchyIndex.Build([row]), ObjectCount = 1, LastSuccessAt = DateTimeOffset.UnixEpoch }; + } + public Task RefreshAsync(CancellationToken cancellationToken) => Task.CompletedTask; + public Task WaitForFirstLoadAsync(CancellationToken cancellationToken) => Task.CompletedTask; + } + private sealed class NoWorkerLiveData : IDashboardLiveDataService + { + public Task ReadAsync(IReadOnlyCollection tags, CancellationToken cancellationToken) => Task.FromResult(DashboardLiveReadResult.Empty); + public Task QueryAlarmsAsync(CancellationToken cancellationToken) => Task.FromResult(new DashboardAlarmQueryResult([], null, null)); + } +} diff --git a/src/ZB.MOM.WW.MxGateway.Tests/Dashboard/BrowseTreeAccessibilityTests.cs b/src/ZB.MOM.WW.MxGateway.Tests/Dashboard/BrowseTreeAccessibilityTests.cs new file mode 100644 index 00000000..b2cb554f --- /dev/null +++ b/src/ZB.MOM.WW.MxGateway.Tests/Dashboard/BrowseTreeAccessibilityTests.cs @@ -0,0 +1,51 @@ +using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components.Web; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using ZB.MOM.WW.GalaxyRepository.Grpc; +using ZB.MOM.WW.MxGateway.Server.Dashboard; +using ZB.MOM.WW.MxGateway.Server.Dashboard.Components.Shared; + +namespace ZB.MOM.WW.MxGateway.Tests.Dashboard; + +/// Initial recursive browse semantics; keyboard watch flow uses a real browser. +public sealed class BrowseTreeAccessibilityTests +{ + /// A lazy object's visible toggle is named and describes its real collapsed state. + [Fact] + public async Task LazyNode_HasNamedNativeExpansionAndControlledRegion() + { + string html = await RenderAsync(new DashboardBrowseNode + { + Object = new GalaxyObject { BrowseName = "Pump01", TagName = "Area.Pump01" }, + HasChildrenHint = true, + }); + Assert.Contains("aria-label=\"Expand Pump01\"", html, StringComparison.Ordinal); + Assert.Contains("aria-expanded=\"false\"", html, StringComparison.Ordinal); + Assert.Contains("aria-controls=", html, StringComparison.Ordinal); + Assert.DoesNotContain("aria-label=\"Toggle\"", html, StringComparison.Ordinal); + } + + /// Terminal objects do not advertise a meaningless expansion action. + [Fact] + public async Task LeafNode_DoesNotExposeUnavailableExpansion() + { + string html = await RenderAsync(new DashboardBrowseNode + { + Object = new GalaxyObject { BrowseName = "Leaf" }, + }); + Assert.DoesNotContain(" RenderAsync(DashboardBrowseNode node) + { + ServiceCollection services = new(); + services.AddLogging(); + await using ServiceProvider provider = services.BuildServiceProvider(); + await using HtmlRenderer renderer = new(provider, provider.GetRequiredService()); + return await renderer.Dispatcher.InvokeAsync(async () => + (await renderer.RenderComponentAsync(ParameterView.FromDictionary( + new Dictionary { [nameof(BrowseTreeNodeView.Node)] = node }))).ToHtmlString()); + } +}
Type Quality UpdatedActions