From a102b49e1dd21c8b41cb3be3074b64af2cec14be Mon Sep 17 00:00:00 2001 From: Marco Craveiro Date: Sat, 5 Dec 2026 02:58:20 +0000 Subject: [PATCH] [web] Expect the seventh screen in the shell, and format Co-Authored-By: Claude Code --- .../packages/pages/src/BlamesScreen.tsx | 104 +++++++++++++----- .../packages/pages/src/blames.test.tsx | 14 ++- .../compass.web/packages/pages/src/i18n/en.ts | 20 +++- .../compass.web/packages/pages/src/i18n/fr.ts | 30 +++-- .../compass.web/packages/pages/src/i18n/pt.ts | 26 ++++- .../packages/pages/src/screens.tsx | 10 +- .../packages/web/e2e/shell.spec.ts | 4 +- 7 files changed, 159 insertions(+), 49 deletions(-) diff --git a/projects/compass.web/packages/pages/src/BlamesScreen.tsx b/projects/compass.web/packages/pages/src/BlamesScreen.tsx index c232aa76..4108e342 100644 --- a/projects/compass.web/packages/pages/src/BlamesScreen.tsx +++ b/projects/compass.web/packages/pages/src/BlamesScreen.tsx @@ -57,7 +57,10 @@ function Tiles({ reports }: { readonly reports: readonly DocumentSummary[] }): R
{tiles.map((tile) => (
-
+
{tile.value}
{t(`blames.tiles.${tile.key}`)}
@@ -67,15 +70,25 @@ function Tiles({ reports }: { readonly reports: readonly DocumentSummary[] }): R ); } -function Bars({ entries }: { readonly entries: readonly (readonly [string, number])[] }): ReactNode { +function Bars({ + entries, +}: { + readonly entries: readonly (readonly [string, number])[]; +}): ReactNode { const top = Math.max(...entries.map(([, n]) => n), 1); return (
    {entries.map(([label, n]) => ( -
  • +
  • {label} - + {n}
  • @@ -98,7 +111,13 @@ export function BlamesScreen({ environment }: { readonly environment: string }): const wanted = params.get('view') ?? 'sprint'; const view: View = (VIEWS as readonly string[]).includes(wanted) ? (wanted as View) : 'sprint'; const reports = useQuery({ - queryKey: ['compass', inputs.httpBase, 'documents', environment, { type, state, limit: LIMIT }], + queryKey: [ + 'compass', + inputs.httpBase, + 'documents', + environment, + { type, state, limit: LIMIT }, + ], queryFn: ({ signal }) => client.documents( { @@ -117,7 +136,8 @@ export function BlamesScreen({ environment }: { readonly environment: string }): }); const all = reports.data?.documents ?? []; const open = all.filter((d) => !closed(d.state)); - const visible = state === 'all' ? all : state === 'addressed' ? all.filter((d) => closed(d.state)) : open; + const visible = + state === 'all' ? all : state === 'addressed' ? all.filter((d) => closed(d.state)) : open; const href = (next: { readonly state?: string; readonly view?: string }) => { const out = new URLSearchParams(); out.set('type', type); @@ -139,7 +159,9 @@ export function BlamesScreen({ environment }: { readonly environment: string }): list.push(d); sprints.set(d.sprint, list); } - const ordered = [...sprints.entries()].sort((a, b) => b[0].localeCompare(a[0], 'en', { numeric: true })); + const ordered = [...sprints.entries()].sort((a, b) => + b[0].localeCompare(a[0], 'en', { numeric: true }), + ); const owners = new Map(); for (const d of [...open].sort((a, b) => (ageOf(b) ?? 0) - (ageOf(a) ?? 0))) { const owner = d.owner === '' ? t('blames.noOwner') : d.owner; @@ -147,21 +169,28 @@ export function BlamesScreen({ environment }: { readonly environment: string }): list.push(d); owners.set(owner, list); } - const ownerLoad = [...all.reduce((m, d) => { - const key = d.owner === '' ? t('blames.noOwner') : d.owner; - m.set(key, (m.get(key) ?? 0) + 1); - return m; - }, new Map())].sort((a, b) => b[1] - a[1]); - const filed = [...all.reduce((m, d) => { - const day = d.created === '' ? '?' : d.created; - m.set(day, (m.get(day) ?? 0) + 1); - return m; - }, new Map())].sort((a, b) => a[0].localeCompare(b[0])); + const ownerLoad = [ + ...all.reduce((m, d) => { + const key = d.owner === '' ? t('blames.noOwner') : d.owner; + m.set(key, (m.get(key) ?? 0) + 1); + return m; + }, new Map()), + ].sort((a, b) => b[1] - a[1]); + const filed = [ + ...all.reduce((m, d) => { + const day = d.created === '' ? '?' : d.created; + m.set(day, (m.get(day) ?? 0) + 1); + return m; + }, new Map()), + ].sort((a, b) => a[0].localeCompare(b[0])); return (
    -