Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
221 changes: 221 additions & 0 deletions apps/web/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -1552,3 +1552,224 @@ body:has(.bleed) .site-header__inner {
grid-column: auto;
}
}

/* โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ reports โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */
.week {
margin-bottom: 32px;
}

.week__grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
gap: 12px;
}

.week__card {
padding: 14px 16px;
border: 1px solid var(--line);
border-radius: var(--radius);
background: var(--surface);
display: flex;
flex-direction: column;
gap: 10px;
}

.week__head {
display: flex;
align-items: center;
gap: 10px;
font-size: 14px;
}

.week__stats {
display: grid;
grid-template-columns: repeat(5, minmax(0, 1fr));
gap: 4px;
margin: 0;
}

.week__stats dt {
font-size: 11px;
color: var(--muted);
}

.week__stats dd {
margin: 0;
font-weight: 600;
font-variant-numeric: tabular-nums;
font-size: 15px;
}

.week__stats .is-bad {
color: #dc2626;
}

.week__latest {
font-size: 13px;
color: var(--muted);
border-top: 1px solid var(--line);
padding-top: 8px;
}

.feed__head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
flex-wrap: wrap;
}

.segmented {
display: inline-flex;
border: 1px solid var(--line-strong);
border-radius: 8px;
padding: 2px;
background: var(--surface);
}

.segmented a {
padding: 4px 12px;
border-radius: 6px;
font-size: 13px;
text-decoration: none;
color: var(--muted);
}

.segmented a:hover {
color: var(--text);
}

.segmented a[aria-current="page"] {
background: var(--text);
color: var(--bg);
}

.feed__list {
display: flex;
flex-direction: column;
gap: 8px;
max-width: 1100px;
}

.report {
display: flex;
gap: 12px;
padding: 12px 14px;
border: 1px solid var(--line);
border-left-width: 3px;
border-radius: var(--radius);
background: var(--surface);
}

.report--division {
background: var(--bg);
border-style: solid;
}

.report--completed {
border-left-color: var(--working);
}

.report--changes_requested {
border-left-color: var(--human);
}

.report--blocked {
border-left-color: #dc2626;
}

.report__main {
min-width: 0;
flex: 1;
display: flex;
flex-direction: column;
gap: 4px;
}

.report__head {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 4px 10px;
font-size: 13px;
color: var(--muted);
}

.report__author strong {
color: var(--text);
}

.report__kind {
font-size: 11px;
font-weight: 600;
padding: 0 6px;
border: 1px solid var(--line-strong);
border-radius: 4px;
}

.report__head time {
margin-left: auto;
font-size: 12px;
}

.outcome {
font-size: 12px;
font-weight: 600;
}

.outcome--completed {
color: var(--working);
}

.outcome--changes_requested {
color: var(--human);
}

.outcome--blocked {
color: #dc2626;
}

.report__task {
font-size: 13px;
font-weight: 600;
text-decoration: none;
}

.report__task:hover {
text-decoration: underline;
}

.report__summary {
font-size: 14px;
}

.report__body summary {
cursor: pointer;
font-size: 12px;
color: var(--muted);
}

.report__body pre {
white-space: pre-wrap;
word-break: break-word;
font-family: var(--font);
font-size: 13px;
margin: 6px 0 0;
padding: 10px 12px;
border-radius: 6px;
background: var(--bg);
border: 1px solid var(--line);
}

.report__next {
font-size: 13px;
color: var(--muted);
}

.report__next strong {
color: var(--text);
}

.report-flow {
margin-bottom: 24px;
}
1 change: 1 addition & 0 deletions apps/web/app/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const LINKS = [
{ href: "/", label: "์กฐ์ง๋„" },
{ href: "/office", label: "์ž๋ฆฌ ๋ฐฐ์น˜๋„" },
{ href: "/tasks", label: "์ž‘์—…" },
{ href: "/reports", label: "๋ณด๊ณ " },
{ href: "/approvals", label: "์Šน์ธํ•จ" },
{ href: "/settings", label: "์„ค์ •" },
] as const;
Expand Down
107 changes: 107 additions & 0 deletions apps/web/app/reports/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import type { Metadata } from "next";
import { Avatar } from "@/components/avatar";
import { ReportCard } from "@/components/report-card";
import { getDivisionWeek, getOrg, getRecentReports, isPreview } from "@/lib/data";
import { formatUsd } from "@/lib/format";
import { PreviewBanner } from "../notice";

export const metadata: Metadata = { title: "๋ณด๊ณ " };
export const dynamic = "force-dynamic";

type Props = { searchParams: Promise<{ level?: string }> };

