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-705]): drop unused startMs from density slots

[._.]/ Adam Eivy3f20c2b702cd
diff --git a/client/src/utils/cityTimeline.js b/client/src/utils/cityTimeline.js
index 1964ce5ee1..9aee3afa5a 100644
--- a/client/src/utils/cityTimeline.js
+++ b/client/src/utils/cityTimeline.js
@@ -33,16 +33,11 @@ const eventTime = (log) => {
* @param {number} opts.now - reference "now" epoch ms (injectable for tests)
* @param {number} [opts.windowMs] - how far back the bar spans (default 10m)
* @param {number} [opts.bins] - number of bars (default 24)
- * @returns {Array<{count:number, level:string|null, startMs:number}>}
+ * @returns {Array<{count:number, level:string|null}>}
*/
export function computeActivityDensity(logs, { now, windowMs = 10 * 60 * 1000, bins = 24 } = {}) {
const slotMs = windowMs / bins;
- const slots = Array.from({ length: bins }, (_, i) => ({
- count: 0,
- level: null,
- // ms-ago at the START (older edge) of this bin; bin 0 is the oldest.
- startMs: windowMs - i * slotMs,
- }));
+ const slots = Array.from({ length: bins }, () => ({ count: 0, level: null }));
const severityRank = { error: 3, warn: 2, success: 1, info: 0, debug: 0 };
diff --git a/client/src/utils/cityTimeline.test.js b/client/src/utils/cityTimeline.test.js
index c7d3d637a7..7709f38e32 100644
--- a/client/src/utils/cityTimeline.test.js
+++ b/client/src/utils/cityTimeline.test.js
@@ -7,11 +7,9 @@ const minsAgo = (m) => NOW - m * 60 * 1000;
const secsAgo = (s) => NOW - s * 1000;
describe('computeActivityDensity', () => {
- it('returns one slot per bin, oldest first', () => {
+ it('returns one empty slot per bin', () => {
const slots = computeActivityDensity([], { now: NOW, bins: 24 });
expect(slots).toHaveLength(24);
- // bin 0 is the oldest edge of the window
- expect(slots[0].startMs).toBeGreaterThan(slots[23].startMs);
expect(slots.every(s => s.count === 0 && s.level === null)).toBe(true);
});