feat: restructure styles and components for improved design system
- Added typography and design system styles to globals.css. - Removed deprecated home.css and landing.css files. - Introduced DiscordSignInButton component for Discord authentication. - Created Card and CardGrid components for structured content display. - Implemented ContainerShowcase to demonstrate card usage and layout. - Added DesignSystemTabs for navigation between design system sections. - Established typography.css for consistent text styling across components. - Added tests for typography styles to ensure compliance with design standards.
This commit is contained in:
56
README.md
56
README.md
@@ -1,7 +1,7 @@
|
||||
# Minabot
|
||||
|
||||
Bun + Hono habit-tracking REST API with Drizzle ORM and local SQLite. The existing
|
||||
React Router client has a public landing page and a connected signed-in habit dashboard.
|
||||
React Router client currently contains only the design system, ready for a fresh page redesign.
|
||||
|
||||
See [the REST API reference](docs/API.md) for habits, task recurrence, dated progress,
|
||||
combined calendars, historical corrections, daily resets, and optional count carryover.
|
||||
@@ -13,12 +13,17 @@ bun dev
|
||||
|
||||
Open http://127.0.0.1:3000. Set `PORT` to use a different port.
|
||||
|
||||
- Client pages: `/`, `/about`, `/settings`.
|
||||
- Client page: `/design-system`. Root and all other client URLs redirect there.
|
||||
- Hono endpoint: `GET /api/health`.
|
||||
- Unknown API routes return JSON with a 404 status.
|
||||
|
||||
### Design system preview
|
||||
|
||||
The library uses seven tabs: Foundations, Components, Layout, Calendars, Playground,
|
||||
Editing, and References. Foundations is the default. Each tab has a URL hash;
|
||||
existing section links still work. Arrow keys, Home, and End navigate the tabs.
|
||||
Switching tabs preserves unsaved demo state; browser back/forward restores the section.
|
||||
|
||||
Open `/design-system#editing` for interactive habit settings, task recurrence,
|
||||
and dated progress corrections. Habit colors include Earth, Coast, Dusk, Forest,
|
||||
Citrus, Blossom, Jewel, and Slate palettes plus a native picker and hex input. Editors support save/cancel,
|
||||
@@ -30,39 +35,24 @@ clears the preview. Habit colors preview immediately across the editor and the
|
||||
daily/detail charts; Save keeps the color in the demo and Cancel restores it.
|
||||
Other settings and progress remain independent of the daily tracking playground.
|
||||
|
||||
Signed-out visitors at `/` see the landing page, with interactive habit calendars
|
||||
reused from the design system, a how-it-works introduction, and Discord sign-in.
|
||||
The demo is local, unsaved state and never writes to the habit API. Account loading
|
||||
and retryable errors are resolved before choosing the public or signed-in home.
|
||||
Signing out updates the shared account state and reveals the landing page immediately.
|
||||
Discord integration currently covers identity only, not bot commands or reminders.
|
||||
The previous Landing, Home, About, and Settings pages have been removed. The
|
||||
backend API, authentication infrastructure, database, and reusable components remain
|
||||
available for the redesigned pages. The design system does not load account data
|
||||
or call the API.
|
||||
|
||||
Signed-in users at `/` get a personalized home with their Discord avatar, tracking
|
||||
date/timezone, daily completion summary, manual/count/task check-ins, a remaining
|
||||
filter, and per-habit calendar history in the design system's two-column chart grid.
|
||||
Each habit has its own heading, schedule, color key, and compact calendar. Daily
|
||||
check-ins use compact rows with expandable tasks. New accounts get editable starter ideas and
|
||||
a create-habit dialog supporting all three methods, all schedule types, and the shared
|
||||
palette/custom color picker. The habit and its color are saved atomically. Progress
|
||||
is saved through the habit API; history uses server-provided progress colors and dated units,
|
||||
never the landing page's demo data. Visible dashboards refresh every minute and on
|
||||
returning to the tab. Loading, retry, expired-session, no-schedule, and all-complete
|
||||
states are handled separately. Each habit has Edit and Delete controls: edit its name,
|
||||
count target/unit, schedule, and color, or confirm removal from the dashboard using
|
||||
the existing archive API, which retains recorded history. Editing keeps the tracking
|
||||
method and existing tasks intact. Unscheduled dates use neutral dots; upcoming dates
|
||||
share the zero-progress fill while retaining their distinct inspection labels.
|
||||
Archive management, task-definition editing, historical corrections, and saved
|
||||
combined-chart management remain outside this home view.
|
||||
`styles/globals.css` is the only stylesheet
|
||||
entry point; component styles are in Tailwind's components layer so utilities can
|
||||
override them predictably. Tailwind Preflight remains omitted.
|
||||
|
||||
For isolated browser QA, run `bun scripts/dashboard-preview.ts` and open the printed
|
||||
preview login URL. It serves the real UI and API against an in-memory test database,
|
||||
uses a separate test cookie, and discards its data on exit.
|
||||
It is a local test harness, not a production sign-in flow.
|
||||
|
||||
Secondary pages retain a heading, native navigation buttons, and account controls. Tailwind utilities
|
||||
and shadcn configuration are available; Tailwind Preflight is omitted to preserve
|
||||
native browser styling.
|
||||
`styles/typography.css` defines reusable Tailwind classes: `type-display` (72/81),
|
||||
`type-section` (48/54), `type-title` (32/40), `type-lead` (20/30), `type-body`
|
||||
(16/24), `type-small` and `type-label` (14/21), and `type-control` (24/30, symbols).
|
||||
Values are font-size/line-height in pixels at the default 16px root, implemented
|
||||
in rem. At 640px and below, display steps to 48/54 and section to 36/45; body and
|
||||
supporting text never shrink. Use these classes directly or with `@apply`, not
|
||||
bespoke font sizes or viewport-based type. See `/design-system#foundations` for
|
||||
live specimens. Reuse `SectionHeading`, `Button`, `ButtonLink`, and the shared
|
||||
`DiscordSignInButton` for headings and calls to action.
|
||||
|
||||
```sh
|
||||
bun run typecheck
|
||||
|
||||
Reference in New Issue
Block a user