Bundles in-flight ECHODO work with the Coolify deployment configuration: App - New routes: ai, forms, planner, settings (templates/types), teams, doc detail, whiteboard detail - New components: app shell rework (icon-rail, top-header), forms builder/renderer/responses, types manager, objects creation dialog, card primitive, form + overview views - New tRPC routers: favorites, forms, types, workspaces; updates to health and objects routers - Markdown backlog sync (packages/database) + cursor-sync schema/migrations - Schema additions: forms, types, favorites, markdown_backlog, cursor_sync - Initial Drizzle migrations checked in Deployment - docker/docker-compose.coolify.yml: drops bundled Postgres/Redis (uses CT 102 shared services), removes host port mappings, adds Coolify SERVICE_FQDN_* magic vars for web + collab - .env.example rewritten as the full ECHODO/Coolify variable manifest - NextAuth gains an Authentik OIDC provider (gated on env presence) - Root layout injects Umami tracking script when configured; metadata title flipped to ECHODO Security - .gitignore expanded to exclude AGENT-DEPLOY.md, .env.*, secrets/, credentials.*, *.key, *.crt, *.pem, ssh keys Made-with: Cursor
137 lines
4.5 KiB
TypeScript
137 lines
4.5 KiB
TypeScript
"use client";
|
|
|
|
import * as React from "react";
|
|
import { useDroppable } from "@dnd-kit/core";
|
|
import { SortableContext, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
import { Plus } from "lucide-react";
|
|
|
|
import { ScrollArea } from "@/components/ui/scroll-area";
|
|
import type { ViewObject } from "@/lib/hooks/use-view-data";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
import { BoardCard } from "./board-card";
|
|
|
|
export interface BoardColumnInlineCreate {
|
|
isCreating: boolean;
|
|
newTitle: string;
|
|
onNewTitleChange: (value: string) => void;
|
|
onOpen: () => void;
|
|
onSubmit: () => void;
|
|
onCancel: () => void;
|
|
isPending: boolean;
|
|
}
|
|
|
|
export interface BoardColumnProps {
|
|
columnId: string;
|
|
label: string;
|
|
items: ViewObject[];
|
|
dotClass: string;
|
|
borderTopClass: string;
|
|
inlineCreate: BoardColumnInlineCreate;
|
|
}
|
|
|
|
function formatColumnLabel(id: string): string {
|
|
return id.replace(/_/g, " ");
|
|
}
|
|
|
|
export function BoardColumn({
|
|
columnId,
|
|
label,
|
|
items,
|
|
dotClass,
|
|
borderTopClass,
|
|
inlineCreate,
|
|
}: BoardColumnProps) {
|
|
const { setNodeRef, isOver } = useDroppable({
|
|
id: columnId,
|
|
data: { type: "column", columnId },
|
|
});
|
|
|
|
const ids = items.map((i) => i.id);
|
|
const displayLabel = label || formatColumnLabel(columnId);
|
|
const showEmptyDropLine = items.length === 0 && isOver;
|
|
|
|
return (
|
|
<div
|
|
className={cn(
|
|
"flex h-full min-h-[min(420px,70vh)] w-[min(100%,290px)] min-w-[280px] max-w-[300px] shrink-0 flex-col overflow-hidden rounded-lg border border-border/60 bg-muted/40 shadow-sm dark:bg-muted/25",
|
|
borderTopClass,
|
|
)}
|
|
>
|
|
<header className="shrink-0 border-b border-border/50 px-3 py-2.5">
|
|
<div className="flex items-center gap-2">
|
|
<span
|
|
className={cn("h-2 w-2 shrink-0 rounded-full", dotClass)}
|
|
aria-hidden
|
|
/>
|
|
<h3 className="min-w-0 flex-1 truncate text-sm font-semibold capitalize text-foreground">
|
|
{displayLabel}
|
|
</h3>
|
|
<span className="tabular-nums text-xs font-medium text-muted-foreground">
|
|
{items.length}
|
|
</span>
|
|
</div>
|
|
</header>
|
|
|
|
<div ref={setNodeRef} className="relative flex min-h-0 flex-1 flex-col">
|
|
{showEmptyDropLine && (
|
|
<div
|
|
className="pointer-events-none absolute inset-x-2 top-2 z-0 h-0.5 rounded-full bg-primary/80 shadow-[0_0_10px_hsl(var(--primary)/0.5)]"
|
|
aria-hidden
|
|
/>
|
|
)}
|
|
<ScrollArea className="min-h-0 flex-1 px-2 pt-2">
|
|
<SortableContext items={ids} strategy={verticalListSortingStrategy}>
|
|
<ul className="flex flex-col gap-2 pb-2">
|
|
{items.map((object) => (
|
|
<li key={object.id}>
|
|
<BoardCard object={object} />
|
|
</li>
|
|
))}
|
|
</ul>
|
|
</SortableContext>
|
|
</ScrollArea>
|
|
|
|
<div className="shrink-0 border-t border-border/40">
|
|
{inlineCreate.isCreating ? (
|
|
<div className="flex items-center gap-2 px-2 py-2">
|
|
<input
|
|
autoFocus
|
|
className="min-w-0 flex-1 rounded-md border border-border/60 bg-background px-2 py-1.5 text-sm outline-none ring-offset-background placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring"
|
|
placeholder="Task title…"
|
|
value={inlineCreate.newTitle}
|
|
onChange={(e) => inlineCreate.onNewTitleChange(e.target.value)}
|
|
onKeyDown={(e) => {
|
|
if (e.key === "Enter" && inlineCreate.newTitle.trim()) {
|
|
e.preventDefault();
|
|
inlineCreate.onSubmit();
|
|
}
|
|
if (e.key === "Escape") {
|
|
inlineCreate.onCancel();
|
|
}
|
|
}}
|
|
onBlur={() => {
|
|
if (inlineCreate.isPending) return;
|
|
if (inlineCreate.newTitle.trim()) {
|
|
inlineCreate.onSubmit();
|
|
} else {
|
|
inlineCreate.onCancel();
|
|
}
|
|
}}
|
|
/>
|
|
</div>
|
|
) : (
|
|
<button
|
|
type="button"
|
|
className="flex w-full items-center gap-2 px-2 py-2 text-sm text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground"
|
|
onClick={inlineCreate.onOpen}
|
|
>
|
|
<Plus className="size-4 shrink-0" />
|
|
Add task
|
|
</button>
|
|
)}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|