From 8be52a3647799b48f4964edb5bfc558efcb24487 Mon Sep 17 00:00:00 2001 From: Grok Bot Date: Thu, 26 Nov 2026 09:10:37 +0000 Subject: [PATCH] Add board page, layout and styles --- app/globals.css | 19 ++++++++++++++ app/layout.tsx | 12 +++++++++ app/page.tsx | 69 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 app/globals.css create mode 100644 app/layout.tsx create mode 100644 app/page.tsx diff --git a/app/globals.css b/app/globals.css new file mode 100644 index 0000000..b75a258 --- /dev/null +++ b/app/globals.css @@ -0,0 +1,19 @@ +:root { font-family: system-ui, sans-serif; color: #1c2430; background: #f4f6f9; } +body { margin: 0; } +main { max-width: 1000px; margin: 2rem auto; padding: 0 1rem; } +header { display: flex; justify-content: space-between; align-items: center; } +.pill { font-size: .8rem; padding: .2rem .6rem; border-radius: 999px; background: #ddd; } +.pill.up { background: #c8f0d0; } .pill.down { background: #f6c7c7; } +.add { display: flex; gap: .5rem; margin: 1rem 0; } +.add input { flex: 1; padding: .5rem; border: 1px solid #ccd; border-radius: 6px; font: inherit; } +button { padding: .4rem .8rem; border: 0; border-radius: 6px; background: #2d6cdf; color: #fff; cursor: pointer; font: inherit; } +button.secondary { background: #8a94a6; font-size: .75rem; padding: .25rem .5rem; } +button.danger { background: #c0392b; font-size: .75rem; padding: .25rem .5rem; } +.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; } +section { background: #e9edf3; border-radius: 8px; padding: .75rem; min-height: 8rem; } +section h2 { font-size: 1rem; margin: 0 0 .5rem; } .count { color: #667; font-weight: 400; } +article { background: #fff; border-radius: 6px; padding: .6rem; margin-bottom: .5rem; box-shadow: 0 1px 2px #0001; display: flex; flex-direction: column; gap: .25rem; } +article small { color: #667; } .actions { display: flex; gap: .25rem; flex-wrap: wrap; } +.error { color: #c0392b; } +footer { margin-top: 2rem; font-size: .75rem; color: #778; text-align: center; word-break: break-all; } +@media (max-width: 700px) { .board { grid-template-columns: 1fr; } } diff --git a/app/layout.tsx b/app/layout.tsx new file mode 100644 index 0000000..5ff9a26 --- /dev/null +++ b/app/layout.tsx @@ -0,0 +1,12 @@ +import type { ReactNode } from 'react'; +import './globals.css'; + +export const metadata = { title: 'Taskboard', description: 'Next.js + PostgreSQL task board' }; + +export default function RootLayout({ children }: { children: ReactNode }) { + return ( + + {children} + + ); +} diff --git a/app/page.tsx b/app/page.tsx new file mode 100644 index 0000000..84d5320 --- /dev/null +++ b/app/page.tsx @@ -0,0 +1,69 @@ +import { addTask, removeTask, setStatus } from './actions'; +import { dbHealth } from '@/lib/db'; +import { buildInfo } from '@/lib/build-info'; +import { listTasks, STATUSES, type Status } from '@/lib/tasks'; + +// Always render per request: the board is live data, and the footer shows the running build. +export const dynamic = 'force-dynamic'; + +const TITLES: Record = { todo: 'To do', doing: 'In progress', done: 'Done' }; +const bootedAt = new Date().toISOString(); + +export default async function Home() { + const [tasks, health] = await Promise.all([listTasks().catch(() => null), dbHealth()]); + + return ( +
+
+

Taskboard

+ DB {health.status} +
+ +
+ + + +
+ + {tasks === null ? ( +

Could not load tasks. Check the database connection.

+ ) : ( +
+ {STATUSES.map((s) => ( +
+

+ {TITLES[s]} {tasks.filter((t) => t.status === s).length} +

+ {tasks + .filter((t) => t.status === s) + .map((t) => ( +
+ {t.title} + {t.assignee && @{t.assignee}} +
+ {STATUSES.filter((x) => x !== s).map((x) => ( +
+ + + +
+ ))} +
+ + +
+
+
+ ))} +
+ ))} +
+ )} + + +
+ ); +}