Commit 559f911
authored
feat(ux): embed the full civic analyst as the Risk lens (ADR-0035) (#122)
The Risk lens was a condensed subset of the civic risk app with a link out to /civic/.
It now embeds the FULL analyst in-shell — briefing + Presentation Mode (3D + holographic
info board) + analyze/verify — as a full-bleed, same-origin <iframe src="/civic/?embed=1">,
so there's no subset and zero re-implementation. Visual/integration only; golden numbers
byte-identical (584 green / 1 skipped, no test edits).
map.html (embed mode via ?embed=1):
- hide the "‹ UrbanOS" homelink (the shell's lens rail is the way back).
- bridge keyboard lens-switching to the parent: 1–4 + Escape postMessage to the shell
(parent-window keys don't fire while focus is inside the iframe), guarded vs typing/chords.
- gate the Presentation camera moves (flyTo/easeTo pitch) on prefers-reduced-motion (CSS
guards don't collapse MapLibre JS animations).
os.html:
- Risk lens lazily creates the iframe (kept the condensed panel markup verbatim — a11y/test
markers + a fallback — but hides it under the embed; dropped the now-redundant drill-down link).
- #civ-embed full-bleed at z-index 5 (below the dock/topbar at z 6/5, clearing top:52/left:108);
explicit calc() size since an <iframe> is a replaced element (width:auto → 300×150 intrinsic).
- teardown at the single setLens chokepoint (covers click / keyboard / postMessage), so only
one WebGL context is ever live; restores the panel + moves focus to the incoming dock button.
- origin-checked message listener receives the iframe's 1–4 / Escape bridge.
Verified with Playwright: the Risk lens shows the full civic app (briefing + analyze 500 Bloor
→ Food 0.126 LOW / Activity 0.381 MED + 5 click-to-verify); homelink suppressed; dock/topbar
clickable above the iframe; 1 (in-iframe) and Escape both switch lens + tear down the iframe;
panel restored on exit; 0 console errors.1 parent 7a7ab5a commit 559f911
2 files changed
Lines changed: 66 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
76 | 87 | | |
77 | 88 | | |
78 | 89 | | |
| |||
848 | 859 | | |
849 | 860 | | |
850 | 861 | | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | | - | |
856 | | - | |
| 862 | + | |
857 | 863 | | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
858 | 876 | | |
859 | 877 | | |
860 | 878 | | |
| |||
974 | 992 | | |
975 | 993 | | |
976 | 994 | | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
977 | 1007 | | |
978 | 1008 | | |
979 | 1009 | | |
| |||
1207 | 1237 | | |
1208 | 1238 | | |
1209 | 1239 | | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
1210 | 1248 | | |
1211 | 1249 | | |
1212 | 1250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
243 | 263 | | |
244 | 264 | | |
245 | 265 | | |
| |||
511 | 531 | | |
512 | 532 | | |
513 | 533 | | |
514 | | - | |
| 534 | + | |
515 | 535 | | |
516 | 536 | | |
517 | 537 | | |
| |||
562 | 582 | | |
563 | 583 | | |
564 | 584 | | |
565 | | - | |
| 585 | + | |
566 | 586 | | |
567 | 587 | | |
568 | 588 | | |
| |||
0 commit comments