Skip to content

Commit e4b76dd

Browse files
committed
style: align the activity feed to the Figma frame
Measured against frame 4979-39243. - Text style updates. - Adds a `text-xxs` theme token (10px/16) for the step below Tailwind's built-in scale, matching Figma's own `text-xxs`. - Wraps the feed in the single bordered panel the design shows, with a divider under the tab row, replacing the loose filters + ringed list. - Drops the count from "All activity" and lets the remaining counts inherit their label colour rather than rendering muted. - TabsTrigger has no display utility, so the `gap-*` between label and count was inert; set inline-flex here. Signed-off-by: Anna Effort <anna.effort@ibm.com>
1 parent 74a676f commit e4b76dd

5 files changed

Lines changed: 27 additions & 16 deletions

File tree

src/components/dashboard/ActivityFilters.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,13 @@ export function ActivityFilters({
4747
<Tabs value={filter} onValueChange={(value) => onFilterChange(value as ActivityFilter)}>
4848
<TabsList>
4949
{ACTIVITY_FILTERS.map((id) => (
50-
<TabsTrigger key={id} value={id} className="gap-1.5">
50+
<TabsTrigger
51+
key={id}
52+
value={id}
53+
className="inline-flex items-center gap-1.5 text-xs font-medium"
54+
>
5155
{intl.formatMessage({ id: FILTER_LABEL[id] })}
52-
<span className="text-xs text-muted-foreground">{counts[id]}</span>
56+
{id !== "all" && <span>{counts[id]}</span>}
5357
</TabsTrigger>
5458
))}
5559
</TabsList>

src/components/dashboard/ActivityRow.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ export function ActivityRow({ item }: { item: ActivityItem }) {
2828
<Icon className={cn("mt-0.5 size-4 shrink-0", className)} aria-hidden />
2929
<span className="sr-only">{intl.formatMessage({ id: labelId })}</span>
3030
<div className="min-w-0 flex-1">
31-
<p className="text-sm font-medium text-foreground">{item.title}</p>
32-
<p className="text-sm text-muted-foreground">{item.description}</p>
31+
<p className="text-xs text-foreground">{item.title}</p>
32+
<p className="text-xxs font-medium text-muted-foreground">{item.description}</p>
3333
</div>
3434
{relative && (
3535
<time
3636
dateTime={item.timestamp}
3737
title={item.timestamp}
38-
className="shrink-0 pt-0.5 text-xs text-muted-foreground"
38+
className="shrink-0 text-xxs font-medium text-muted-foreground"
3939
>
4040
{relative}
4141
</time>

src/components/dashboard/ActivityView.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ describe("ActivityView", () => {
106106
feed(ITEMS);
107107
renderWithProviders(<ActivityView />);
108108

109-
expect(within(screen.getByRole("tab", { name: /All activity/ })).getByText("5")).toBeVisible();
109+
expect(screen.getByRole("tab", { name: "All activity" })).toBeInTheDocument();
110110
expect(within(screen.getByRole("tab", { name: /Errors/ })).getByText("2")).toBeVisible();
111111
expect(within(screen.getByRole("tab", { name: /Warnings/ })).getByText("1")).toBeVisible();
112112
expect(screen.queryByRole("tab", { name: /Info/ })).not.toBeInTheDocument();

src/components/dashboard/ActivityView.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,23 @@ export function ActivityView() {
8383
}
8484

8585
return (
86-
<div className="flex flex-col gap-4">
87-
<ActivityFilters
88-
filter={filter}
89-
onFilterChange={setFilter}
90-
counts={counts}
91-
search={search}
92-
onSearchChange={setSearch}
93-
/>
86+
<div className="rounded-lg border border-border bg-card">
87+
<div className="px-4 py-3">
88+
<ActivityFilters
89+
filter={filter}
90+
onFilterChange={setFilter}
91+
counts={counts}
92+
search={search}
93+
onSearchChange={setSearch}
94+
/>
95+
</div>
9496
{visible.length === 0 ? (
95-
<EmptyStatePlaceholder messageId="dashboard.home.activity.noMatches" />
97+
<div className="border-t border-border px-4 py-8 text-sm text-muted-foreground">
98+
{intl.formatMessage({ id: "dashboard.home.activity.noMatches" })}
99+
</div>
96100
) : (
97101
<ul
98-
className="divide-y divide-border rounded-lg ring-1 ring-foreground/10"
102+
className="divide-y divide-border border-t border-border"
99103
aria-label={intl.formatMessage({ id: "dashboard.home.card.activity" })}
100104
>
101105
{visible.map((item) => (

src/index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050
--radius-lg: var(--radius);
5151
--font-heading: var(--font-sans);
5252
--font-sans: "Inter Variable", sans-serif;
53+
/* Figma's `text-xxs` step, below Tailwind's built-in scale. */
54+
--text-xxs: 10px;
55+
--text-xxs--line-height: 16px;
5356
--color-chart-5: var(--chart-5);
5457
--color-chart-4: var(--chart-4);
5558
--color-chart-3: var(--chart-3);

0 commit comments

Comments
 (0)