diff --git a/src/app/features/desk/DeskView.test.tsx b/src/app/features/desk/DeskView.test.tsx
index ca10ea66..19be8aff 100644
--- a/src/app/features/desk/DeskView.test.tsx
+++ b/src/app/features/desk/DeskView.test.tsx
@@ -5,6 +5,7 @@ import { afterEach, describe, expect, it } from 'vitest';
import { ScreenSize, ScreenSizeProvider } from '../../hooks/useScreenSize';
import { DeskEntry } from './DeskEntry';
import { DeskView, SIGN_IN_NOTE } from './DeskView';
+import { ForkList } from './forkContract';
import { STATES } from './fixtures';
import { setDeskSource } from './source';
@@ -121,6 +122,35 @@ describe('DeskView', () => {
});
});
+describe("a question's age", () => {
+ const NOW = Date.parse('2026-11-11T12:00:00Z');
+ const listRaised = (raisedAt: string | null): ForkList => {
+ const entry = STATES.noAnswers.forks[0];
+ return {
+ ...STATES.noAnswers,
+ forks: [{ ...entry, card: { ...entry.card, raised_at: raisedAt } }],
+ };
+ };
+ const html = (raisedAt: string | null) =>
+ renderToStaticMarkup(
+
+
+
+ );
+ it('reads days since the card was first admitted', () => {
+ expect(html('2026-11-06T12:00:00Z')).toContain('raised 5d ago');
+ });
+ it('reads hours inside a day, and just now inside an hour', () => {
+ expect(html('2026-11-11T07:30:00Z')).toContain('raised 4h ago');
+ expect(html('2026-11-11T11:40:00Z')).toContain('raised just now');
+ });
+ it('shows no age when the card carries none, or an instant that does not parse or is ahead of the clock', () => {
+ ['null', 'yesterday', '2027-01-01T00:00:00Z'].forEach((v) => {
+ expect(html(v === 'null' ? null : v)).not.toContain('raised ');
+ });
+ });
+});
+
describe('DeskEntry', () => {
afterEach(() => setDeskSource(() => undefined));
const entry = (mind: string) =>
diff --git a/src/app/features/desk/DeskView.tsx b/src/app/features/desk/DeskView.tsx
index e57bfa70..ceb42fd9 100644
--- a/src/app/features/desk/DeskView.tsx
+++ b/src/app/features/desk/DeskView.tsx
@@ -6,6 +6,7 @@ import { ScreenSize, useScreenSizeContext } from '../../hooks/useScreenSize';
import { AnswerRow, Desk, buildDesk, DeskRow } from './buildDesk';
import { ForkList } from './forkContract';
import { deskMood } from './deskMood';
+import { raisedAge } from './age';
import * as css from './DeskView.css';
/** Slice 1 has no session: every viewer is signed out, and the note says why it cannot be used. */
@@ -45,7 +46,7 @@ function Answers({ answers }: { answers: AnswerRow[] }) {
);
}
-function Row({ row }: { row: DeskRow }) {
+function Row({ row, now }: { row: DeskRow; now: number }) {
const phone = useScreenSizeContext() === ScreenSize.Mobile;
// Phones list titles; a tap opens one. Wide screens show every row open.
const [open, setOpen] = useState(!phone);
@@ -77,6 +78,9 @@ function Row({ row }: { row: DeskRow }) {
{open && (
<>
+ {raisedAge(row.raisedAt, now) && (
+
{raisedAge(row.raisedAt, now)}
+ )}
{row.context}
{row.options.map((o) => (
@@ -126,10 +130,12 @@ type DeskViewProps = {
list?: ForkList;
/** Fork ids whose options_hash failed the recompute (optionsHash.ts). */
unverified?: ReadonlySet;
+ /** The clock the ages are read against; the page's own, a test's fixed one. */
+ now?: number;
};
/** One Mind's desk, read-only: a stream of rows, the recorded rulings, and the booth Persona. */
-export function DeskView({ mind, label, list, unverified }: DeskViewProps) {
+export function DeskView({ mind, label, list, unverified, now = Date.now() }: DeskViewProps) {
const desk = buildDesk(list, unverified);
// Slice 1 has no session, so nothing on the desk is the viewer's answer yet.
const mood = deskMood(desk.counts.open, 0);
@@ -139,7 +145,7 @@ export function DeskView({ mind, label, list, unverified }: DeskViewProps) {
{desk.open.map((row) => (
-
+
))}
{/* Only Minds with art in the catalogue get a booth; none gets another Mind's face. */}
diff --git a/src/app/features/desk/age.ts b/src/app/features/desk/age.ts
new file mode 100644
index 00000000..a8473f01
--- /dev/null
+++ b/src/app/features/desk/age.ts
@@ -0,0 +1,17 @@
+const MINUTE = 60 * 1000;
+const HOUR = 60 * MINUTE;
+const DAY = 24 * HOUR;
+
+/**
+ * How long ago a question was raised, from the card's `raised_at` (an RFC3339 instant) and the clock the caller
+ * holds. Nothing when there is no instant, it does not parse, or it is ahead of the clock: the desk shows no age
+ * rather than a wrong one.
+ */
+export const raisedAge = (raisedAt: string | undefined, now: number): string | undefined => {
+ const then = raisedAt === undefined ? NaN : Date.parse(raisedAt);
+ const ms = now - then;
+ if (Number.isNaN(ms) || ms < 0) return undefined;
+ if (ms < HOUR) return 'raised just now';
+ if (ms < DAY) return `raised ${Math.floor(ms / HOUR)}h ago`;
+ return `raised ${Math.floor(ms / DAY)}d ago`;
+};
diff --git a/src/app/features/desk/buildDesk.ts b/src/app/features/desk/buildDesk.ts
index e09dec1f..4d65a437 100644
--- a/src/app/features/desk/buildDesk.ts
+++ b/src/app/features/desk/buildDesk.ts
@@ -28,6 +28,8 @@ export type DeskRow =
/** The recommendation resolved to its option's text; absent if it names no option. */
recommended?: string;
depends: string[];
+ /** When the question was first admitted, as served; absent when the card carries none. */
+ raisedAt?: string;
/** In admission order, as served. */
answers: AnswerRow[];
};
@@ -83,6 +85,7 @@ export const buildDesk = (
options: card.options.map((o) => ({ ...o, recommended: o.id === card.recommendation })),
recommended: card.options.find((o) => o.id === card.recommendation)?.text,
depends: card.depends,
+ raisedAt: card.raised_at ?? undefined,
answers: record.answers.map((a) => answerRow(a, entry)),
});
});
diff --git a/src/app/features/desk/fixtures.ts b/src/app/features/desk/fixtures.ts
index e74c37ba..d9b055ca 100644
--- a/src/app/features/desk/fixtures.ts
+++ b/src/app/features/desk/fixtures.ts
@@ -16,6 +16,7 @@ export const card = (label: string, over: Partial
= {}): ForkCard => (
leans: null,
flag: null,
raised_in: null,
+ raised_at: null,
deciders: ['d1'],
status: 'open',
ruling: null,
diff --git a/src/app/features/desk/forkContract.ts b/src/app/features/desk/forkContract.ts
index ce196116..91b3653f 100644
--- a/src/app/features/desk/forkContract.ts
+++ b/src/app/features/desk/forkContract.ts
@@ -24,6 +24,12 @@ export type ForkCard = {
/** Not shown by the desk. */
flag: string | null;
raised_in: { kind: string; id: string } | null;
+ /**
+ * When the question was first admitted (an RFC3339 instant, as `answered_at`), or nil when the mind holds no
+ * admission time. Always written; outside `options_hash`; it never moves when the question is edited. Age is
+ * the client's: now minus `raised_at`.
+ */
+ raised_at: string | null;
deciders: string[];
status: 'open' | 'closed';
/** The ruling id when a ruling closed the fork; nil when open, and nil on a closed card withdrawn with no ruling. */
diff --git a/src/preview-demo/deskForks.test.ts b/src/preview-demo/deskForks.test.ts
index 035dd2d8..56fd2573 100644
--- a/src/preview-demo/deskForks.test.ts
+++ b/src/preview-demo/deskForks.test.ts
@@ -18,6 +18,7 @@ const KEYS = {
'leans',
'flag',
'raised_in',
+ 'raised_at',
'deciders',
'status',
'ruling',
diff --git a/src/preview-demo/deskForks.ts b/src/preview-demo/deskForks.ts
index a0ca67bf..fe1bbfcb 100644
--- a/src/preview-demo/deskForks.ts
+++ b/src/preview-demo/deskForks.ts
@@ -25,6 +25,7 @@ const card = (label: string, order: number, over: Partial): ForkCard =
leans: null,
flag: null,
raised_in: null,
+ raised_at: null,
deciders: ['demo-decider'],
status: 'open',
ruling: null,
@@ -90,6 +91,7 @@ const list = (mind: string, forks: ForkEntry[], stamp: string): ForkList => ({
const nibu = (): ForkList => {
const sky = card('sky-label', 4, {
+ raised_at: new Date(Date.now() - 5 * DAY).toISOString().replace(/\.\d+Z$/, 'Z'),
title: 'Where should the sky label sit on a phone?',
context:
'The label can ride the horizon or sit in the header. The horizon is prettier; the header never moves.',