Skip to content

feat(desktop): show the Steam shell version beside the game version - #4898

Merged
evanpelle merged 3 commits into
mainfrom
steam-shell-version
Aug 6, 2026
Merged

feat(desktop): show the Steam shell version beside the game version#4898
evanpelle merged 3 commits into
mainfrom
steam-shell-version

Conversation

@Celant

@Celant Celant commented Aug 6, 2026

Copy link
Copy Markdown
Member

What

When the client runs inside the Electron desktop shell, the nav-bar version label gains the shell's own version as subtext:

v0.33.1 (Steam v0.2.0)

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.ts gains two functions: composeVersionDisplay(), a pure formatter, and desktopVersion(), which reads window.openfrontDesktop.version() from the shell's contextBridge.
  • Main.ts composes 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 second declare global (which would trigger TS2717).

Browser safety

The web client is unaffected. With no window.openfrontDesktop, desktopVersion() short-circuits before doing any work and returns null, and composeVersionDisplay(v, null) returns v unchanged. Covered by tests.

The one thing worth a reviewer's attention: this adds an await into initialize(), which Main.ts calls fire-and-forget, ahead of the join-lobby / leave-lobby / kick-player listener registrations. A bridge call that hung would therefore have stalled the main menu with nothing logged. It's bounded with a 500 ms Promise.race so 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 a v isn't doubled) and the bridge: no bridge, bridge without a version method, a rejecting call, a resolving call, and a never-settling call that resolves null via the timeout under fake timers.

Full suite passes (2702), lint and prettier --check clean.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d8503b4c-0a79-4641-8b92-bbbf6bb421c0

📥 Commits

Reviewing files that changed from the base of the PR and between 8361dfb and a9ef9bc.

📒 Files selected for processing (1)
  • src/client/Main.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/client/Main.ts

Walkthrough

The 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.

Changes

Desktop-shell version display

Layer / File(s) Summary
Version retrieval and display contract
src/client/DesktopShell.ts
Adds desktopVersion() with rejection and 500 ms timeout handling. Adds composeVersionDisplay() for normalized Steam version text.
Initialization integration and validation
src/client/Main.ts, tests/DesktopShell.test.ts
Main initialization uses the composed version. Tests cover formatting, bridge outcomes, timeout fallback, and cleanup.

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
Loading

Possibly related PRs

Poem

A shell version crosses the bridge,
The game version keeps its place.
A timeout guards the waiting path,
Steam adds a trimmed display trace.
Tests watch each result with care.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes adding the Steam shell version beside the game version.
Description check ✅ Passed The description directly explains the version display change, implementation, safety behavior, and tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between be2a84f and 8361dfb.

📒 Files selected for processing (3)
  • src/client/DesktopShell.ts
  • src/client/Main.ts
  • tests/DesktopShell.test.ts

const trimmed = shellVersion.trim();
if (trimmed === "") return gameVersion;
const withV = trimmed.startsWith("v") ? trimmed : `v${trimmed}`;
return `${gameVersion} (Steam ${withV})`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 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

@github-project-automation github-project-automation Bot moved this from Triage to Development in OpenFront Release Management Aug 6, 2026
@evanpelle evanpelle added this to the v34 milestone Aug 6, 2026
@evanpelle
evanpelle merged commit 5476bf9 into main Aug 6, 2026
9 of 12 checks passed
@evanpelle
evanpelle deleted the steam-shell-version branch August 6, 2026 23:35
@github-project-automation github-project-automation Bot moved this from Development to Complete in OpenFront Release Management Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

2 participants