export default async function ReportsPage({ searchParams }: Props) {
const [org, week, reports, query] = await Promise.all([getOrg(), getDivisionWeek(), getRecentReports(), searchParams]);
const level = query.level === "division" || query.level === "team" ? query.level : "all";
const visible = level === "all" ? reports : reports.filter((report) => report.level === level);

return (
<div className="bleed">
<div className="page-head">
<div>
<h1>๋ณด๊ณ </h1>
<p className="muted">ํŒ€์€ ์„ธ์…˜์„ ๋งˆ์น  ๋•Œ๋งˆ๋‹ค ํŒ€์žฅ์ด ๋ณด๊ณ ํ•˜๊ณ , ๋‹จ๊ณ„๊ฐ€ ๋๋‚˜๋ฉด ๋ณธ๋ถ€์žฅ์ด ๋ณธ๋ถ€ ๋ณด๊ณ ์™€ ํ•จ๊ป˜ ๋‹ค์Œ ํŒ€์— ์ผ์„ ๋„˜๊น๋‹ˆ๋‹ค.</p>
</div>
</div>
{isPreview() && <PreviewBanner />}

<section aria-labelledby="week-title" className="week">
<h2 id="week-title" className="section-title">
๋ณธ๋ถ€๋ณ„ ์ตœ๊ทผ 7์ผ
</h2>
<ul className="week__grid">
{org.divisions.map((division) => {
const stats = week.get(division.id);
return (
<li key={division.id} className="week__card">
<header className="week__head">
<Avatar seed={`head-${division.id}`} gender={division.head.gender} name={division.head.name} divisionId={division.id} size={32} senior />
<div>
<strong>{division.name}</strong>
<span className="muted"> ยท {division.head.name} ๋ณธ๋ถ€์žฅ</span>
</div>
</header>
<dl className="week__stats">
<div>
<dt>์„ธ์…˜</dt>
<dd>{stats?.sessions ?? 0}</dd>
</div>
<div>
<dt>์™„๋ฃŒ</dt>
<dd>{stats?.completed ?? 0}</dd>
</div>
<div>
<dt>์ˆ˜์ • ์š”์ฒญ</dt>
<dd>{stats?.changesRequested ?? 0}</dd>
</div>
<div>
<dt>์ง„ํ–‰ ๋ถˆ๊ฐ€</dt>
<dd className={stats?.blocked ? "is-bad" : undefined}>{stats?.blocked ?? 0}</dd>
</div>
<div>
<dt>์‚ฌ์šฉ</dt>
<dd>{formatUsd(stats?.costCents ?? 0)}</dd>
</div>
</dl>
<p className="week__latest">{stats?.latest ? stats.latest.summary : "์ตœ๊ทผ ๋ณธ๋ถ€ ๋ณด๊ณ ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค"}</p>
</li>
);
})}
</ul>
</section>

<section aria-labelledby="feed-title" className="feed">
<div className="feed__head">
<h2 id="feed-title" className="section-title">
๋ณด๊ณ  ํ”ผ๋“œ
</h2>
<nav aria-label="๋ณด๊ณ  ์ข…๋ฅ˜" className="segmented">
<a href="/reports" aria-current={level === "all" ? "page" : undefined}>
์ „์ฒด
</a>
<a href="/reports?level=division" aria-current={level === "division" ? "page" : undefined}>
๋ณธ๋ถ€ ๋ณด๊ณ 
</a>
<a href="/reports?level=team" aria-current={level === "team" ? "page" : undefined}>
ํŒ€ ๋ณด๊ณ 
</a>
</nav>
</div>
{visible.length === 0 ? (
<div className="empty">
<p className="empty__title">์•„์ง ๋ณด๊ณ ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค</p>
<p className="muted">์ž‘์—…์ด ์ ‘์ˆ˜๋˜์–ด ํŒ€ ์„ธ์…˜์ด ๋๋‚˜๋ฉด ์ด๊ณณ์— ๋ณด๊ณ ๊ฐ€ ์Œ“์ž…๋‹ˆ๋‹ค.</p>
</div>
) : (
<ol className="feed__list">
{visible.map((report) => (
<li key={report.id}>
<ReportCard report={report} org={org} showTask />
</li>
))}
</ol>
)}
</section>
</div>
);
}
24 changes: 22 additions & 2 deletions apps/web/app/tasks/[taskId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import type { Metadata } from "next";
import Link from "next/link";
import { notFound } from "next/navigation";
import { STAGE_LABEL, STATUS_LABEL } from "@offai/core";
import { getOrg, getTask, type RunSummary } from "@/lib/data";
import { ReportCard } from "@/components/report-card";
import { getOrg, getTask, getTaskReports, type RunSummary } from "@/lib/data";
import { formatDate, formatUsd } from "@/lib/format";
import { approveDeploy, retryTask } from "../../actions";
import { Notice } from "../../notice";
Expand All @@ -22,7 +23,7 @@ const RUN_STATUS = { running: "์‹คํ–‰ ์ค‘", completed: "์™„๋ฃŒ", failed: "์‹คํŒจ

export default async function TaskPage({ params, searchParams }: Props) {
const [{ taskId }, query] = await Promise.all([params, searchParams]);
const [task, org] = await Promise.all([getTask(taskId), getOrg()]);
const [task, org, reports] = await Promise.all([getTask(taskId), getOrg(), getTaskReports(taskId)]);
if (!task) notFound();
const teamName = (id: string | null) => org.divisions.flatMap((division) => division.teams).find((team) => team.id === id)?.name ?? id ?? "-";
const github = `https://github.com/${task.repo}`;
Expand Down Expand Up @@ -90,6 +91,24 @@ export default async function TaskPage({ params, searchParams }: Props) {
)}

<div className="task-layout">
<div>
<section aria-labelledby="flow-title" className="report-flow">
<h2 id="flow-title" className="section-title">
๋ณด๊ณ  ํ๋ฆ„ {reports.length}
</h2>
{reports.length === 0 ? (
<p className="muted">์•„์ง ๋ณด๊ณ ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.</p>
) : (
<ol className="feed__list">
{reports.map((report) => (
<li key={report.id}>
<ReportCard report={report} org={org} />
</li>
))}
</ol>
)}
</section>

<section aria-labelledby="runs-title">
<h2 id="runs-title" className="section-title">
ํŒ€ ์„ธ์…˜ {task.runs.length}
Expand Down Expand Up @@ -117,6 +136,7 @@ export default async function TaskPage({ params, searchParams }: Props) {
</>
)}
</section>
</div>

<aside aria-labelledby="timeline-title">
<h2 id="timeline-title" className="section-title">
Expand Down
Loading
Loading