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
11 changes: 6 additions & 5 deletions frontend/app/modals/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@

import Logo from "@/app/asset/logo.svg";
import { OnboardingGradientBg } from "@/app/onboarding/onboarding-common";
import { atoms } from "@/app/store/global";
import { modalsModel } from "@/app/store/modalmodel";
import { RpcApi } from "@/app/store/wshclientapi";
import { TabRpcClient } from "@/app/store/wshrpcutil";
import { isDev } from "@/util/isdev";
import { fireAndForget } from "@/util/util";
import { useEffect, useState } from "react";
import { getApi } from "../store/global";
import { useAtomValue } from "jotai";
import { useEffect } from "react";
import { Modal } from "./modal";

interface AboutModalVProps {
Expand Down Expand Up @@ -84,9 +85,9 @@ const AboutModalV = ({ versionString, updaterChannel, onClose }: AboutModalVProp
AboutModalV.displayName = "AboutModalV";

const AboutModal = () => {
const [details] = useState(() => getApi().getAboutModalDetails());
const [updaterChannel] = useState(() => getApi().getUpdaterChannel());
const versionString = `${details.version} (${isDev() ? "dev-" : ""}${details.buildTime})`;
const fullConfig = useAtomValue(atoms.fullConfigAtom);
const versionString = `${fullConfig?.version ?? ""} (${isDev() ? "dev-" : ""}${fullConfig?.buildtime ?? ""})`;
const updaterChannel = fullConfig?.settings?.["autoupdate:channel"] ?? "latest";
Comment on lines +89 to +90
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Guard against blank/partial version text before config hydration.

Because fullConfigAtom starts as null, this can briefly render an awkward version string. Add an explicit fallback string for pre-hydration state.

💡 Suggested adjustment
-    const versionString = `${fullConfig?.version ?? ""} (${isDev() ? "dev-" : ""}${fullConfig?.buildtime ?? ""})`;
+    const versionString =
+        fullConfig?.version != null && fullConfig?.buildtime != null
+            ? `${fullConfig.version} (${isDev() ? "dev-" : ""}${fullConfig.buildtime})`
+            : "loading...";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const versionString = `${fullConfig?.version ?? ""} (${isDev() ? "dev-" : ""}${fullConfig?.buildtime ?? ""})`;
const updaterChannel = fullConfig?.settings?.["autoupdate:channel"] ?? "latest";
const versionString =
fullConfig?.version != null && fullConfig?.buildtime != null
? `${fullConfig.version} (${isDev() ? "dev-" : ""}${fullConfig.buildtime})`
: "loading...";
const updaterChannel = fullConfig?.settings?.["autoupdate:channel"] ?? "latest";
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/app/modals/about.tsx` around lines 89 - 90, The versionString
currently interpolates fullConfig fields directly and can render awkward partial
text before fullConfig (from fullConfigAtom) hydrates; update the logic that
builds versionString to detect pre-hydration (fullConfig == null or missing
version/buildtime) and return a clear fallback like "Unknown version" or
"Loading…" instead of composing empty pieces; target the versionString
construction in about.tsx (where versionString and isDev() are used) and ensure
you check fullConfig and fullConfig.settings presence (and fall back
updaterChannel similarly) before interpolating.


useEffect(() => {
fireAndForget(async () => {
Expand Down
2 changes: 2 additions & 0 deletions frontend/types/gotypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,8 @@ declare global {
bookmarks: {[key: string]: WebBookmark};
waveai: {[key: string]: AIModeConfigType};
configerrors: ConfigError[];
version: string;
buildtime: string;
};

// waveobj.Job
Expand Down
4 changes: 4 additions & 0 deletions pkg/wconfig/settingsconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ type FullConfigType struct {
Bookmarks map[string]WebBookmark `json:"bookmarks"`
WaveAIModes map[string]AIModeConfigType `json:"waveai"`
ConfigErrors []ConfigError `json:"configerrors" configfile:"-"`
Version string `json:"version" configfile:"-"`
BuildTime string `json:"buildtime" configfile:"-"`
}

type ConnKeywords struct {
Expand Down Expand Up @@ -696,6 +698,8 @@ func ReadFullConfig() FullConfigType {
utilfn.ReUnmarshal(fieldPtr, configPart)
}
}
fullConfig.Version = wavebase.WaveVersion
fullConfig.BuildTime = wavebase.BuildTime
return fullConfig
}

Expand Down
Loading