Skip to content

Commit 184f982

Browse files
feat(platform-web): full-width console lists/overviews + consistent New version buttons (#35)
- Widen console list/overview pages to full width (agreements, services, reports/submissions/team ListPage, doc-types, console + admin overview) - Service detail: move version-creation button right of the version picker (ungrouped) and rename to New version - Match New version button styling across service-detail, agreement-detail and admin document-type detail
1 parent 59fc3b8 commit 184f982

9 files changed

Lines changed: 22 additions & 27 deletions

File tree

apps/platform-web/src/components/admin/document-types/admin-document-type-detail.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export function AdminDocumentTypeDetail() {
7373
</div>
7474
<Button size="sm" type="button" disabled={add.isPending} onClick={() => add.mutate()}>
7575
<Plus className="size-4" aria-hidden />
76-
Add version
76+
New version
7777
</Button>
7878
</div>
7979

apps/platform-web/src/components/admin/document-types/admin-document-types-list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function AdminDocumentTypesList() {
2323
const { data: items = [] } = useQuery(adminDocumentTypesQueryOptions());
2424

2525
return (
26-
<div className="mx-auto flex max-w-[1320px] flex-col gap-4">
26+
<div className="flex flex-col gap-4">
2727
<span className="text-sm text-muted-foreground">
2828
The document type catalog. Open a type to manage its versions.
2929
</span>

apps/platform-web/src/components/admin/pages/admin-overview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Info } from 'lucide-react';
33
/** Admin overview — placeholder until the dashboard is defined. */
44
export function AdminOverview() {
55
return (
6-
<div className="mx-auto flex max-w-[1320px] flex-col gap-4">
6+
<div className="flex flex-col gap-4">
77
<div className="flex items-center gap-2.5 rounded-xl border border-dashed border-border bg-card px-3.5 py-2.5 text-sm text-muted-foreground">
88
<Info className="size-4 shrink-0" aria-hidden />
99
Platform administration — the admin overview is being set up.

apps/platform-web/src/components/console/list-page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function ListPage({
3636
children,
3737
}: ListPageProps) {
3838
return (
39-
<div className="mx-auto flex max-w-[1320px] flex-col gap-4">
39+
<div className="flex flex-col gap-4">
4040
{toolbar || actions ? (
4141
<div className="flex items-center justify-between gap-3">
4242
<div className="flex items-center gap-2">{toolbar}</div>

apps/platform-web/src/components/console/pages/overview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Info } from 'lucide-react';
88
*/
99
export function OverviewPage() {
1010
return (
11-
<div className="mx-auto flex max-w-[1320px] flex-col gap-4">
11+
<div className="flex flex-col gap-4">
1212
<div className="flex items-center gap-2.5 rounded-xl border border-dashed border-border bg-card px-3.5 py-2.5 text-sm text-muted-foreground">
1313
<Info className="size-4 shrink-0" aria-hidden />
1414
Overview is being set up — placeholder layout shown until you choose what to track.

apps/platform-web/src/components/console/service-agreements/agreement-detail.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
import { Spinner } from '@repo/ui/spinner';
1010
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
1111
import { Link } from '@tanstack/react-router';
12-
import { ChevronDown } from 'lucide-react';
12+
import { ChevronDown, Pencil } from 'lucide-react';
1313
import { useEffect, useState } from 'react';
1414
import { UnsavedChangesGuard } from '@/components/console/unsaved-changes-guard';
1515
import { useAuth } from '@/lib/auth';
@@ -134,13 +134,8 @@ function AgreementBody({
134134
{isGlobal ? <Badge color="grey">Global</Badge> : null}
135135
<VersionPicker versions={versions} selectedId={selectedId} onSelect={setSelectedId} />
136136
{latestPublished && editableContext(isGlobal, isAdmin) ? (
137-
<Button
138-
size="sm"
139-
variant="outline"
140-
type="button"
141-
disabled={busy}
142-
onClick={() => newVersion.mutate()}
143-
>
137+
<Button size="sm" type="button" disabled={busy} onClick={() => newVersion.mutate()}>
138+
<Pencil className="size-4" aria-hidden />
144139
New version
145140
</Button>
146141
) : null}

apps/platform-web/src/components/console/service-agreements/agreements-list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function AgreementsList({ scope }: { scope: AgreementScope }) {
3131
};
3232

3333
return (
34-
<div className="mx-auto flex max-w-[1320px] flex-col gap-4">
34+
<div className="flex flex-col gap-4">
3535
<div className="flex items-center justify-between gap-3">
3636
<span className="text-sm text-muted-foreground">
3737
{scope.kind === 'admin'

apps/platform-web/src/components/console/services/service-detail.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -250,25 +250,25 @@ export function ServiceDetail({
250250
</>
251251
)}
252252
<ButtonGroup>
253-
{/* Current + published → start a new draft to edit; mutually exclusive with Go to current. */}
254-
{isLatest && latest?.status === 'published' ? (
255-
<Button
256-
size="sm"
257-
type="button"
258-
disabled={addVersion.isPending}
259-
onClick={() => addVersion.mutate()}
260-
>
261-
<Pencil className="size-4" aria-hidden />
262-
Edit service details
263-
</Button>
264-
) : null}
265253
{!isLatest && latest ? (
266254
<Button size="sm" variant="outline" type="button" onClick={goToCurrent}>
267255
Go to current
268256
</Button>
269257
) : null}
270258
<VersionPicker versions={versions} selectedId={selected.id} onSelect={goToVersion} />
271259
</ButtonGroup>
260+
{/* Current + published → start a new draft version; sits to the right of the version picker. */}
261+
{isLatest && latest?.status === 'published' ? (
262+
<Button
263+
size="sm"
264+
type="button"
265+
disabled={addVersion.isPending}
266+
onClick={() => addVersion.mutate()}
267+
>
268+
<Pencil className="size-4" aria-hidden />
269+
New version
270+
</Button>
271+
) : null}
272272
<ServiceMenu
273273
serviceId={id}
274274
versionId={selected.id}

apps/platform-web/src/components/console/services/services-list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function ServicesList() {
2727
});
2828

2929
return (
30-
<div className="mx-auto flex max-w-[1320px] flex-col gap-4">
30+
<div className="flex flex-col gap-4">
3131
<div className="flex items-center justify-between gap-3">
3232
<span className="text-sm text-muted-foreground">Service documents in this workspace.</span>
3333
<Button

0 commit comments

Comments
 (0)