Files
famapp/src/modules/_core/manifest.tsx
T
ginnoirandClaude Opus 4.7 9612a54e52
Release / build-and-push (push) Has been cancelled
Apply paper-and-ink design system across all surfaces
Replaces the generic shadcn/ui gray theme + horizontal top-bar shell with
the paper-and-ink language from the Claude Design handoff bundle: warm
off-white paper, near-black ink, Source Serif 4 + Inter, hairline borders,
muted ink accents (clay/indigo/sage/plum/ochre) used functionally for
calendars and share scopes.

Theme switcher expanded from 2 dimensions (theme × mode) to 7: palette ×
mode × fontPair × density × dashLayout × calView × navStyle. All exposed
in Settings → Appearance and persisted on the users row. Pre-paint script
applies all four data-* attributes from localStorage so reload doesn't
flash.

App shell restructured to a CSS-grid driven by data-nav on <html>: sidebar
on desktop, bottom-nav + FAB under 760px. Four desktop nav modes wired
(sidebar/rail/top/fab-only). Topbar gets a search-→-CommandPalette button,
notification bell, "+ New" quick-add, avatar.

Dashboard, calendar, lists, notes, settings, login, public share viewer,
and quick-add sheet all reskinned. Dashboard editor gains a Preset menu
(classic/split/glance) that fills the layout from the registered widgets.
FullCalendar wrapped in .fc-skin and inherits all paper-and-ink tokens via
CSS variable overrides. Public share viewer (/s/<token>) rebuilt around
ShareFrame: expiration banner, brand strip, eyebrow chip, 38px serif
title, mini-day + mini-map cards, share-rows.

Schema: drops users.theme; adds theme_palette, theme_font_pair,
theme_density, theme_dash_layout, theme_cal_view, theme_nav_style with
defaults that match the design (clay / serif-sans / regular / classic /
month / rail-desktop). Migration 0014_paper_ink_theme.

Middleware sets x-pathname so the AppShell server component can render
bare for /s/* and /login without a route-group refactor.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 01:03:21 -05:00

71 lines
2.1 KiB
TypeScript

import { desc, eq } from "drizzle-orm";
import { z } from "zod";
import { db } from "@/lib/db";
import { getCurrentSession } from "@/lib/session";
import type { ActivityLogEntry, ModuleManifest } from "./module";
import { getEntityType } from "./registry";
import { activityLog } from "./schema";
const activityConfigSchema = z.object({
limit: z.number().int().min(1).max(50).optional(),
});
async function ActivityWidget({ config }: { config: unknown }) {
const parsed = activityConfigSchema.parse(config);
const { household } = await getCurrentSession();
const entries = await db
.select()
.from(activityLog)
.where(eq(activityLog.householdId, household.id))
.orderBy(desc(activityLog.createdAt))
.limit(parsed.limit ?? 20);
if (entries.length === 0) {
return <p className="text-sm text-[var(--ink-mute)]">No recent activity</p>;
}
return (
<div className="flex flex-col">
{entries.map((entry) => {
const reg = getEntityType(entry.entityType);
const description =
reg?.renderActivity?.(entry as ActivityLogEntry) ?? `${entry.action} ${entry.entityType}`;
return (
<div key={entry.id} className="activity-row">
<div className="flex-1 leading-[1.4]">
<span className="obj">{description}</span>
</div>
<time>
{entry.createdAt.toLocaleDateString(undefined, { month: "short", day: "numeric" })}
</time>
</div>
);
})}
</div>
);
}
const coreManifest: ModuleManifest = {
id: "_core",
name: "Core",
entities: [],
dashboardWidgets: [
{
id: "core.activity",
title: "Recent activity",
description: "Latest changes across your household.",
category: "Core",
defaultSize: { w: 4, h: 3 },
minSize: { w: 3, h: 2 },
defaultPriority: 50,
configSchema: activityConfigSchema,
defaultConfig: { limit: 20 },
resolveConfigOptions: async () => undefined,
render: (props) => <ActivityWidget {...props} />,
},
],
};
export default coreManifest;