Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/vscode-extension/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

#### Fixed

- **Panels in the XR scene no longer show the content behind them.** Opening an element's info card in front of a virtual screen or the guide mixed the text of both: the card skipped the depth test, and the scene draws see-through surfaces in page order rather than by distance, so screens farther away were painted over it. Info cards, the dependency-graph path chip, virtual screens, the guide, the controller panel, the "Virtual screens" list, the comparison card and the evolution overlay now have opaque, depth-tested backings. Clicking an info card no longer passes through it to whatever is behind (it could start a screen share), and a virtual screen's idle message now wraps inside the screen instead of spilling past its edges.
- **Historical comparison and project evolution no longer refuse a folder opened through a link.** When the analyzed folder was reached through a symbolic link, a junction, or a shortened Windows path (`C:\Users\JOHNDO~1\...`), Code-XR compared it with the repository path Git reports and wrongly concluded the folder was outside the repository, so the Git-based analyses were unavailable. Both paths are now resolved to their real location before they are compared.
- **The installed extension only ever runs the Python analysis scripts it ships with.** If its bundled copy of an analysis script was missing (a damaged or partially deleted install), Code-XR fell back to a developer location two folders above the extension, which in an installed copy is your home folder, and could have run a file found there. That fallback is now limited to development builds; an installed extension reports the missing script instead.
- **The analysis backend loads again on Python 3.8 and 3.9.** One type annotation in the line-metrics module used syntax that only exists from Python 3.10, so on 3.8 or 3.9 every analysis failed as soon as the backend loaded, although the extension asks only for Python 3.7 or newer. The annotation now uses the older spelling; results on newer Python versions are unchanged.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@
position: SCOPE_LABEL_HOME,
class: 'codexr-scope-breadcrumb'
});
// Dark contrast chip behind the breadcrumb so the path stays legible
// over the graph and the white table; depthTest:false keeps it from
// being occluded by nodes/edges at either the home or docked position.
// Dark, opaque contrast chip behind the breadcrumb so the path stays
// legible over the graph and the white table. It is depth-tested like
// every panel: depthTest:false let farther surfaces paint over it.
this.scopeLabelChip = entity('a-plane', {
position: '0 0 -0.01',
width: 3, height: 0.34,
material: 'color: #0b1220; opacity: 0.82; shader: flat; side: double; transparent: true; depthTest: false'
material: 'color: #0b1220; shader: flat; side: double'
});
this.scopeLabel = text('', '0 0 0.02', 5.4, '#67e8f9');
this.scopeLabel.setAttribute('side', 'double');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
function buildGuideContent(slotRoot) {
slotRoot.appendChild(guideEntity('a-plane', {
width: SCREEN.width, height: SCREEN.height,
material: 'color: #0b1220; opacity: .97; shader: flat; side: double'
material: 'color: #0b1220; shader: flat; side: double'
}));
slotRoot.appendChild(guideEntity('a-plane', {
position: '0 ' + (SCREEN.height / 2 - 0.24) + ' 0.01', width: SCREEN.width, height: 0.44,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
});
refs.companionCard = createEntity('a-plane', {
position: '0 0 -0.03', width: COMPANION_CARD_W, height: 1,
material: 'color: #0e1526; opacity: 0.66; shader: flat'
material: 'color: #0e1526; shader: flat'
});
refs.companionRoot.appendChild(refs.companionCardBorder);
refs.companionRoot.appendChild(refs.companionCard);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
overlay.appendChild(entity('a-plane', {
width: 6.2,
height: 0.72,
material: 'color: #111827; opacity: 0.78; transparent: true; shader: flat'
material: 'color: #111827; shader: flat'
}));
refs.overlayTitle = text('', '0 0.17 0.02', 5.8, '#fde68a');
refs.overlayDetail = smallText('', '-2.7 -0.15 0.02', 5.4, '#e0f2fe', 'left', 52);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
this.panelPlane.setAttribute('height', '2');
this.panelPlane.setAttribute('color', '#0f172a');
this.panelPlane.setAttribute('position', '0 -1 -0.01');
this.panelPlane.setAttribute('material', 'opacity: 0.9; transparent: true; shader: flat;');
this.panelPlane.setAttribute('material', 'shader: flat;');

const title = document.createElement('a-text');
title.setAttribute('value', 'Virtual screens');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
refs.frame = createEntity('a-plane', {
id: getScopedId('codexrVirtualScreenFrame'),
color: '#0F172A',
material: 'color: #0F172A; opacity: 0.86; transparent: true; shader: flat;',
material: 'color: #0F172A; shader: flat;',
position: '0 0 -0.01',
});

Expand Down Expand Up @@ -316,7 +316,9 @@
refs.headerStrip.setAttribute('height', minimized ? '0.20' : '0.16');
refs.headerStrip.setAttribute('position', minimized ? '0 0 0.03' : `0 ${headerY} 0.03`);

refs.status.setAttribute('width', String(Math.max(6, width + 1.4)));
// The status line wraps inside the frame: it used to be 1.4 m wider than
// the screen, so the idle message spilled over whatever stood beside it.
refs.status.setAttribute('width', String(Math.max(1, width - 0.3)));
// Fixed-content screens keep transient hints (move/resize/lock) above the
// screen so they never cover the content; broadcast screens keep the
// classic centered placement over the empty idle surface.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@

refs.panelBackground = createEntity('a-plane', {
color: '#0A1628',
opacity: 0.94,
width: 6.2,
height: 2.2,
position: '0 0 0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,26 +98,33 @@
position: '0 0 -0.012',
width: width + .06,
height: height + .06,
material: 'color: ' + accentColor + '; opacity: .5; shader: flat; side: double; transparent: true; depthTest: false'
material: 'color: ' + accentColor + '; opacity: .5; shader: flat; side: double; transparent: true'
});
// The backing is opaque and depth-tested, and it absorbs the pointer ray.
// depthTest:false here once let every screen behind the card paint over it
// (A-Frame 1.7.1 draws transparent objects in DOM order, not by distance),
// and a card without the raycaster class let clicks fall through to
// whatever was behind it.
const background = createEntity('a-plane', {
width: width,
height: height,
material: 'color: #0e1626; opacity: .97; shader: flat; side: double; transparent: true; depthTest: false'
class: opts.raycastClass === undefined ? 'babiaxraycasterclass' : opts.raycastClass,
'data-codexr-role': 'tooltip background',
material: 'color: #0e1626; shader: flat; side: double'
});
// Left vertical accent bar carries the selected element's type colour.
const accent = createEntity('a-plane', {
position: (-(width / 2) + .035) + ' 0 .008',
width: .07,
height: height,
material: 'color: ' + accentColor + '; shader: flat; depthTest: false'
material: 'color: ' + accentColor + '; shader: flat'
});
// Thin accent divider under the header.
const divider = createEntity('a-plane', {
position: '0 0 .01',
width: width - .3,
height: .006,
material: 'color: ' + accentColor + '; opacity: .4; shader: flat; depthTest: false'
material: 'color: ' + accentColor + '; opacity: .4; shader: flat'
});
const textX = -(width / 2) + .2;
const title = tooltipText('', (textX + .02) + ' .26 .018', width - .4, '#f8fafc', 'left');
Expand Down Expand Up @@ -183,7 +190,7 @@
segmentsHeight: 6,
class: 'codexr-tooltip-connector-marker codexr-tooltip-auxiliary',
'data-codexr-role': 'tooltip connector marker',
material: 'color: #f59e0b; shader: flat; opacity: .92; transparent: true; depthTest: false'
material: 'color: #f59e0b; shader: flat; opacity: .92; transparent: true'
});
connectorRoot.appendChild(tooltip.connectorMarker);
}
Expand Down Expand Up @@ -226,7 +233,7 @@
opacity: Number(opts.opacity) || .88
});
tooltip.connectorMarker.setAttribute('position', formatPosition(end));
tooltip.connectorMarker.setAttribute('material', 'color: ' + color + '; shader: flat; opacity: .92; transparent: true; depthTest: false');
tooltip.connectorMarker.setAttribute('material', 'color: ' + color + '; shader: flat; opacity: .92; transparent: true');
connectorRoot.setAttribute('visible', true);
return true;
}
Expand Down
22 changes: 22 additions & 0 deletions apps/vscode-extension/test/analysis/codexrCommonRuntime.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,25 @@ test('manual XR mode harness loads common runtime before component runtimes that
assert.ok(harness.indexOf('templates/components/common/codexrCommonRuntime.js') < harness.indexOf('historicalComparisonRuntime.js'));
assert.ok(harness.indexOf('templates/components/common/codexrCommonRuntime.js') < harness.indexOf('dependencyGraphRuntime.js'));
});

