fix:一些显示bug
Some checks failed
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled

This commit is contained in:
2026-09-13 18:25:36 +08:00
parent f81a89adc9
commit 8e9b0894ba
6 changed files with 136 additions and 1 deletions

View File

@ -0,0 +1,33 @@
p = r"D:\Project\Starlight_Lancher\apps\app-frontend\src\components\ui\Breadcrumbs.vue"
t = open(p, encoding="utf-8").read()
old = """function resolveLabel(name: string): string {
return resolveBreadcrumbLabel(
name,
(key) => breadcrumbData.getName(key),
staticLabels,
(message) => formatMessage(message),
)
}"""
new = """function resolveLabel(name: string): string {
return resolveBreadcrumbLabel(
name,
(key) => breadcrumbData.getName(key) || fallbackDynamicLabel(key),
staticLabels,
(message) => formatMessage(message),
)
}
// 动态面包屑(?Xxx在页面异步 setName 之前,回退到静态标签,避免图标与文字不同步
function fallbackDynamicLabel(key: string): string {
const fallback: Record<string, keyof typeof staticLabels> = {
BrowseTitle: 'Discover content',
}
const staticKey = fallback[key]
return staticKey ? formatMessage(staticLabels[staticKey]) : ''
}"""
assert old in t, "resolveLabel 找不到"
t = t.replace(old, new, 1)
open(p, "w", encoding="utf-8", newline="\n").write(t)
print("done")