feat(desktop): show the Steam shell version beside the game version - #4898
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe client retrieves an optional desktop-shell version, handles unavailable or delayed bridges, and appends the normalized Steam version to the application version during initialization. Tests cover formatting, bridge failures, successful retrieval, timeouts, and cleanup. ChangesDesktop-shell version display
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Main
participant DesktopShell
participant openfrontDesktop
Main->>DesktopShell: await desktopVersion()
DesktopShell->>openfrontDesktop: request version()
openfrontDesktop-->>DesktopShell: version or null
DesktopShell-->>Main: composeVersionDisplay()
Main-->>Main: render version label
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/client/DesktopShell.ts`:
- Line 56: Update the version-label construction in DesktopShell to pass the
user-visible “Steam” label through translateText(), and add the corresponding
translation key to the localization resources before Main.ts uses this value for
the navigation bar.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2d594773-7a37-4b52-b262-3a43a2e035f8
📒 Files selected for processing (3)
src/client/DesktopShell.tssrc/client/Main.tstests/DesktopShell.test.ts
| const trimmed = shellVersion.trim(); | ||
| if (trimmed === "") return gameVersion; | ||
| const withV = trimmed.startsWith("v") ? trimmed : `v${trimmed}`; | ||
| return `${gameVersion} (Steam ${withV})`; |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Localize the Steam label.
Steam is user-visible text. Pass the label through translateText() and add the required translation key before Main.ts assigns this value to the navigation bar.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/client/DesktopShell.ts` at line 56, Update the version-label construction
in DesktopShell to pass the user-visible “Steam” label through translateText(),
and add the corresponding translation key to the localization resources before
Main.ts uses this value for the navigation bar.
Source: Coding guidelines
What
When the client runs inside the Electron desktop shell, the nav-bar version label gains the shell's own version as subtext:
In a browser it stays exactly
v0.33.1, unchanged.Why
The desktop shell ships on Steam as a wrapper around a pinned build of this client, so a player is running two versioned things at once. Today the UI shows only the game version, which means "which version are you on?" is unanswerable for a Steam player — the same game version can correspond to several shell builds with different Electron/Steamworks behaviour, and bug reports can't distinguish them.
The game version stays primary deliberately, so a player's version reads the same across web and Steam. The shell version rides alongside rather than replacing it.
How
DesktopShell.tsgains two functions:composeVersionDisplay(), a pure formatter, anddesktopVersion(), which readswindow.openfrontDesktop.version()from the shell's contextBridge.Main.tscomposes the two where it already sets#game-version/.game-version-display.The bridge is narrowed locally, following the existing pattern in
SteamSDK.ts, rather than adding a seconddeclare global(which would trigger TS2717).Browser safety
The web client is unaffected. With no
window.openfrontDesktop,desktopVersion()short-circuits before doing any work and returnsnull, andcomposeVersionDisplay(v, null)returnsvunchanged. Covered by tests.The one thing worth a reviewer's attention: this adds an
awaitintoinitialize(), whichMain.tscalls fire-and-forget, ahead of thejoin-lobby/leave-lobby/kick-playerlistener registrations. A bridge call that hung would therefore have stalled the main menu with nothing logged. It's bounded with a 500 msPromise.raceso the worst case is that the cosmetic subtext is dropped. A version label must never be able to take the menu down.Tests
tests/DesktopShell.test.ts— 9 tests covering the formatter (including that a shell version already carrying avisn't doubled) and the bridge: no bridge, bridge without aversionmethod, a rejecting call, a resolving call, and a never-settling call that resolvesnullvia the timeout under fake timers.Full suite passes (2702), lint and
prettier --checkclean.