// XR epic, story S1 (audit PANELS-1 and PANELS-4). A-Frame 1.7.1 draws
// transparent objects in DOM order, not by distance, so a card whose surfaces
// skip the depth test is painted over by every screen behind it; and a card
// the pointer ray cannot hit lets clicks fall through to the screen behind it.
test('tooltip cards are depth-tested, opaque and absorb the pointer ray', () => {
const runtime = loadRuntime().CodeXRCommonRuntime;
const host = createElement('a-entity');
const tooltip = runtime.createTooltip({ accentColor: '#22d3ee', width: 3.6 });
host.appendChild(tooltip.root);
runtime.updateTooltip(tooltip, { title: 'dependentium', rows: [{ label: 'Fan-in', value: '46' }] },
{ x: 0, y: 0, z: 0 }, { connectorTarget: { x: 0, y: -1, z: 0 } });

for (const name of ['border', 'background', 'accent', 'divider', 'connectorMarker']) {
assert.doesNotMatch(String(tooltip[name].getAttribute('material')), /depthTest\s*:\s*false/, name);
}
const background = String(tooltip.background.getAttribute('material'));
assert.doesNotMatch(background, /opacity/);
assert.doesNotMatch(background, /transparent\s*:\s*true/);
assert.equal(tooltip.background.getAttribute('class'), 'babiaxraycasterclass');
assert.equal(runtime.createTooltip({ raycastClass: '' }).background.getAttribute('class'), '');
});
Original file line number Diff line number Diff line change
Expand Up @@ -896,9 +896,12 @@ const foreignBroadcast = {
};

