mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 02:14:01 +00:00
fix(street-level): reconnect the panel once the data manager attaches, so a switch-on opens it
The panel connected before the shell had its data manager, so it never heard switch-on requests and a user switch-on left it collapsed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
09e2fd96a4
commit
36b675b928
3 files changed
+15
-1
No files matched your search
@@ -264,6 +264,7 @@ export class StyleManager extends ShellFacade {
|
||||
_contextControls: this._contextControls,
|
||||
_cctvControls: this._cctvControls,
|
||||
_radioControls: this._radioControls,
|
||||
_streetLevelControls: this._streetLevelControls,
|
||||
}),
|
||||
operations: {
|
||||
_updateTrafficSyncChip: (...args) =>
|
||||
|
||||
@@ -55,6 +55,9 @@ export class LayerBindings {
|
||||
get _radioControls() {
|
||||
return this.readControls()._radioControls;
|
||||
}
|
||||
get _streetLevelControls() {
|
||||
return this.readControls()._streetLevelControls;
|
||||
}
|
||||
observeCamera() {
|
||||
this._cctvRequestFocusHandler = (event) =>
|
||||
routeCctvFocusRequest(
|
||||
@@ -234,6 +237,8 @@ export class LayerBindings {
|
||||
this._syncContextModeButtons();
|
||||
this._cctvControls.connect();
|
||||
this._radioControls.connect();
|
||||
// Its switch-on requests come from the manager, which arrives after it.
|
||||
this._streetLevelControls?.connect();
|
||||
this._connectDirectionsCamera();
|
||||
this._connectWeatherCamera();
|
||||
if (!this._awarenessSelectedHandler) {
|
||||
|
||||
@@ -80,6 +80,7 @@ function bindings(t) {
|
||||
hud: { attachDataManager() {} },
|
||||
_contextControls: { connect() {} },
|
||||
_cctvControls: { connect() {} }, _radioControls: { connect() {} },
|
||||
_streetLevelControls: { connects: 0, connect() { this.connects += 1; } },
|
||||
};
|
||||
const owner = new LayerBindings({
|
||||
viewer: {}, services: {}, readControls: () => controls,
|
||||
@@ -97,7 +98,7 @@ function bindings(t) {
|
||||
subscribe() { events.push([id, 'subscribe']); return () => events.push([id, 'unsubscribe']); },
|
||||
};
|
||||
}
|
||||
return { owner, manager, events };
|
||||
return { owner, manager, events, controls };
|
||||
}
|
||||
|
||||
test('manager replacement releases Directions even when the new manager has no route layer', (t) => {
|
||||
@@ -116,6 +117,13 @@ test('manager replacement releases Directions even when the new manager has no r
|
||||
assert.equal(events.length, count);
|
||||
});
|
||||
|
||||
test('attaching the manager reconnects Street Level, so its switch-on requests reach the panel', (t) => {
|
||||
const { owner, manager, controls } = bindings(t);
|
||||
owner.attachDataManager(manager('first'));
|
||||
assert.equal(controls._streetLevelControls.connects, 1);
|
||||
owner.stop(); owner.disconnect();
|
||||
});
|
||||
|
||||
test('camera-entry listeners are removed before any asynchronous layer cleanup', (t) => {
|
||||
const { owner } = bindings(t);
|
||||
let changes = 0;
|
||||
|
||||
Reference in new issue
Block a user