Skip to content
Open
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
17 changes: 14 additions & 3 deletions team-ui/src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export function Layout() {
const location = useLocation();
const [pendingCount, setPendingCount] = useState(0);
const onDashboard = location.pathname === "/dashboard";
const onReview = location.pathname === "/review";

useEffect(() => {
if (onDashboard) return;
Expand Down Expand Up @@ -41,8 +42,12 @@ export function Layout() {
}

return (
<div className="min-h-screen bg-gray-50 overflow-x-hidden">
<nav className="bg-white border-b border-gray-200">
<div
className={`bg-gray-50 overflow-x-hidden ${
onReview ? "flex h-dvh flex-col overflow-y-hidden" : "min-h-dvh"
}`}
>
<nav className="shrink-0 bg-white border-b border-gray-200">
<div className="max-w-2xl mx-auto px-4 py-3 flex items-center justify-between">
<div className="flex items-center gap-3 md:gap-6">
<span className="text-lg font-bold text-indigo-600">cq</span>
Expand All @@ -60,7 +65,13 @@ export function Layout() {
</div>
</div>
</nav>
<main className="max-w-2xl mx-auto py-8 px-4">
<main
className={`max-w-2xl mx-auto w-full px-4 ${
onReview
? "flex flex-1 min-h-0 flex-col overflow-hidden py-4 md:py-8"
: "py-8"
}`}
>
<Outlet context={{ setPendingCount }} />
</main>
</div>
Expand Down
33 changes: 19 additions & 14 deletions team-ui/src/components/ReviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { forwardRef } from "react";
import type { KnowledgeUnit, Selection } from "../types";
import { DomainTags } from "./DomainTags";
import { timeAgo } from "../utils";
import type { DragState, PointerHandlers } from "../hooks/useCardDrag";
import type { DragState, GestureHandlers } from "../hooks/useCardDrag";
import { FLY_OFF_MS, MAX_ROTATION_DEG, SNAP_BACK_MS } from "../hooks/useCardDrag";

interface Props {
unit: KnowledgeUnit;
selection: Selection;
drag: DragState;
pointerHandlers: PointerHandlers;
pointerHandlers: GestureHandlers;
}

const CARD_STYLES: Record<string, string> = {
Expand Down Expand Up @@ -54,33 +54,38 @@ export const ReviewCard = forwardRef<HTMLDivElement, Props>(
return (
<div
ref={ref}
className={`relative z-0 border-2 rounded-lg p-6 max-w-xl mx-auto select-none touch-none ${cardStyle}`}
className={`relative z-0 mx-auto flex h-full max-h-full w-full max-w-xl select-none flex-col overflow-hidden rounded-lg border-2 p-4 touch-pan-y sm:p-6 ${cardStyle}`}
style={{ transform, transition, boxShadow: shadow }}
{...pointerHandlers}
>
<div className="flex items-center justify-between mb-3">
<div className="mb-3 flex items-center justify-between">
<DomainTags domains={unit.domain} variant={activeState} />
<span className="text-xs text-gray-400">
{timeAgo(unit.evidence.first_observed)}
</span>
</div>

<h2 className="text-lg font-semibold text-gray-900 mb-2">
<h2 className="mb-3 text-lg font-semibold text-gray-900">
{unit.insight.summary}
</h2>

<p className="text-gray-600 mb-3 leading-relaxed">
{unit.insight.detail}
</p>
<div
className="min-h-0 flex-1 overflow-y-auto overscroll-contain pr-1"
data-scroll-region="true"
>
<p className="mb-3 leading-relaxed text-gray-600">
{unit.insight.detail}
</p>

<div className={`border-l-3 rounded-r-lg px-4 py-3 mb-6 ${actionBoxStyle}`}>
<span className="text-xs font-semibold uppercase tracking-wide">
Action
</span>
<p className="text-gray-800 text-sm mt-1">{unit.insight.action}</p>
<div className={`mb-6 rounded-r-lg border-l-3 px-4 py-3 ${actionBoxStyle}`}>
<span className="text-xs font-semibold uppercase tracking-wide">
Action
</span>
<p className="mt-1 text-sm text-gray-800">{unit.insight.action}</p>
</div>
</div>

<div className="flex gap-4 text-sm text-gray-500">
<div className="flex gap-4 pt-3 text-sm text-gray-500">
<span>
Confidence: <strong className={confidenceColor(unit.evidence.confidence)}>{unit.evidence.confidence.toFixed(2)}</strong>
</span>
Expand Down
Loading