// [transcript lines, sha256 of the transcript] per screen kind.
// Re-recorded for the XR epic's panel fix: the only differences from the
// previous recording are the opaque frame material and the status line width
// (frame width - 0.3 instead of frame width + 1.4).
const SCREEN_CHROME_CHARACTERIZATION = {
broadcast: [2454, '07402aa5766f39fb0e88a8b0f72d609153e3635634345ac3c6754ebdfa02d20b'],
fixed: [972, 'f0765c01e853932d327596bc75ac6377dc78082ad1d75d09183cbc08655e699b'],
broadcast: [2454, '4af95d19788758a83c0ea0967a81f3b5dff008cece0723815cfe47c902790761'],
fixed: [972, '27f4b8e685155cb6f82dc7fd8cf097a3b9262be1db35f2230ab75690e3af4194'],
};

test('the screen chrome renders identically through every state (characterization)', () => {
Expand Down
60 changes: 60 additions & 0 deletions apps/vscode-extension/test/analysis/xrPanelLayering.test.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
const test = require('node:test');
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');

// XR epic, story S1 (audit PANELS-1, PANELS-2): panels must be readable
// wherever they stand. A-Frame 1.7.1 keeps `sortTransparentObjects: false`, so
// transparent surfaces are drawn in DOM order, not by distance. Two rules
// follow, checked here over every runtime that ships in a generated scene:
// 1. no material skips the depth test (a surface that does is painted over
// by anything drawn after it, however far away);
// 2. the backing of every panel is opaque (a translucent backing lets the
// panels behind it read through).

const componentsRoot = path.resolve(__dirname, '..', '..', 'templates', 'components');

function listRuntimeFiles(dir) {
return fs.readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
const full = path.join(dir, entry.name);
if (entry.isDirectory()) {
return listRuntimeFiles(full);
}
return entry.name.endsWith('.js') ? [full] : [];
});
}

test('no scene runtime disables the depth test on a material', () => {
const offenders = listRuntimeFiles(componentsRoot).flatMap((file) => fs.readFileSync(file, 'utf8')
.split('\n')
.map((line, index) => ({ line, index }))
.filter(({ line }) => /depthTest\s*:\s*false/.test(line) && !/^\s*\/\//.test(line))
.map(({ index }) => `${path.relative(componentsRoot, file)}:${index + 1}`));
assert.deepEqual(offenders, []);
});

const PANEL_BACKINGS = [
// [file, a unique snippet that identifies the backing's declaration]
['common/codexrCommonRuntime.js', "material: 'color: #0e1626; shader: flat; side: double'"],
['codexr/virtual-screen/virtualScreenRuntime/visibilityAndLayout.js', "material: 'color: #0F172A; shader: flat;',\n position: '0 0 -0.01',"],
['codexr/virtual-screen/codexrMultiScreenManagerRuntime.js', "this.panelPlane.setAttribute('material', 'shader: flat;');"],
['codexr/guide-screen/guideScreenRuntime/guideScreen.js', "material: 'color: #0b1220; shader: flat; side: double'"],
['codexr/xr-chart-mapping-ui/xrChartMappingUiRuntime/panelUi.js', "refs.panelBackground = createEntity('a-plane', {\n color: '#0A1628',\n width: 6.2,"],
['codexr/historical-comparison/historicalComparisonRuntime/selectionPanel.js', "material: 'color: #0e1526; shader: flat'"],
['codexr/project-evolution/projectEvolutionRuntime/overlayAndPanel.js', "material: 'color: #111827; shader: flat'"],
['codexr/dependency-graph/dependencyGraphRuntime/componentCore.js', "material: 'color: #0b1220; shader: flat; side: double'"],
];

test('every panel backing is opaque', () => {
for (const [file, snippet] of PANEL_BACKINGS) {
// Windows checkouts use CRLF; the multi-line snippets are written with LF.
const source = fs.readFileSync(path.join(componentsRoot, file), 'utf8').replace(/\r\n/g, '\n');
assert.ok(source.includes(snippet), `${file}: opaque backing not found`);
}
});

test('the virtual-screen status line wraps inside the frame', () => {
const source = fs.readFileSync(path.join(componentsRoot,
'codexr/virtual-screen/virtualScreenRuntime/visibilityAndLayout.js'), 'utf8');
assert.match(source, /refs\.status\.setAttribute\('width', String\(Math\.max\(1, width - 0\.3\)\)\)/);
});
Loading