Skip to content

Commit 7b09f4e

Browse files
committed
Restructure build metadata in settings and bump version (#360)
- Split app and server build info into reusable blocks - Update package versions to 0.18.0
1 parent c94aced commit 7b09f4e

2 files changed

Lines changed: 35 additions & 28 deletions

File tree

apps/web/src/routes/_chat.settings.tsx

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
import { type ReactNode, useCallback, useEffect, useState } from "react";
1616
import type { TestOpenclawGatewayResult } from "@okcode/contracts";
1717
import {
18+
type BuildMetadata,
1819
type ProjectId,
1920
type ProviderKind,
2021
DEFAULT_GIT_TEXT_GENERATION_MODEL,
@@ -249,6 +250,32 @@ function getErrorMessage(error: unknown): string {
249250
return "Unknown error";
250251
}
251252

253+
function BuildInfoBlock({ label, buildInfo }: { label: string; buildInfo: BuildMetadata }) {
254+
return (
255+
<dl className="min-w-0">
256+
<dt className="text-[10px] uppercase tracking-[0.18em] text-muted-foreground">{label}</dt>
257+
<dd className="mt-1 space-y-1 text-[11px] leading-5 text-muted-foreground">
258+
<div className="flex min-w-0 flex-wrap gap-x-1.5 gap-y-0.5 font-mono">
259+
<span className="font-medium text-foreground">{buildInfo.version}</span>
260+
<span aria-hidden="true">·</span>
261+
<span>{buildInfo.surface}</span>
262+
<span aria-hidden="true">·</span>
263+
<span>
264+
{buildInfo.platform}/{buildInfo.arch}
265+
</span>
266+
</div>
267+
<div className="flex min-w-0 flex-wrap gap-x-1.5 gap-y-0.5 font-mono">
268+
<span>{buildInfo.channel}</span>
269+
<span aria-hidden="true">·</span>
270+
<span className="break-words">{buildInfo.commitHash ?? "unknown"}</span>
271+
<span aria-hidden="true">·</span>
272+
<span className="break-words">{buildInfo.buildTimestamp}</span>
273+
</div>
274+
</dd>
275+
</dl>
276+
);
277+
}
278+
252279
function BackgroundImageSettings({
253280
backgroundImageUrl,
254281
backgroundImageOpacity,
@@ -2266,30 +2293,10 @@ function SettingsRouteView() {
22662293
title="Build"
22672294
description="Current app-shell and server build metadata."
22682295
control={
2269-
<div className="space-y-2 text-left">
2270-
<div className="space-y-0.5">
2271-
<div className="text-[11px] uppercase tracking-[0.18em] text-muted-foreground">
2272-
App
2273-
</div>
2274-
<code className="block text-xs font-medium text-muted-foreground">
2275-
{`${APP_BUILD_INFO.version} · ${APP_BUILD_INFO.surface} · ${APP_BUILD_INFO.platform}/${APP_BUILD_INFO.arch}`}
2276-
</code>
2277-
<code className="block text-[11px] text-muted-foreground">
2278-
{`${APP_BUILD_INFO.channel} · ${APP_BUILD_INFO.commitHash ?? "unknown"} · ${APP_BUILD_INFO.buildTimestamp}`}
2279-
</code>
2280-
</div>
2296+
<div className="grid w-full gap-3 text-left sm:max-w-xl sm:grid-cols-2 sm:gap-5">
2297+
<BuildInfoBlock label="App" buildInfo={APP_BUILD_INFO} />
22812298
{serverConfigQuery.data?.buildInfo ? (
2282-
<div className="space-y-0.5">
2283-
<div className="text-[11px] uppercase tracking-[0.18em] text-muted-foreground">
2284-
Server
2285-
</div>
2286-
<code className="block text-xs font-medium text-muted-foreground">
2287-
{`${serverConfigQuery.data.buildInfo.version} · ${serverConfigQuery.data.buildInfo.surface} · ${serverConfigQuery.data.buildInfo.platform}/${serverConfigQuery.data.buildInfo.arch}`}
2288-
</code>
2289-
<code className="block text-[11px] text-muted-foreground">
2290-
{`${serverConfigQuery.data.buildInfo.channel} · ${serverConfigQuery.data.buildInfo.commitHash ?? "unknown"} · ${serverConfigQuery.data.buildInfo.buildTimestamp}`}
2291-
</code>
2292-
</div>
2299+
<BuildInfoBlock label="Server" buildInfo={serverConfigQuery.data.buildInfo} />
22932300
) : null}
22942301
</div>
22952302
}

bun.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)