Skip to content

A local-first multi-agent app development platform, built on PenguinHarness

feat: 新对话页的版本行直接写出最新发布版

lmlihengd0bb21b298be
diff --git a/changelog/unreleased/2026-10-21-version-line-latest.md b/changelog/unreleased/2026-10-21-version-line-latest.md
new file mode 100644
index 00000000..a0a551d7
--- /dev/null
+++ b/changelog/unreleased/2026-10-21-version-line-latest.md
@@ -0,0 +1,33 @@
+# The new-chat page's version line names the newest release
+
+- **Date:** 2026-10-21
+- **Type:** feature
+- **Scope:** `web`, `docs`
+- **Breaking:** no
+
+[中文版](2026-10-21-version-line-latest.zh.md)
+
+The version line under the brand on the new-chat page used to carry the running version alone
+(`v0.5.1 · Last updated Oct 17`), with a superscript "New version available" beside it when a
+release was offered — the version number itself hidden in that badge's tooltip. An install two
+releases behind therefore could not see how far behind it was, on the one page a reader opens to
+settle exactly that question. The line now names the newest release when the update check knows
+one: `v0.5.1 · Last updated Oct 17 · Latest v0.5.2`. A build that is already the latest adds
+nothing.
+
+## Details
+
+- The number comes from the update check the app already runs once per page load (the server caches
+ its lookup for an hour and can be told not to dial out; with checks off there is no answer to
+ show and the line stays as it was).
+- The half is appended only when the newest release is newer than the running build: an up-to-date
+ build already prints the latest version in the first half, so repeating it would say nothing.
+- A failed lookup, a response that names no version, or disabled checks all leave the line exactly
+ as it was.
+- The superscript badge — the button into the update dialog — is unchanged: it reports where the
+ update stands, and the version number is now the line's to state.
+- The "Check the running version" section of the docs describes the new half, in both languages.
+
+## Compatibility
+
+- A Web App line only: no API, wire-format or dependency change.
diff --git a/changelog/unreleased/2026-10-21-version-line-latest.zh.md b/changelog/unreleased/2026-10-21-version-line-latest.zh.md
new file mode 100644
index 00000000..a4849580
--- /dev/null
+++ b/changelog/unreleased/2026-10-21-version-line-latest.zh.md
@@ -0,0 +1,22 @@
+# 新对话页的版本行会写出最新发布版
+
+- **Date:** 2026-10-21
+- **Type:** feature
+- **Scope:** `web`, `docs`
+- **Breaking:** 否
+
+[English](2026-10-21-version-line-latest.md)
+
+新对话页品牌下的版本行此前只写正在运行的版本(`v0.5.1 · 最近更新日期 10月17日`),有新版本时旁边只多一个上标「有新版本可用」,而那个新版号藏在它的悬停提示里。于是落后两个版本的安装看不出自己落后了 —— 这一行正是读者确认版本的地方。现在检查到更新的发布版时,这一行直接写出**最新版本 v0.5.2**(`v0.5.1 · 最近更新日期 10月17日 · 最新版本 v0.5.2`);已经是最新就不重复写。
+
+## 细节
+
+- 版本号来自应用每次加载都会做的那次更新检查(服务端缓存一小时,也可以整个关掉;关掉时这一行保持原样)。
+- 只在「最新版比正在运行的新」时追加:已经是最新的构建,前半句写的那个版本就是最新版,再写一遍没有信息量。
+- 检查失败、响应里没有版本号、或者更新检查被关掉,这一行都与以前完全一样。
+- 上标徽章(进入更新弹窗的按钮)没有改动:它说的是更新的状态,版本号现在由这一行来说。
+- 文档(中英)「查看当前版本」一节补上了这半句。
+
+## 兼容性
+
+- 只是 Web App 里的一行:没有接口、传输格式或依赖变化。
diff --git a/packages/docs/content/updates.en.md b/packages/docs/content/updates.en.md
index 71a2e641..39597e3c 100644
--- a/packages/docs/content/updates.en.md
+++ b/packages/docs/content/updates.en.md
@@ -16,7 +16,7 @@ Check which version of Adelie you are running, and update it in the way that mat
In the Web App:
-- The new-chat page shows the running version on a version line such as `vX.Y.Z · Last updated Jul 26`. The release workflow stamps the date into the build, so it is shown without any network access. Dev builds and releases from before the stamping, v0.1.2 and earlier, show no date.
+- The new-chat page shows the running version on a version line such as `vX.Y.Z · Last updated Jul 26`. The release workflow stamps the date into the build, so it is shown without any network access. Dev builds and releases from before the stamping, v0.1.2 and earlier, show no date. When the update check finds a newer release, the line continues with **Latest vX.Y.Z**; a build that is already the latest one adds nothing.
- In the sidebar user menu, the update row directly under **Settings** shows the running version, muted, on its right.
In a terminal:
diff --git a/packages/docs/content/updates.zh.md b/packages/docs/content/updates.zh.md
index e26c1e00..0f0d55a5 100644
--- a/packages/docs/content/updates.zh.md
+++ b/packages/docs/content/updates.zh.md
@@ -16,7 +16,7 @@ description: 查看正在运行的版本,并更新桌面应用、CLI 安装或
在 Web App 里:
-- 新对话页的版本行会显示正在运行的版本,形如 `vX.Y.Z · 最近更新日期 7月26日`。日期由发布流程在构建时写入,所以不联网也能显示。开发构建,以及引入日期写入之前的发布版(v0.1.2 及更早)没有日期。
+- 新对话页的版本行会显示正在运行的版本,形如 `vX.Y.Z · 最近更新日期 7月26日`。日期由发布流程在构建时写入,所以不联网也能显示。开发构建,以及引入日期写入之前的发布版(v0.1.2 及更早)没有日期。检查发现更新的发布版时,这一行会接着写上**最新版本 vX.Y.Z**;已经是最新则不重复写。
- 在侧边栏的用户菜单里,紧贴**设置**下方的更新行会在右侧以浅色显示当前运行的版本。
在终端里:
diff --git a/packages/web/e2e/version-line.spec.mjs b/packages/web/e2e/version-line.spec.mjs
new file mode 100644
index 00000000..464cf628
--- /dev/null
+++ b/packages/web/e2e/version-line.spec.mjs
@@ -0,0 +1,56 @@
+/**
+ * The new-conversation page's version line: it always names the running build, and when the
+ * update check knows a newer published release it names that one beside it. The point is the
+ * stale case — the superscript badge only says "有新版本可用" and keeps the version in a
+ * tooltip, so a reader two releases behind could not see the gap from this page.
+ *
+ * The update check is the one thing stubbed here: its real answer depends on GitHub, and the
+ * case is about the line, not the lookup (the lookup itself is covered by the server's own
+ * tests). Version, login and the draft page are the real app.
+ */
+import { test, expect } from "@playwright/test";
+import { provisionAndLogin } from "./auth.mjs";
+
+const BASE = process.env.BASE_URL;
+const U = "versionline";
+const P = "password123";
+
+/** One UpdateCheckResponse; `latest` names the newest release the lookup found. */
+function checkPayload(latest, updateAvailable) {
+ return {
+ currentVersion: "0.0.0",
+ buildDate: null,
+ latestVersion: latest,
+ updateAvailable,
+ releaseUrl: null,
+ publishedAt: null,
+ checkedAt: new Date().toISOString(),
+ };
+}
+
+test("the new-conversation page names the newest release beside the running one", async ({
+ page,
+}) => {
+ // Swapped between loads: the app reads the check once per page load (module-level cache).
+ let answer = checkPayload("9.9.9", true);
+ await page.route("**/api/version/update-check*", (route) =>
+ route.fulfill({ status: 200, json: answer }),
+ );
+
+ await provisionAndLogin(page.request, U, P);
+ const res = await page.request.get(`${BASE}/api/version`);
+ expect(res.ok(), "version").toBeTruthy();
+ const version = (await res.json()).version;
+
+ await page.goto(`${BASE}/chat/new`);
+ // The brand block: logo, name, subtitle and the version line under them.
+ const brand = page.getByRole("heading", { name: "Adelie" }).locator("..");
+ await expect(brand).toContainText(`v${version}`);
+ await expect(brand).toContainText("最新版本 v9.9.9");
+
+ // Up to date: nothing newer to name, so the line is the running version alone.
+ answer = checkPayload("9.9.9", false);
+ await page.reload();
+ await expect(brand).toContainText(`v${version}`);
+ await expect(brand).not.toContainText("最新版本");
+});
diff --git a/packages/web/src/features/chat/draft-view.tsx b/packages/web/src/features/chat/draft-view.tsx
index f30675f0..c689cee3 100644
--- a/packages/web/src/features/chat/draft-view.tsx
+++ b/packages/web/src/features/chat/draft-view.tsx
@@ -956,8 +956,9 @@ const versionBadgeClass =
"ml-1.5 inline-block align-super text-xs leading-4 text-gray-400 dark:text-gray-500";
/**
- * Quiet version line under the brand subtitle: `vX.Y.Z · Last updated Jul 26`
- * (localized per dictionary). The product name is not repeated here — the brand wordmark
+ * Quiet version line under the brand subtitle: `vX.Y.Z · Last updated Jul 26`, plus
+ * `· Latest vA.B.C` when the update check knows a newer release (localized per
+ * dictionary). The product name is not repeated here — the brand wordmark
* sits directly above, and the sidebar's version footer is bare `vX.Y.Z` too. The date is
* the running version's release
* date, stamped into core's BUILD_DATE at build time — displayed as-is, no network;
@@ -971,14 +972,22 @@ const versionBadgeClass =
*/
function VersionLine() {
const { locale } = useLocale();
- const { version } = useVersionInfo(true);
+ const { version, update } = useVersionInfo(true);
if (version === null) return null;
const date = version.buildDate;
+ // The newest published release, when the check knows one newer than this build: the
+ // version line is where a reader looks to answer "我落后了没有", and the superscript
+ // badge alone only says that an update exists — its version lives in a tooltip. Shown
+ // only when it is newer, so an up-to-date build has nothing to add: the version above
+ // already is the latest one. Naming none (the lookup failed, checks are off, or the
+ // backend has no release) leaves the line as it was.
+ const latest = update !== null && update.updateAvailable ? update.latestVersion : null;
return (
<p className="mt-1.5 text-xs text-gray-400 dark:text-gray-500">
{`v${version.version}${
date !== null ? ` · ${S.update.lastUpdated(formatMonthDay(date, locale))}` : ""
}`}
+ {latest !== null && ` · ${S.update.latestRelease(latest)}`}
<VersionBadge />
</p>
);
diff --git a/packages/web/src/lib/strings-en.ts b/packages/web/src/lib/strings-en.ts
index 89d8801d..01f3adcc 100644
--- a/packages/web/src/lib/strings-en.ts
+++ b/packages/web/src/lib/strings-en.ts
@@ -918,6 +918,12 @@ export const en: Strings = {
update: {
/** Version-line date label; `date` is formatMonthDay output, e.g. "Last updated Jul 26". */
lastUpdated: (date: string) => `Last updated ${date}`,
+ /**
+ * The version line's trailing half when the check knows a newer release: its number, so the
+ * line itself says how far behind this build is. The superscript badge beside it only
+ * carries the version in its tooltip.
+ */
+ latestRelease: (v: string) => `Latest v${v}`,
/** The version line's superscript, a button into the modal; the other two follow the flow. */
newVersionBadge: "New version available",
badgeDownloading: "Downloading update",
diff --git a/packages/web/src/lib/strings.ts b/packages/web/src/lib/strings.ts
index de8562b0..948d52d9 100644
--- a/packages/web/src/lib/strings.ts
+++ b/packages/web/src/lib/strings.ts
@@ -978,6 +978,13 @@ export const zh = {
update: {
/** Version-line date label (owner-specified wording); `date` is formatMonthDay output. */
lastUpdated: (date: string) => `最近更新日期 ${date}`,
+ /**
+ * The version line's trailing half when the check knows a newer release: its number, so the
+ * line itself answers "我落后了没有". The superscript badge beside it says an update exists
+ * but carries the version only in its tooltip, which left a reader two releases behind
+ * unable to see how far behind they were.
+ */
+ latestRelease: (v: string) => `最新版本 v${v}`,
/** The version line's superscript (owner-specified wording), a button into the modal; the other two follow the flow. */
newVersionBadge: "有新版本可用",
badgeDownloading: "正在下载更新",