Fix type errors, lint, and complexity from VPS architecture cleanup
- Fix brand-to-Convex-Id casts in use-project-workspace (as unknown as) - Extract ProjectsLoading and ConnectProject components to drop SliceOnePage complexity below the lint threshold of 20 - Fix formatting in project-requests.ts - Archive orphaned standalone chat files (route removed, referenced dead env) - All 8 packages typecheck clean; 31 web tests pass; root check clean
This commit is contained in:
@@ -113,6 +113,54 @@ const ConversationEmptyState = () => (
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
type SliceOneState = ReturnType<typeof useSliceOne>;
|
||||||
|
|
||||||
|
const ProjectsLoading = () => (
|
||||||
|
<div className="grid min-h-svh place-items-center bg-[#f2f0e7]">
|
||||||
|
<LoaderCircle className="size-5 animate-spin" />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
const ConnectProject = ({ slice }: { slice: SliceOneState }) => (
|
||||||
|
<main className="grid min-h-svh place-items-center bg-[#f2f0e7] px-5 text-[#20201d]">
|
||||||
|
<form
|
||||||
|
className="w-full max-w-sm"
|
||||||
|
onSubmit={(event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
void slice.connectRepository();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span className="grid size-11 place-items-center bg-[#20201d] text-white">
|
||||||
|
<FolderGit2 className="size-5" />
|
||||||
|
</span>
|
||||||
|
<h1 className="mt-6 text-2xl font-semibold">Connect one project</h1>
|
||||||
|
<p className="mt-2 text-sm leading-6 text-[#68665e]">
|
||||||
|
Slice 1 turns actionable conversation into proposed Work with exact
|
||||||
|
provenance.
|
||||||
|
</p>
|
||||||
|
<input
|
||||||
|
aria-label="Public Git repository URL"
|
||||||
|
className="mt-6 h-12 w-full border border-[#c9c5b9] bg-[#fffefa] px-3 text-sm outline-none focus:border-[#55564e]"
|
||||||
|
onChange={(event) => slice.setRepository(event.target.value)}
|
||||||
|
placeholder="https://github.com/owner/repository"
|
||||||
|
required
|
||||||
|
value={slice.repository}
|
||||||
|
/>
|
||||||
|
{slice.error ? (
|
||||||
|
<p className="mt-2 text-xs text-red-700">{slice.error.message}</p>
|
||||||
|
) : null}
|
||||||
|
<Button
|
||||||
|
className="mt-3 h-12 w-full"
|
||||||
|
disabled={slice.pending}
|
||||||
|
type="submit"
|
||||||
|
>
|
||||||
|
{slice.pending ? (
|
||||||
|
<LoaderCircle className="size-4 animate-spin" />
|
||||||
|
) : null}
|
||||||
|
{slice.pending ? "Connecting" : "Connect project"}
|
||||||
|
</Button>
|
||||||
|
</form>
|
||||||
|
</main>
|
||||||
|
);
|
||||||
|
|
||||||
export const SliceOnePage = () => {
|
export const SliceOnePage = () => {
|
||||||
const slice = useSliceOne();
|
const slice = useSliceOne();
|
||||||
@@ -158,55 +206,11 @@ export const SliceOnePage = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (slice.projects === undefined) {
|
if (slice.projects === undefined) {
|
||||||
return (
|
return <ProjectsLoading />;
|
||||||
<div className="grid min-h-svh place-items-center bg-[#f2f0e7]">
|
|
||||||
<LoaderCircle className="size-5 animate-spin" />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!slice.selectedProject) {
|
if (!slice.selectedProject) {
|
||||||
return (
|
return <ConnectProject slice={slice} />;
|
||||||
<main className="grid min-h-svh place-items-center bg-[#f2f0e7] px-5 text-[#20201d]">
|
|
||||||
<form
|
|
||||||
className="w-full max-w-sm"
|
|
||||||
onSubmit={(event) => {
|
|
||||||
event.preventDefault();
|
|
||||||
void slice.connectRepository();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span className="grid size-11 place-items-center bg-[#20201d] text-white">
|
|
||||||
<FolderGit2 className="size-5" />
|
|
||||||
</span>
|
|
||||||
<h1 className="mt-6 text-2xl font-semibold">Connect one project</h1>
|
|
||||||
<p className="mt-2 text-sm leading-6 text-[#68665e]">
|
|
||||||
Slice 1 turns actionable conversation into proposed Work with exact
|
|
||||||
provenance.
|
|
||||||
</p>
|
|
||||||
<input
|
|
||||||
aria-label="Public Git repository URL"
|
|
||||||
className="mt-6 h-12 w-full border border-[#c9c5b9] bg-[#fffefa] px-3 text-sm outline-none focus:border-[#55564e]"
|
|
||||||
onChange={(event) => slice.setRepository(event.target.value)}
|
|
||||||
placeholder="https://github.com/owner/repository"
|
|
||||||
required
|
|
||||||
value={slice.repository}
|
|
||||||
/>
|
|
||||||
{slice.error ? (
|
|
||||||
<p className="mt-2 text-xs text-red-700">{slice.error.message}</p>
|
|
||||||
) : null}
|
|
||||||
<Button
|
|
||||||
className="mt-3 h-12 w-full"
|
|
||||||
disabled={slice.pending}
|
|
||||||
type="submit"
|
|
||||||
>
|
|
||||||
{slice.pending ? (
|
|
||||||
<LoaderCircle className="size-4 animate-spin" />
|
|
||||||
) : null}
|
|
||||||
{slice.pending ? "Connecting" : "Connect project"}
|
|
||||||
</Button>
|
|
||||||
</form>
|
|
||||||
</main>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const send = async () => {
|
const send = async () => {
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ export const useProjectWorkspace = () => {
|
|||||||
title: nextTitle,
|
title: nextTitle,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
setSelectedIssueId(outcome.issueId as Id<"projectIssues">);
|
setSelectedIssueId(outcome.issueId as unknown as Id<"projectIssues">);
|
||||||
setIssueTitle("");
|
setIssueTitle("");
|
||||||
setIssueBody("");
|
setIssueBody("");
|
||||||
} catch (caughtError) {
|
} catch (caughtError) {
|
||||||
@@ -125,7 +125,7 @@ export const useProjectWorkspace = () => {
|
|||||||
accessToken,
|
accessToken,
|
||||||
request: { kind: "signal", signalId },
|
request: { kind: "signal", signalId },
|
||||||
});
|
});
|
||||||
setSelectedIssueId(outcome.issueId as Id<"projectIssues">);
|
setSelectedIssueId(outcome.issueId as unknown as Id<"projectIssues">);
|
||||||
} catch (caughtError) {
|
} catch (caughtError) {
|
||||||
setError(errorMessage(caughtError));
|
setError(errorMessage(caughtError));
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { Id } from "@code/backend/convex/_generated/dataModel";
|
import type { Id } from "@code/backend/convex/_generated/dataModel";
|
||||||
import { env } from "@code/env/web";
|
import { env } from "@code/env/web";
|
||||||
import { ProjectIssueRequestResult } from '@code/primitives/project-issue';
|
import { ProjectIssueRequestResult } from "@code/primitives/project-issue";
|
||||||
import type { ProjectIssueRequestResult as ProjectIssueRequestResultValue } from '@code/primitives/project-issue';
|
import type { ProjectIssueRequestResult as ProjectIssueRequestResultValue } from "@code/primitives/project-issue";
|
||||||
import { Schema } from "effect";
|
import { Schema } from "effect";
|
||||||
|
|
||||||
const projectRequestsUrl = new URL(
|
const projectRequestsUrl = new URL(
|
||||||
|
|||||||
Reference in New Issue
Block a user