diff --git a/apps/web/src/components/projects/project-workspace-page.tsx b/apps/web/src/components/projects/project-workspace-page.tsx index 8aa7ed7..b171063 100644 --- a/apps/web/src/components/projects/project-workspace-page.tsx +++ b/apps/web/src/components/projects/project-workspace-page.tsx @@ -7,7 +7,6 @@ import { ExternalLink, FileText, GitFork, - GitPullRequest, Play, Plus, } from "lucide-react"; @@ -20,17 +19,16 @@ const statusStyle: Record["status"], string> = { "border-emerald-500/40 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300", failed: "border-destructive/40 bg-destructive/10 text-destructive", "needs-input": - "border-orange-500/40 bg-orange-500/10 text-orange-700 dark:text-orange-300", - open: "border-border text-muted-foreground", - queued: "border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-300", + open: "border-border bg-muted/40 text-muted-foreground", + queued: "border-blue-500/40 bg-blue-500/10 text-blue-700 dark:text-blue-300", working: "border-blue-500/40 bg-blue-500/10 text-blue-700 dark:text-blue-300", }; interface RepositoryFormProps { readonly busy: boolean; readonly onChange: (value: string) => void; - readonly onSubmit: () => Promise; + readonly onSubmit: () => void; readonly value: string; } @@ -41,36 +39,46 @@ const RepositoryForm = ({ value, }: RepositoryFormProps) => (
{ event.preventDefault(); - void onSubmit(); + onSubmit(); }} >
-
onChange(event.target.value)} - placeholder="rivet-dev/rivet" + placeholder="https://github.com/owner/repo" required value={value} /> -
); interface ProjectListProps { - readonly projects: readonly Doc<"projects">[] | undefined; + readonly projects: + | readonly { + readonly id: string; + readonly name: string; + readonly sources: readonly { + readonly host: string; + readonly repositoryPath: string; + readonly url: string; + }[]; + }[] + | undefined; readonly selectedId: Id<"projects"> | null; readonly onSelect: (projectId: Id<"projects">) => void; } @@ -85,7 +93,7 @@ const ProjectList = ({ projects, selectedId, onSelect }: ProjectListProps) => { if (projects.length === 0) { return (

- Connect a repository to create its project artifacts and issue queue. + Import a repository to create its project artifacts and issue queue.

); } @@ -94,19 +102,20 @@ const ProjectList = ({ projects, selectedId, onSelect }: ProjectListProps) => { {projects.map((project) => ( ))} @@ -128,40 +137,34 @@ interface ArtifactGridProps { readonly artifacts: readonly Doc<"projectArtifacts">[] | undefined; } +const renderArtifacts = (artifacts: ArtifactGridProps["artifacts"]) => { + if (artifacts === undefined) { + return

Loading artifacts...

; + } + if (artifacts.length === 0) { + return

No artifacts yet.

; + } + return ( +
+ {artifacts.map((artifact) => ( +
+ +

{artifact.path}

+

+ rev {artifact.revision} +

+
+ ))} +
+ ); +}; + const ArtifactGrid = ({ artifacts }: ArtifactGridProps) => (
-
-

- Project artifacts -

-

- Canonical context staged into every issue workspace. -

-
- {artifacts === undefined ? ( -

Loading artifacts...

- ) : ( -
- {artifacts.map((artifact) => ( -
-
-
- -

- {artifact.path} -

-
- - r{artifact.revision} - -
-

- {artifact.content} -

-
- ))} -
- )} +

+ Project artifacts +

+ {renderArtifacts(artifacts)}
); @@ -169,7 +172,7 @@ interface IssueComposerProps { readonly body: string; readonly busy: boolean; readonly onBodyChange: (value: string) => void; - readonly onSubmit: () => Promise; + readonly onSubmit: () => void; readonly onTitleChange: (value: string) => void; readonly title: string; } @@ -183,47 +186,27 @@ const IssueComposer = ({ title, }: IssueComposerProps) => (
{ event.preventDefault(); - void onSubmit(); + onSubmit(); }} > -
-

Raise an issue

-

- The issue becomes the identity for one Flue agent and AgentOS workspace. -

-
-
- - onTitleChange(event.target.value)} - required - value={title} - /> -
-
- -