Skip to content

Commit 194cf89

Browse files
fix(graph): preserve orbit pause for full Galaxy scenes
1 parent 8d0bc2e commit 194cf89

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

engraphis/dashboard_assets/ledger.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
graphWorkspace: '',
1919
graphData: null,
2020
graphDataMode: 'overview',
21+
graphGalaxyQuality: false,
2122
graphDataPreset: 'galaxy',
2223
graphDataIncludeCode: false,
2324
graphDataShowUnlinked: false,
@@ -2338,7 +2339,8 @@
23382339
const freezeRow = byId('graph-freeze-row');
23392340
if (freezeRow) freezeRow.hidden = full;
23402341
const orbitPause = byId('graph-orbit-pause-row');
2341-
if (orbitPause) orbitPause.hidden = full;
2342+
const orbitCapable = full ? state.graphGalaxyQuality : graphIsGalaxy();
2343+
if (orbitPause) orbitPause.hidden = !orbitCapable;
23422344
const style = byId('graph-style').value;
23432345
const styleNotes = full ? GRAPH_LOD_STYLE_NOTES : GRAPH_STYLE_NOTES;
23442346
byId('graph-style-note').textContent = styleNotes[style] || styleNotes.classic;
@@ -2359,6 +2361,7 @@
23592361
function updateGraphGalaxyControls() {
23602362
const galaxy = graphIsGalaxy();
23612363
const full = state.graphMode === 'full';
2364+
const orbitCapable = full ? state.graphGalaxyQuality : galaxy;
23622365
const size = byId('graph-size');
23632366
if (galaxy && !full) {
23642367
if (['degree', 'betweenness'].includes(size.value)) size.dataset.legacyValue = size.value;
@@ -2405,7 +2408,7 @@
24052408
byId('graph-orbits-pause-detail').textContent = 'physics';
24062409
byId('graph-orbits-pause').setAttribute('aria-label', 'Pause orbital physics');
24072410
const orbitPauseRow = byId('graph-orbit-pause-row');
2408-
if (orbitPauseRow) orbitPauseRow.hidden = !(galaxy && !full);
2411+
if (orbitPauseRow) orbitPauseRow.hidden = !orbitCapable;
24092412
}
24102413

24112414
function setChoicePressed(selector, dataKey, selected) {
@@ -3535,6 +3538,7 @@
35353538
state.graphData = data;
35363539
state.graphWorkspace = targetWorkspace;
35373540
state.graphDataMode = targetMode;
3541+
state.graphGalaxyQuality = galaxyQuality;
35383542
state.graphDataPreset = byId('graph-preset').value;
35393543
state.graphDataIncludeCode = responseIncludeCode;
35403544
state.graphDataShowUnlinked = targetShowUnlinked;

tests/test_graph_every_asset.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,16 @@ def test_renderer_exposes_capacity_and_every_preset() -> None:
373373
assert "MAP_SCALE" in worker # the map-spread constant
374374

375375

376+
def test_ledger_keeps_orbit_pause_for_full_quality_galaxy_scenes() -> None:
377+
"""Full authored Galaxy scenes use the orbital engine and retain their pause control."""
378+
ledger = LEDGER.read_text(encoding="utf-8")
379+
assert "graphGalaxyQuality: false" in ledger
380+
assert "state.graphGalaxyQuality = galaxyQuality;" in ledger
381+
assert "const orbitCapable = full ? state.graphGalaxyQuality : graphIsGalaxy();" in ledger
382+
assert "const orbitCapable = full ? state.graphGalaxyQuality : galaxy;" in ledger
383+
assert "if (orbitPauseRow) orbitPauseRow.hidden = !orbitCapable;" in ledger
384+
385+
376386
def test_worker_untagged_nodes_share_one_district_not_n_singletons() -> None:
377387
"""Untagged graphs must not make centroid separation quadratic in node count."""
378388
script = (

0 commit comments

Comments
 (0)