= {
@@ -81,6 +83,9 @@ function Row({ row, now }: { row: DeskRow; now: number }) {
{raisedAge(row.raisedAt, now) && (
{raisedAge(row.raisedAt, now)}
)}
+
+ {`${plural(row.deciderCount, 'decider')} · ${plural(row.answererCount, 'answerer')}`}
+
{row.context}
{row.options.map((o) => (
diff --git a/src/app/features/desk/buildDesk.ts b/src/app/features/desk/buildDesk.ts
index 4d65a437..0b18794c 100644
--- a/src/app/features/desk/buildDesk.ts
+++ b/src/app/features/desk/buildDesk.ts
@@ -30,6 +30,9 @@ export type DeskRow =
depends: string[];
/** When the question was first admitted, as served; absent when the card carries none. */
raisedAt?: string;
+ /** Counts as served: the same in the decider and the withheld view, so they show either way. */
+ deciderCount: number;
+ answererCount: number;
/** In admission order, as served. */
answers: AnswerRow[];
};
@@ -86,6 +89,8 @@ export const buildDesk = (
recommended: card.options.find((o) => o.id === card.recommendation)?.text,
depends: card.depends,
raisedAt: card.raised_at ?? undefined,
+ deciderCount: card.decider_count,
+ answererCount: record.answerer_count,
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 d9b055ca..8f999f43 100644
--- a/src/app/features/desk/fixtures.ts
+++ b/src/app/features/desk/fixtures.ts
@@ -18,6 +18,7 @@ export const card = (label: string, over: Partial = {}): ForkCard => (
raised_in: null,
raised_at: null,
deciders: ['d1'],
+ decider_count: 1,
status: 'open',
ruling: null,
ruled_from: [],
@@ -61,6 +62,7 @@ export const entry = (
fork_id: c.fork_id,
options_hash: c.options_hash,
counted_answer_id: counted,
+ answerer_count: new Set(answers.map((a) => a.answerer)).size,
answers,
},
};
diff --git a/src/app/features/desk/forkContract.ts b/src/app/features/desk/forkContract.ts
index 91b3653f..5bf10080 100644
--- a/src/app/features/desk/forkContract.ts
+++ b/src/app/features/desk/forkContract.ts
@@ -30,7 +30,13 @@ export type ForkCard = {
* the client's: now minus `raised_at`.
*/
raised_at: string | null;
+ /**
+ * Who may answer. Empty when this reader is not a decider (the ids are withheld); otherwise it holds exactly
+ * `decider_count` ids.
+ */
deciders: string[];
+ /** How many deciders there are, 1..64: the same number in both reader views. */
+ decider_count: number;
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. */
ruling: string | null;
@@ -64,7 +70,8 @@ export type DeskAnswer = {
answered_at: string;
received_at: string;
claim_in_future: boolean;
- answerer: string;
+ /** Who answered; nil when this reader is not a decider (withheld). */
+ answerer: string | null;
authority: string;
request_id: string;
};
@@ -75,6 +82,8 @@ export type ForkRecord = {
options_hash: string;
/** Derived by the receiver; the page renders it and never recomputes it. */
counted_answer_id: string | null;
+ /** Distinct answerers over every stored answer, refusals included, at least 0: the same number in both views. */
+ answerer_count: number;
/** In admission order. */
answers: DeskAnswer[];
};
diff --git a/src/preview-demo/deskForks.test.ts b/src/preview-demo/deskForks.test.ts
index 56fd2573..001342f5 100644
--- a/src/preview-demo/deskForks.test.ts
+++ b/src/preview-demo/deskForks.test.ts
@@ -20,13 +20,21 @@ const KEYS = {
'raised_in',
'raised_at',
'deciders',
+ 'decider_count',
'status',
'ruling',
'ruled_from',
'order',
'options_hash',
],
- record: ['schemaVersion', 'fork_id', 'options_hash', 'counted_answer_id', 'answers'],
+ record: [
+ 'schemaVersion',
+ 'fork_id',
+ 'options_hash',
+ 'counted_answer_id',
+ 'answerer_count',
+ 'answers',
+ ],
answer: [
'schemaVersion',
'answer_id',
diff --git a/src/preview-demo/deskForks.ts b/src/preview-demo/deskForks.ts
index fe1bbfcb..91543cab 100644
--- a/src/preview-demo/deskForks.ts
+++ b/src/preview-demo/deskForks.ts
@@ -27,6 +27,7 @@ const card = (label: string, order: number, over: Partial): ForkCard =
raised_in: null,
raised_at: null,
deciders: ['demo-decider'],
+ decider_count: 1,
status: 'open',
ruling: null,
ruled_from: [],
@@ -75,6 +76,7 @@ const entry = (
fork_id: c.fork_id,
options_hash: c.options_hash,
counted_answer_id: counted,
+ answerer_count: new Set(answers.map((a) => a.answerer)).size,
answers,
},
});