Repository navigation
Description
What happened?
In the floating capacity bar (taskbar widget), the optional inline reset text is only shortened for English. With a non-English UI language (e.g. Simplified Chinese) the pill shows the full localized relative string, which is long and makes the pill unnecessarily wide.
Examples for a 5-hour window:
- English UI:
Resets in 4h 59m-> inline shows4h 59m - Chinese UI:
4 小时 59 分钟后重置-> inline shows the whole phrase4 小时 59 分钟后重置
Expected: the inline reset should be compact in every locale (e.g. 4h59m / 4小时59分), while the full text stays in the tooltip.
Affected area
- Tray panel
Steps to reproduce
- Set
ui_languagetochinese(Settings -> General -> Language -> 中文). - Enable the floating bar:
float_bar_enabled = true,float_bar_style = "taskbar",float_bar_show_reset_inline = true. - Select a provider that has a short session window, e.g. Codex with
provider_metrics: { "codex": "session" }. - Look at the pill: it renders the full localized string
X 小时 Y 分钟后重置instead of a compactXh Ym.
Root cause
inlineResetTime() in apps/desktop-tauri/src/floatbar/FloatBar.tsx compacts only English strings:
function inlineResetTime(resetText: string): string {
const normalized = resetText.trim();
if (/^reset(?:s|ting)?(?:\s+due)?\s*(?:now)?$/i.test(normalized)) {
return "now";
}
return normalized
.replace(/^resets?\s+in\s+/i, "")
.replace(/^resets?\s+/i, "")
.trim();
}useFormattedResetTime() returns a fully localized string from the Fluent keys ResetsInHoursMinutes / ResetsInDaysHours / ResetsInMinutes / TrayResetsDueNow (see rust/src/locale/*.ftl). Only the English variant starts with Resets in , so the replace() calls strip nothing for other locales.
Verified zh-CN (rust/src/locale/zh-CN.ftl):
ResetsInDaysHours = {} 天 {} 小时后重置
ResetsInHoursMinutes = {} 小时 {} 分钟后重置
ResetsInMinutes = {} 分钟后重置
The resets now branch is also English-only, so TrayResetsDueNow (e.g. "现在重置") is not compacted to now either.
Suggested fix (any one)
- Compose the inline reset from structured parts (days/hours/minutes) with a locale-aware short unit, e.g.
Intl.RelativeTimeFormat(locale, { numeric: "auto", style: "narrow" }), instead of stripping a localized prefix. - Add a dedicated compact Fluent key per locale (e.g.
ResetsInlineHoursMinutes = {}h {}m/{}时{}分) for the inline reset, keeping the full string for the tooltip. - Add locale-aware suffix stripping for the known forms (
后重置,後重置,後にリセット, ...).
Note: reusing ResetsInShort is not sufficient by itself, since it only contains the "resets" label without the duration.
App version
0.56.8
Windows version
Windows 11 Pro build 26200 (25H2)
Additional context
The compact form is only cosmetic; the underlying reset data is correct. On this machine switching ui_language to english is the current workaround to get the short 4h 59m pill.
Activity
Finesssee commentedon Sep 14, 2026
Hey, thanks for the report. I will fix this ASAP.