fix: font measurement race + updater download URL mismatch
All checks were successful
Build & Sign Wraith / Build Windows + Sign (push) Successful in 1m7s
All checks were successful
Build & Sign Wraith / Build Windows + Sign (push) Successful in 1m7s
Two fixes:
1. Terminal font rendering: xterm.js was calling fitAddon.fit() before
fonts loaded. canvas.measureText() used a fallback font, got wrong
cell dimensions (2-3px per char instead of 8-9px), producing 200+
column terminals where text appeared as tiny dashes with colored
blocks. Fixed by waiting for document.fonts.ready before fitting.
Also prioritized Windows-native fonts (Cascadia Mono, Consolas)
in the font stack.
2. Updater download URL: tagVersion used raw release.TagName ("v0.8.3")
but CI uploads packages under stripped version ("0.8.3"). Download
URL was .../v0.8.3/wraith-v0.8.3-setup.exe but the actual package
is at .../0.8.3/wraith-0.8.3-setup.exe. Now uses latestVer (stripped).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c3beb6df6b
commit
de0fd0556c
@ -58,7 +58,7 @@ export function useTerminal(sessionId: string): UseTerminalReturn {
|
||||
|
||||
const terminal = new Terminal({
|
||||
theme: defaultTheme,
|
||||
fontFamily: "'JetBrains Mono', 'Cascadia Code', 'Fira Code', Menlo, Monaco, monospace",
|
||||
fontFamily: "'Cascadia Mono', 'Cascadia Code', Consolas, 'JetBrains Mono', 'Fira Code', Menlo, Monaco, 'Courier New', monospace",
|
||||
fontSize: 14,
|
||||
lineHeight: 1.2,
|
||||
cursorBlink: true,
|
||||
@ -138,7 +138,14 @@ export function useTerminal(sessionId: string): UseTerminalReturn {
|
||||
|
||||
function mount(container: HTMLElement): void {
|
||||
terminal.open(container);
|
||||
fitAddon.fit();
|
||||
|
||||
// Wait for fonts to load before measuring cell dimensions.
|
||||
// If the font (JetBrains Mono etc.) isn't loaded when fitAddon.fit()
|
||||
// runs, canvas.measureText() uses a fallback font and gets wrong
|
||||
// cell widths — producing tiny dashes and 200+ column terminals.
|
||||
document.fonts.ready.then(() => {
|
||||
fitAddon.fit();
|
||||
});
|
||||
|
||||
// Right-click paste on the terminal's DOM element
|
||||
terminal.element?.addEventListener("contextmenu", handleRightClickPaste);
|
||||
|
||||
@ -133,7 +133,8 @@ func (u *UpdateService) CheckForUpdate() (*UpdateInfo, error) {
|
||||
}
|
||||
|
||||
// Newer version is available — fetch version.json for SHA256 + download URL.
|
||||
tagVersion := release.TagName // e.g. "v0.6.0" or "0.6.0"
|
||||
// Use the stripped version (no "v" prefix) because CI uploads packages under "0.8.3" not "v0.8.3"
|
||||
tagVersion := latestVer
|
||||
versionInfoURL := fmt.Sprintf(
|
||||
"%s/api/packages/%s/generic/%s/%s/version.json",
|
||||
u.baseURL, u.owner, u.pkg, tagVersion,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user