Compare commits

...
Author SHA1 Message Date
iris
717177dbad docs(dashboard): document per-chip question counts in filter row 2026-06-05 13:46:38 +02:00
iris
9ab08cef5b feat(dashboard): show per-chip question counts in filter row
Previously only the 'all' chip showed a count (all · N). The operator
had to click each chip to see how many questions were in each category.

Now every chip shows its own count:
  all · 5   @operator · 2   @peer · 3   @agentname · 1

This lets the operator see the distribution at a glance and navigate
directly to whichever category has pending items without guessing.
2026-06-05 13:46:38 +02:00
2 changed files with 17 additions and 8 deletions

View file

@ -77,10 +77,12 @@ the history row shape).
**M1ND H4S QU3STI0NS** — pending `ask` calls waiting on the
operator, with amber pulsing border. Anatomy of each card:
- **Filter chips**`all · N`, `@operator`, `@peer`, plus one
chip per participant name (`@asker` / `@target`). Clicking a
chip narrows the visible list; selection persists in
localStorage so a tab switch doesn't lose the filter.
- **Filter chips**`all · N`, `@operator · N`, `@peer · N`,
plus one chip per participant name (`@asker · N` / `@target · N`).
Every chip shows its own count so the operator can see the
distribution at a glance. Clicking a chip narrows the visible
list; selection persists in localStorage so a tab switch doesn't
lose the filter.
- **Question card** — timestamp · asker → target · body text
(with file-path links). Operator-targeted questions (`target =
null`) show `▸ ANSW3R`; peer-targeted questions (`target =

View file

@ -1863,13 +1863,20 @@ window.marked = marked;
b.addEventListener('click', () => setQuestionsFilter(value));
return b;
};
// Count pending questions per filter value so each chip shows its
// own hit count — the operator can see "operator · 2 / peer · 3"
// at a glance without clicking through each tab.
const operatorCount = allPending.filter((q) => !q.target).length;
const peerCount = allPending.filter((q) => !!q.target).length;
const agentCount = (name) => allPending.filter(
(q) => q.asker === name || q.target === name).length;
filterRow.append(
mkChip('all', `all · ${allPending.length}`),
mkChip('operator', '@operator'),
mkChip('peer', '@peer'),
mkChip('all', `all · ${allPending.length}`),
mkChip('operator', `@operator · ${operatorCount}`),
mkChip('peer', `@peer · ${peerCount}`),
);
for (const name of Array.from(participants).sort()) {
filterRow.append(mkChip('agent:' + name, '@' + name));
filterRow.append(mkChip('agent:' + name, `@${name} · ${agentCount(name)}`));
}
// Evict resolved/cancelled questions from the row cache.