Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix([issue-934]): floor warehouse district offset to clear the AI Core plaza
Adam Eivyced14c1f8261
diff --git a/client/src/components/city/cityLayout.js b/client/src/components/city/cityLayout.jsindex 473bc7bf21..a6dab2e70a 100644--- a/client/src/components/city/cityLayout.js+++ b/client/src/components/city/cityLayout.js@@ -80,11 +80,18 @@ export const computeCityLayout = (apps) => {});// Warehouse district (archived apps): X-centered grid offset along +Z from downtown.- // Placement is unchanged by the plaza clearance (downtown-only); see PLAN.md for the- // separate all-archived warehouse-near-core follow-up.+ // The +Z offset follows downtown's depth, but is floored so the near row (and the+ // ARCHIVE DISTRICT label two units in front of it) always clears the central AI Core+ // plaza. Without the floor, few-/no-active-app installs collapse the warehouse onto+ // the core (all-archived → warehouseZ 4, label at z=2, on top of the monument). The+ // floor is a no-op for normal installs: any layout with 3+ active apps already has+ // activeRows ≥ 2, so warehouseZ is already ≥ CORE_CLEARANCE_RADIUS + gap.if (archived.length > 0) {const archiveCols = autoColumns(archived.length);- const warehouseZ = activeRows * spacing / 2 + DISTRICT_PARAMS.gap;+ const warehouseZ = Math.max(+ activeRows * spacing / 2 + DISTRICT_PARAMS.gap,+ CORE_CLEARANCE_RADIUS + DISTRICT_PARAMS.gap,+ );archived.forEach((app, i) => {const [x, , z] = gridIndexToPosition(i, {diff --git a/client/src/components/city/cityLayout.test.js b/client/src/components/city/cityLayout.test.jsindex 02d811fda8..6365790f65 100644--- a/client/src/components/city/cityLayout.test.js+++ b/client/src/components/city/cityLayout.test.js@@ -31,17 +31,40 @@ describe('computeCityLayout', () => {expect(typeof pos.get('solo').height).toBe('number');});- it('offsets archived apps into a warehouse grid along +Z (plaza clearance is downtown-only)', () => {+ it('offsets archived apps into a warehouse grid clear of the core plaza on sparse installs', () => {const pos = computeCityLayout([online('a'),{ id: 'x', overallStatus: 'online', archived: true },{ id: 'y', overallStatus: 'online', archived: true },]);- // 1 active → activeRows 1 → warehouseZ = 1*12/2 + 4 = 10; 2 archived → 2 cols, X offset 6.- // The active app clears to the plaza front edge; warehouse positions are untouched.+ // 1 active → raw warehouseZ = 1*12/2 + 4 = 10, which sits inside the 12-unit core+ // plaza — so the floor lifts it to CORE_CLEARANCE_RADIUS + gap = 16. 2 archived → 2+ // cols, X offset 6. The active app clears to the plaza front edge.expect(pos.get('a')).toMatchObject({ x: 0, z: -12, district: 'downtown' });- expect(pos.get('x')).toMatchObject({ x: -6, z: 10, district: 'warehouse' });- expect(pos.get('y')).toMatchObject({ x: 6, z: 10, district: 'warehouse' });+ expect(pos.get('x')).toMatchObject({ x: -6, z: 16, district: 'warehouse' });+ expect(pos.get('y')).toMatchObject({ x: 6, z: 16, district: 'warehouse' });+ });++ it('keeps the warehouse off the core on an all-archived install (no active apps)', () => {+ const pos = computeCityLayout([+ { id: 'x', overallStatus: 'online', archived: true },+ { id: 'y', overallStatus: 'online', archived: true },+ ]);+ // No active apps → raw warehouseZ = 0*12/2 + 4 = 4, which would drop the near row+ // (and the ARCHIVE DISTRICT label at z-2) on top of the AI Core. The floor lifts the+ // near row to 16 so the label lands at z=14, clear of the 12-unit core plaza.+ expect(pos.get('x')).toMatchObject({ x: -6, z: 16, district: 'warehouse' });+ expect(pos.get('y')).toMatchObject({ x: 6, z: 16, district: 'warehouse' });+ });++ it('leaves the warehouse offset untouched for normal installs (3+ active apps)', () => {+ const pos = computeCityLayout([+ online('a'), online('b'), online('c'),+ { id: 'x', overallStatus: 'online', archived: true },+ ]);+ // 3 active → activeRows 2 → raw warehouseZ = 2*12/2 + 4 = 16, already at the floor,+ // so max(16, 16) is a no-op: established layouts for normal installs don't shift.+ expect(pos.get('x')).toMatchObject({ x: 0, z: 16, district: 'warehouse' });});it('never stacks two downtown buildings when clearing the core plaza', () => {