feat(ui): 更新入口移到状态栏右下角「检查更新」,弹窗精简并居中(v2.6.3)

老板看实际界面后提的三点:
  1. 升级弹窗里「当前版本 v2.6.2」那行去掉
  2. 弹窗按钮居中
  3. 工具条右上角的更新图标不要了,改到右下角、蓝色文字链接「检查更新」

改动:
  · index.html:删掉 <button id="btn-update">(工具条图标);
    在 .statusbar 的 .st-right 末尾加 <a class="st-link" id="btn-update">检查更新</a>
  · style.css:.st-link 用主题色 var(--accent)(浅色 #2f6feb / 深色 #4f8ef7),hover 下划线,
    .busy 时降透明度并禁用点击
  · tauri-bridge.js:
      - 「已是最新版本」弹窗不再带 detail(去掉当前版本行)
      - 「发现新版本」的说明里也不再写「当前 vX →」,只留发布时间 + 更新说明
      - 模态框按钮行 justify-content: flex-end → center(Tauri 下所有模态统一)
      - 状态栏是 <a>,没有 disabled,改用 updating 标志 + .busy 类

版本 2.6.2 → 2.6.3,已构建并发布:
  · xymd_2.6.3.exe(2.21 MB)+ .sig
  · latest.json 指向新包,签名按 minisign 规则实验通过
This commit is contained in:
Jidekin committed 2026-11-20 10:42:30 +08:00
1 parent 859c922729
commit 4f8692ca38
8 files changed
+28 -29

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "xiaoyin-markdown-editor", "name": "xiaoyin-markdown-editor",
"productName": "XiaoyinMarkdown", "productName": "XiaoyinMarkdown",
"version": "2.6.2", "version": "2.6.3",
"description": "轻量本地 Markdown 编辑器:实时预览、多标签/多窗口、查找高亮、右键复制全文/打开目录、常用快捷键", "description": "轻量本地 Markdown 编辑器:实时预览、多标签/多窗口、查找高亮、右键复制全文/打开目录、常用快捷键",
"main": "src/main.js", "main": "src/main.js",
"author": "小银", "author": "小银",
+7 -7
View File
@@ -1,13 +1,13 @@
{ {
"version": "2.6.2", "version": "2.6.3",
"notes": "新增「在线升级」:点一下就能检查新版本并自动覆盖安装、重启。\n官网地址 https://md.wangjinding.com/update/latest.json\n\n本次还包含:\n· 工具条新增升级按钮(发现新版本时弹窗,可看更新说明)\n· 下载走签名校验,安装包被篡改会被拒绝", "notes": "更新入口改到状态栏右下角(蓝色「检查更新」文字链接),工具条上的更新图标去掉。\n升级弹窗不再显示当前版本,按钮居中。版本号提示保持简洁。",
"pub_date": "2026-11-20T02:29:06Z", "pub_date": "2026-11-20T02:42:06Z",
"platforms": { "platforms": {
"windows-x86_64": { "windows-x86_64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSWWkrQjVjQnNqN2l5cDhYZE1RbW5weXRjUkdsQTdVOS9KL2VDRElIelpZd0trT1pQTG5sZVNWWFJNRExIcWs4R2VDRVFlTWExYk9HQ01LbXJoVzZmMWpRQm9HQU1ZZ0FjPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzk1MTQxMTUwCWZpbGU6WGlhb3lpbk1hcmtkb3duXzIuNi4yX3g2NC1zZXR1cC5leGUJdmVyc2lvbjoyLjYuMgpJOVZmM0c4bG9sSXE3UlRjRGdtamZkemVnMVZhand3cTBES2VsSFUyS1Zad0gzNWdZU3lIMnVqSHkzZGtkdkdGcThHZUdmUEFJc1d4QVFyeFUrbXdEdz09Cg==", "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSWWkrQjVjQnNqN2pDQXcvUEM5WGhyOTluTlB3NTRGMlZ6TEpBTDNFWHQzNXNkcmU3QlY3WHJJSVYvSUUzSjRNZFRGSDdyb1VGZ2R0MkU1UUZ2V1NjYU1FMTNjbEl0d0FZPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzk1MTQyNDE2CWZpbGU6WGlhb3lpbk1hcmtkb3duXzIuNi4zX3g2NC1zZXR1cC5leGUJdmVyc2lvbjoyLjYuMwp0U2JUdDlvd3Z1MzYxUE41VW10dTJFRjNNeDgvTXhRVWJMSWovdVFKSmtnUG8vM2lFNUxJa3Axa3lWMnd5NmRheEtMWlBJOXVDZGVvWm8yL0J5bGdDZz09Cg==",
"url": "https://md.wangjinding.com/download/xymd_2.6.2.exe", "url": "https://md.wangjinding.com/download/xymd_2.6.3.exe",
"size": 2314969, "size": 2315317,
"sha256": "61baa671049fb60886ec11c0d6d086da9cd6cebacfbf2f78c1be574853801223" "sha256": "d50922f3dfc5e7315a6fe8466bcf593fd5adda2a7d10d3211e389e219fc02ce8"
} }
} }
} }
+1 -1
View File
@@ -5368,7 +5368,7 @@ dependencies = [
[[package]] [[package]]
name = "xiaoyin-markdown" name = "xiaoyin-markdown"
version = "2.6.2" version = "2.6.3"
dependencies = [ dependencies = [
"clipboard-win", "clipboard-win",
"serde", "serde",
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "xiaoyin-markdown" name = "xiaoyin-markdown"
version = "2.6.2" version = "2.6.3"
description = "小银 Markdown —— 轻量本地 Markdown 编辑器" description = "小银 Markdown —— 轻量本地 Markdown 编辑器"
edition = "2021" edition = "2021"
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "XiaoyinMarkdown", "productName": "XiaoyinMarkdown",
"version": "2.6.2", "version": "2.6.3",
"identifier": "com.xiaoyin.markdown", "identifier": "com.xiaoyin.markdown",
"build": { "build": {
"frontendDist": "../src/renderer" "frontendDist": "../src/renderer"
+2 -3
View File
@@ -80,9 +80,6 @@
<span id="openmode-label">标签</span> <span id="openmode-label">标签</span>
</button> </button>
<button class="tb-icon" id="btn-update" title="检查更新 / 在线升级" hidden>
<svg viewBox="0 0 16 16"><path d="M7.25 1.4h1.5v6.15l2.29-2.3 1.06 1.07L8 10.5 3.9 6.32 4.96 5.25l2.29 2.3V1.4zM2 11h1.5v2.5h9V11H14v4H2v-4z"/></svg>
</button>
<button class="tb-icon" id="btn-theme" title="切换深色/浅色 (Ctrl+Shift+L)"> <button class="tb-icon" id="btn-theme" title="切换深色/浅色 (Ctrl+Shift+L)">
<svg viewBox="0 0 16 16"><path d="M8 1a7 7 0 100 14A7 7 0 008 1zm0 1.5v11a5.5 5.5 0 010-11z"/></svg> <svg viewBox="0 0 16 16"><path d="M8 1a7 7 0 100 14A7 7 0 008 1zm0 1.5v11a5.5 5.5 0 010-11z"/></svg>
@@ -164,6 +161,8 @@
<span id="st-cursor">第 1 行, 第 1 列</span> <span id="st-cursor">第 1 行, 第 1 列</span>
<span class="st-div">|</span> <span class="st-div">|</span>
<span>UTF-8</span> <span>UTF-8</span>
<span class="st-div">|</span>
<a class="st-link" id="btn-update" title="检查更新">检查更新</a>
</div> </div>
</footer> </footer>
+4
View File
@@ -699,6 +699,10 @@ html[data-theme="dark"] .markdown-body code { color: #f0a1c0; }
color: var(--text-faint); color: var(--text-faint);
} }
.st-left, .st-right { display: flex; align-items: center; gap: 8px; } .st-left, .st-right { display: flex; align-items: center; gap: 8px; }
/* 状态栏里的「检查更新」文字链接 */
.st-link { color: var(--accent); cursor: pointer; text-decoration: none; }
.st-link:hover { text-decoration: underline; }
.st-link.busy { opacity: .5; pointer-events: none; }
.st-file { color: var(--text-dim); max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .st-file { color: var(--text-dim); max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-dirty { .st-dirty {
padding: 1px 6px; padding: 1px 6px;
+11 -15
View File
@@ -38,7 +38,7 @@
box.appendChild(d); box.appendChild(d);
} }
const row = document.createElement('div'); const row = document.createElement('div');
row.style.cssText = 'display:flex;gap:8px;justify-content:flex-end;'; row.style.cssText = 'display:flex;gap:10px;justify-content:center;margin-top:4px;';
buttons.forEach((label, i) => { buttons.forEach((label, i) => {
const b = document.createElement('button'); const b = document.createElement('button');
b.textContent = label; b.textContent = label;
@@ -161,10 +161,8 @@
/* ---------- 在线升级(服务端:https://md.wangjinding.com/update/latest.json) ---------- */ /* ---------- 在线升级(服务端:https://md.wangjinding.com/update/latest.json) ---------- */
const updateBtn = document.getElementById('btn-update'); const updateBtn = document.getElementById('btn-update');
if (updateBtn) { if (updateBtn) updateBtn.addEventListener('click', runUpdate);
updateBtn.hidden = false; let updating = false;
updateBtn.addEventListener('click', runUpdate);
}
/* 升级进度浮层 */ /* 升级进度浮层 */
function progressUI(title) { function progressUI(title) {
@@ -207,21 +205,18 @@
} }
async function runUpdate() { async function runUpdate() {
if (!updateBtn || updateBtn.disabled) return; if (!updateBtn || updating) return;
updateBtn.disabled = true; updating = true;
updateBtn.classList.add('busy');
try { try {
const st = await invoke('check_update'); const st = await invoke('check_update');
if (!st || !st.available) { if (!st || !st.available) {
await modalDialog({ await modalDialog({ message: '已是最新版本', buttons: ['好'] });
message: '已是最新版本',
detail: `当前版本 v${(st && st.current) || ''}`,
buttons: ['好'],
});
return; return;
} }
const lines = [`当前 v${st.current} → 新版本 v${st.version}`]; const lines = [];
if (st.date) lines.push(`发布时间:${st.date}`); if (st.date) lines.push(`发布时间:${st.date}`);
if (st.notes) lines.push('', '更新说明:', st.notes); if (st.notes) lines.push('', st.notes);
const pick = await modalDialog({ const pick = await modalDialog({
message: `发现新版本 v${st.version}`, message: `发现新版本 v${st.version}`,
detail: lines.join('\n'), detail: lines.join('\n'),
@@ -243,7 +238,8 @@
} catch (e) { } catch (e) {
await modalDialog({ message: '检查更新失败', detail: String((e && e.message) || e), buttons: ['好'] }); await modalDialog({ message: '检查更新失败', detail: String((e && e.message) || e), buttons: ['好'] });
} finally { } finally {
updateBtn.disabled = false; updating = false;
updateBtn.classList.remove('busy');
} }
} }