mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 08:18:10 +01:00
Merge branch 'main' into chore/one-check-per-change
This commit is contained in:
3 files changed
+49
-14
No files matched your search
@@ -34,6 +34,7 @@ async function loadBuildRequests(userId: string): Promise<BuildRequestCard[]> {
|
||||
look: r.look,
|
||||
status: r.status,
|
||||
previewUrl: r.previewUrl,
|
||||
projectId: r.projectId,
|
||||
accessCode: r.accessCode,
|
||||
note: r.note,
|
||||
createdAt: r.createdAt.toISOString(),
|
||||
|
||||
@@ -17,6 +17,7 @@ export type BuildRequestCard = {
|
||||
look: { before: string; after: string; summary: string | null } | null;
|
||||
status: "waiting" | "building" | "declined";
|
||||
previewUrl: string | null;
|
||||
projectId: string | null;
|
||||
accessCode: string | null;
|
||||
note: string | null;
|
||||
createdAt: string;
|
||||
@@ -144,23 +145,52 @@ function BuildRequestRow({ request: r }: { request: BuildRequestCard }) {
|
||||
)}
|
||||
</div>
|
||||
) : r.status === "building" ? (
|
||||
<p className="text-sm text-text-secondary">
|
||||
Approved.{" "}
|
||||
{r.previewUrl ? (
|
||||
<>
|
||||
Building at{" "}
|
||||
<a className="underline" href={r.previewUrl} target="_blank" rel="noreferrer">
|
||||
{r.previewUrl}
|
||||
</a>
|
||||
{r.accessCode ? ` · code ${r.accessCode}` : ""}
|
||||
</>
|
||||
) : (
|
||||
"Building."
|
||||
)}
|
||||
</p>
|
||||
<ApprovedBuild request={r} />
|
||||
) : (
|
||||
<p className="text-sm text-text-secondary">Declined{r.note ? `: “${r.note}”` : "."}</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* An approved build says where it went: the page where its agent can be
|
||||
* watched, the preview and its code, and who already has a seat on it. A bare
|
||||
* "Building at <url>" left the operator with a link that is blank until the
|
||||
* agent finishes and no way back to the work (George, 2026-11-20).
|
||||
*/
|
||||
function ApprovedBuild({ request: r }: { request: BuildRequestCard }) {
|
||||
return (
|
||||
<div className="flex flex-col gap-2 text-sm text-text-secondary">
|
||||
<p>
|
||||
Approved. Loki’s agent is building it now.
|
||||
{r.email ? (
|
||||
<>
|
||||
{" "}
|
||||
{r.email} is on the project as client: their request page shows the link and code, and
|
||||
they can ask for changes there.
|
||||
</>
|
||||
) : null}
|
||||
</p>
|
||||
{r.previewUrl && (
|
||||
<p>
|
||||
Preview:{" "}
|
||||
<a className="underline" href={r.previewUrl} target="_blank" rel="noreferrer">
|
||||
{r.previewUrl}
|
||||
</a>
|
||||
{r.accessCode ? ` · code ${r.accessCode}` : ""}
|
||||
</p>
|
||||
)}
|
||||
{r.projectId && (
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<a href={BUILD_REQUESTS.watchPath(r.projectId)} className="ui-btn-primary min-h-11">
|
||||
Watch it build
|
||||
</a>
|
||||
<a href={BUILD_REQUESTS.peoplePath(r.projectId)} className="ui-btn-secondary min-h-11">
|
||||
People on it
|
||||
</a>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -17,6 +17,10 @@ export const BUILD_REQUESTS = {
|
||||
pagePath: (id: string) => `/change/requests/${id}`,
|
||||
/** Where the operator decides. */
|
||||
reviewPath: "/approvals#build-requests",
|
||||
/** Where the operator watches an approved build's agent work. */
|
||||
watchPath: (projectId: string) => `/projects/${projectId}/watch`,
|
||||
/** Where the operator sees who is on it (the requester is, as client). */
|
||||
peoplePath: (projectId: string) => `/projects/${projectId}#people`,
|
||||
/** A before/after picture as it arrives from the instant preview (data URL). */
|
||||
lookMaxChars: 400_000,
|
||||
summaryMax: 240,
|
||||
|
||||
Reference in new issue
Block a user