mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 10:12:18 +00:00
Vue kit: the small surfaces' buttons and glyphs are kit controls
Every hand-written <button> in the locale picker, phone tab bar, globe actions (Clear, Share, Reset) and compass, imagery divider handle, scene sharing dialog, layer group index, title logo, Exit clean view, the HUD's cockpit entry, News card face, rail card header, layer row toggle, credits line's Data attribution and the camera calibration chips is a ghost UiButton keeping its id, classes, data-*, aria-* and listeners. Their Material Symbols spans (tab icons, globe actions, compass needle, cockpit entry, celestial ring sun and moon) are UiIcons with :size="null". The Omnibar guide's extra rings, one per further target of a step, are now drawn by OmnibarGuide.vue from view.subRings instead of being built in script; startGuide() still reads them from the rendered tree and sets their boxes each frame. A UiButton's slot renders inside the button, so under an owner that patches synchronously (News cards, rail cards, the credits line, the Omnibar guide's Skip, Offer and Next) a change the button's attributes do not carry would land a tick late. Those slots are given under a named condition that is always true (v-if="redrawWithView"), which Vue redraws with the view. src/ui/kit/smallSurfacesControls.test.mjs pins it; docs/VUE-MIGRATION.md describes the surface and the conditional slot. Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
1 parent
e705fdea82
commit
40cbe52782
26 files changed
+383
-131
No files matched your search
+10
-6
@@ -472,6 +472,9 @@ export function startGuide(steps, { title = '' } = {}) {
|
||||
nextLabel: t('Next'),
|
||||
nextHidden: false,
|
||||
nextQuiet: false,
|
||||
// The extra rings for a step's further targets, after the callout; the
|
||||
// count only grows, and rings a step does not use are faded out.
|
||||
subRings: 0,
|
||||
// Announces each step once; the dialog itself is not a live region, so
|
||||
// its buttons and progress are not read out on every change.
|
||||
status: '',
|
||||
@@ -511,7 +514,9 @@ export function startGuide(steps, { title = '' } = {}) {
|
||||
const root = paint().component.subTree.children[0].el;
|
||||
const ring = root.querySelector(':scope > .gev-guide-ring');
|
||||
const callout = root.querySelector(':scope > .gev-guide-callout');
|
||||
const subRings = [];
|
||||
// The extra rings, read again from the rendered tree whenever more are
|
||||
// drawn.
|
||||
let subRings = [];
|
||||
|
||||
const live = steps.filter(Boolean);
|
||||
let index = -1;
|
||||
@@ -657,11 +662,10 @@ export function startGuide(steps, { title = '' } = {}) {
|
||||
width: `${main.width + pad * 2}px`,
|
||||
height: `${main.height + pad * 2}px`,
|
||||
});
|
||||
while (subRings.length < rest.length) {
|
||||
const sub = doc.createElement('div');
|
||||
sub.className = 'gev-guide-ring gev-guide-ring--sub';
|
||||
root.append(sub);
|
||||
subRings.push(sub);
|
||||
if (subRings.length < rest.length) {
|
||||
view.subRings = rest.length;
|
||||
paint();
|
||||
subRings = [...root.querySelectorAll(':scope > .gev-guide-ring--sub')];
|
||||
}
|
||||
subRings.forEach((sub, i) => {
|
||||
const box = rest[i];
|
||||
|
||||
Reference in new issue
Block a user