Skip to content

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

refactor([issue-875]): fold Hall of Achievements district into shared grid helper

[._.]/ Adam Eivy497f8def503f
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index c0954af57a..73372eb6e0 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -1,3 +1,3 @@
## Changed
-- **[issue-875] CyberCity district layout internals consolidated** — the city's districts now share one set of layout primitives for grid placement, category tallies, and log-scaled building heights, so the downtown, warehouse, sprint, memory, and task-queue districts no longer each carry their own copy of that math. No visible change to the city.
+- **[issue-875] CyberCity district layout internals consolidated** — the city's districts now share one set of layout primitives for grid placement, category tallies, and log-scaled building heights, so each district no longer carries its own copy of that math. No visible change to the city.
diff --git a/client/src/utils/cityArtifacts.js b/client/src/utils/cityArtifacts.js
index 99ffdcf06d..e9e7e3f4b6 100644
--- a/client/src/utils/cityArtifacts.js
+++ b/client/src/utils/cityArtifacts.js
@@ -8,6 +8,7 @@
// unit-testable (mirrors cityGoalMonuments.js / cityProductivity.js).
import { levelFromXP } from './characterXp';
+import { gridIndexToPosition } from './cityDistrictLayout';
// Hall of Achievements — a clear cluster in the +X / -Z quadrant, between the task-queue
// (x≈+34, z≈-10), health tower (x≈+48, z≈+28), goal-monument row (z≈-40) and voice marker
@@ -123,18 +124,17 @@ export function earnedArtifacts({ character, goals, productivityData } = {}) {
// Place a descriptor into the cluster grid. `index` is the 0-based slot; the grid fills left→
// right across ARTIFACTS.columns, then wraps to the next row toward -Z. Centered on base.x.
export function placeArtifact(descriptor, index) {
- const col = index % ARTIFACTS.columns;
- const row = Math.floor(index / ARTIFACTS.columns);
- const xOffset = (col - (ARTIFACTS.columns - 1) / 2) * ARTIFACTS.spacing;
- const x = ARTIFACTS.base[0] + xOffset;
- const z = ARTIFACTS.base[2] - row * ARTIFACTS.spacing;
const tier = TIERS[descriptor.tier] || TIERS.bronze;
-
return {
...descriptor,
color: tier.color,
intensity: tier.intensity,
- position: [x, 0, z],
+ position: gridIndexToPosition(index, {
+ base: ARTIFACTS.base,
+ columns: ARTIFACTS.columns,
+ spacing: ARTIFACTS.spacing,
+ rowDir: -1, // rows wrap toward -Z
+ }),
};
}