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
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,3 @@ pnpm build
| `OPENCLAW_TOKEN` | Yes | Auth token for OpenClaw gateway |
| `CONVEX_URL` | Yes | Convex deployment URL |
| `OPENAI_API_KEY` | No | OpenAI key (for image generation) |

## License

MIT

## Credits

Built on [OpenClaw](https://github.com/openclaw/openclaw) — the open-source AI agent platform.
3 changes: 3 additions & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
"next-themes": "^0.4.6",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"react-markdown": "^10.1.0",
"rehype-raw": "^7.0.0",
"remark-gfm": "^4.0.1",
"tippy.js": "^6.3.7",
"ws": "^8.19.0",
"zod": "^4.3.6"
Expand Down
7 changes: 6 additions & 1 deletion apps/web/src/app/(dashboard)/_components/nav-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
import { ChevronLeft, Settings2, AlertTriangle } from "lucide-react";
import { ChevronLeft, Settings2, AlertTriangle, Globe } from "lucide-react";
import {
SidebarGroup,
SidebarGroupLabel,
Expand All @@ -19,6 +19,11 @@ const settingsItems = [
url: "/settings/general",
icon: Settings2,
},
{
title: "Business",
url: "/settings/business",
icon: Globe,
},
{
title: "Danger zone",
url: "/settings/danger-zone",
Expand Down
26 changes: 15 additions & 11 deletions apps/web/src/app/(dashboard)/board/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
type KanbanTask,
type KanbanColumnDef,
} from "@/components/kanban";
import { LiveFeed } from "@/components/live-feed";

// Map priority from Convex to Kanban format
function mapPriority(priority?: string): "low" | "medium" | "high" {
Expand Down Expand Up @@ -78,6 +79,7 @@ const BoardPage = () => {
done: [],
};

// Add real tasks from Convex
if (tasks) {
for (const task of tasks) {
if (isValidStatus(task.status)) {
Expand All @@ -90,13 +92,13 @@ const BoardPage = () => {
{
id: "inbox",
title: "Inbox",
variant: "todo",
variant: "inbox",
tasks: groupedTasks.inbox,
},
{
id: "assigned",
title: "Assigned",
variant: "todo",
variant: "assigned",
tasks: groupedTasks.assigned,
},
{
Expand All @@ -108,7 +110,7 @@ const BoardPage = () => {
{
id: "review",
title: "Review",
variant: "in-review",
variant: "review",
tasks: groupedTasks.review,
},
{
Expand All @@ -121,20 +123,22 @@ const BoardPage = () => {

return (
<>
<PageHeader>
<PageHeader className="mb-0">
<PageHeaderRow>
<PageHeaderTitle>Board</PageHeaderTitle>
</PageHeaderRow>
</PageHeader>

<div className="min-h-0 flex-1">
{!tasks ? (
<div className="text-muted-foreground flex items-center justify-center p-8">
Loading...
</div>
) : (
<div className="flex min-h-0 flex-1 gap-4 overflow-hidden">
{/* Kanban Board */}
<div className="min-w-0 flex-1 pt-6">
<KanbanBoard columns={columns} className="h-full" />
)}
</div>

{/* Live Feed Sidebar */}
<div className="bg-muted/30 hidden h-full w-80 shrink-0 overflow-hidden border-l lg:block">
<LiveFeed className="h-full" />
</div>
</div>
</>
);
Expand Down
4 changes: 3 additions & 1 deletion apps/web/src/app/(dashboard)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ const DashboardLayout = ({ children, header }: DashboardLayoutProps) => {
{header}
</header>
{fullHeight ? (
<main className="flex min-h-0 flex-1 flex-col">{children}</main>
<main className="flex min-h-0 flex-1 flex-col overflow-hidden p-6">
{children}
</main>
) : (
<ScrollArea className="h-full min-h-0 flex-1">
<main className="p-6">{children}</main>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
"use client";

import { useState, useEffect } from "react";
import { useQuery, useMutation } from "convex/react";
import { api } from "@clawe/backend";
import { Button } from "@clawe/ui/components/button";
import { Input } from "@clawe/ui/components/input";
import { Label } from "@clawe/ui/components/label";
import { Textarea } from "@clawe/ui/components/textarea";
import { Spinner } from "@clawe/ui/components/spinner";
import { Globe, Building2, Users, Palette } from "lucide-react";

export const BusinessSettingsForm = () => {
const businessContext = useQuery(api.businessContext.get);
const saveBusinessContext = useMutation(api.businessContext.save);

const [url, setUrl] = useState("");
const [name, setName] = useState("");
const [description, setDescription] = useState("");
const [industry, setIndustry] = useState("");
const [targetAudience, setTargetAudience] = useState("");
const [tone, setTone] = useState("");
const [isDirty, setIsDirty] = useState(false);
const [isSaving, setIsSaving] = useState(false);

// Load existing business context
useEffect(() => {
if (businessContext) {
setUrl(businessContext.url ?? "");
setName(businessContext.name ?? "");
setDescription(businessContext.description ?? "");
setIndustry(businessContext.metadata?.industry ?? "");
setTargetAudience(businessContext.metadata?.targetAudience ?? "");
setTone(businessContext.metadata?.tone ?? "");
setIsDirty(false);
}
}, [businessContext]);

const handleChange = (
setter: React.Dispatch<React.SetStateAction<string>>,
) => {
return (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
setter(e.target.value);
setIsDirty(true);
};
};

const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
if (!isDirty || !url) return;

setIsSaving(true);
try {
await saveBusinessContext({
url,
name: name || undefined,
description: description || undefined,
metadata: {
industry: industry || undefined,
targetAudience: targetAudience || undefined,
tone: tone || undefined,
},
approved: true,
});
setIsDirty(false);
} finally {
setIsSaving(false);
}
};

// Loading state
if (businessContext === undefined) {
return (
<div className="flex items-center justify-center py-8">
<Spinner className="text-muted-foreground" />
</div>
);
}

return (
<form onSubmit={handleSubmit} className="space-y-8">
{/* Website URL - Primary field */}
<div className="space-y-2">
<Label htmlFor="url" className="flex items-center gap-2">
<Globe className="h-4 w-4" />
Website URL
</Label>
<Input
id="url"
type="url"
value={url}
onChange={handleChange(setUrl)}
placeholder="https://yourwebsite.com"
/>
<p className="text-muted-foreground text-sm">
Your business website. This helps agents understand your brand and
context.
</p>
</div>

{/* Business Name */}
<div className="space-y-2">
<Label htmlFor="name" className="flex items-center gap-2">
<Building2 className="h-4 w-4" />
Business Name
</Label>
<Input
id="name"
value={name}
onChange={handleChange(setName)}
placeholder="Acme Inc"
/>
<p className="text-muted-foreground text-sm">
The name of your business or brand.
</p>
</div>

{/* Description */}
<div className="space-y-2">
<Label htmlFor="description">Description</Label>
<Textarea
id="description"
value={description}
onChange={handleChange(setDescription)}
placeholder="Describe what your business does..."
rows={3}
/>
<p className="text-muted-foreground text-sm">
A brief description of what your business does and its main offerings.
</p>
</div>

{/* Metadata Section */}
<div className="border-t pt-6">
<h3 className="mb-4 text-sm font-medium">Additional Context</h3>

<div className="space-y-6">
{/* Industry */}
<div className="space-y-2">
<Label htmlFor="industry">Industry</Label>
<Input
id="industry"
value={industry}
onChange={handleChange(setIndustry)}
placeholder="e.g., E-commerce, SaaS, Healthcare"
/>
</div>

{/* Target Audience */}
<div className="space-y-2">
<Label htmlFor="targetAudience" className="flex items-center gap-2">
<Users className="h-4 w-4" />
Target Audience
</Label>
<Input
id="targetAudience"
value={targetAudience}
onChange={handleChange(setTargetAudience)}
placeholder="e.g., Small business owners, Developers, Parents"
/>
<p className="text-muted-foreground text-sm">
Who are your primary customers or users?
</p>
</div>

{/* Tone */}
<div className="space-y-2">
<Label htmlFor="tone" className="flex items-center gap-2">
<Palette className="h-4 w-4" />
Brand Tone
</Label>
<Input
id="tone"
value={tone}
onChange={handleChange(setTone)}
placeholder="e.g., Professional, Friendly, Playful, Technical"
/>
<p className="text-muted-foreground text-sm">
The tone and style that best represents your brand voice.
</p>
</div>
</div>
</div>

<Button
type="submit"
variant="brand"
disabled={!isDirty || !url || isSaving}
>
{isSaving ? (
<>
<Spinner />
Saving...
</>
) : (
"Save changes"
)}
</Button>
</form>
);
};
26 changes: 26 additions & 0 deletions apps/web/src/app/(dashboard)/settings/business/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"use client";

import {
PageHeader,
PageHeaderRow,
PageHeaderTitle,
} from "@dashboard/page-header";
import { BusinessSettingsForm } from "./_components/business-settings-form";

const BusinessSettingsPage = () => {
return (
<>
<PageHeader>
<PageHeaderRow>
<PageHeaderTitle>Business</PageHeaderTitle>
</PageHeaderRow>
</PageHeader>

<div className="max-w-2xl">
<BusinessSettingsForm />
</div>
</>
);
};

export default BusinessSettingsPage;
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const GeneralSettingsForm = () => {
</p>
</div>

<Button type="submit" disabled={!isDirty}>
<Button type="submit" variant="brand" disabled={!isDirty}>
Save changes
</Button>
</form>
Expand Down
Loading