[PR #2597] [MERGED] Launcher: play time per instance #4459

Closed
opened 2026-11-03 04:17:18 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2597
Author: @ludovic111
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: feat/launcher-play-time


📝 Commits (1)

  • ea0cc65 Launcher: play time per instance

📊 Changes

7 files changed (+150 additions, -12 deletions)

View changed files

📝 launcher/README.md (+5 -3)
📝 launcher/src/cli.rs (+13 -3)
📝 launcher/src/instances.rs (+47 -0)
📝 launcher/src/instances/tests.rs (+34 -0)
📝 launcher/src/instances_page.rs (+25 -1)
📝 launcher/src/main.rs (+25 -4)
📝 launcher/src/worlds_page.rs (+1 -1)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Clean room: designed from the feature list in briefs/launcher-features-1.md; no other launcher's code, docs or assets were read.

Item 5 of the launcher features. Stacked on #2596 (quick play).

What

  • Every run of the game started from the window or horizon-launcher play adds its length to its instance's play time, with when it ended. Kept in the launcher's instances.json beside the name and icon (played_secs, last_played in seconds since 1970), by instance id, so renaming keeps it. A pack's own Play button counts for that pack's instance. Nothing is written for an instance never played.
  • Home's Instance row: "3 h 06 min in total · last played today" (or "Not played yet").
  • horizon-launcher instance list shows "3 h 06 min played"; --json gives played_secs and last_played_ms. Runs an agent starts through MCP play don't count: they aren't the player playing.

Screenshot

The row after a run of the stand-in game (65 s) on top of 3 h 05 min (the json went 11100 → 11165 s):
play time

Proof

  • cargo fmt --check, cargo clippy --all-targets --locked --features gpui/runtime_shaders -- -D warnings: clean.
  • cargo test --locked --lib: 150 passed (2 new: time adds up per instance and survives a rename, never-played instances get no entry; minutes/hours wording). --bin horizon-launcher: 35 passed.
  • By hand in scratch homes: horizon-launcher play then instance list → "under a minute played"; the window's Play → 11165 s recorded and the row updated when the game exited.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2597 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/launcher-play-time` --- ### 📝 Commits (1) - [`ea0cc65`](https://github.com/horizon-rust/horizon/commit/ea0cc65aea9a682810358fb888a03a8d784fdd55) Launcher: play time per instance ### 📊 Changes **7 files changed** (+150 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `launcher/README.md` (+5 -3) 📝 `launcher/src/cli.rs` (+13 -3) 📝 `launcher/src/instances.rs` (+47 -0) 📝 `launcher/src/instances/tests.rs` (+34 -0) 📝 `launcher/src/instances_page.rs` (+25 -1) 📝 `launcher/src/main.rs` (+25 -4) 📝 `launcher/src/worlds_page.rs` (+1 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Clean room: designed from the feature list in briefs/launcher-features-1.md; no other launcher's code, docs or assets were read. Item 5 of the launcher features. Stacked on #2596 (quick play). ## What - Every run of the game started from the window or `horizon-launcher play` adds its length to its instance's play time, with when it ended. Kept in the launcher's `instances.json` beside the name and icon (`played_secs`, `last_played` in seconds since 1970), by instance id, so renaming keeps it. A pack's own Play button counts for that pack's instance. Nothing is written for an instance never played. - Home's Instance row: "3 h 06 min in total · last played today" (or "Not played yet"). - `horizon-launcher instance list` shows "3 h 06 min played"; `--json` gives `played_secs` and `last_played_ms`. Runs an agent starts through MCP `play` don't count: they aren't the player playing. ## Screenshot The row after a run of the stand-in game (65 s) on top of 3 h 05 min (the json went 11100 → 11165 s): ![play time](https://raw.githubusercontent.com/ludovic111/horizon/screenshots/launcher-features/item-05-play-time/after.png) ## Proof - `cargo fmt --check`, `cargo clippy --all-targets --locked --features gpui/runtime_shaders -- -D warnings`: clean. - `cargo test --locked --lib`: 150 passed (2 new: time adds up per instance and survives a rename, never-played instances get no entry; minutes/hours wording). `--bin horizon-launcher`: 35 passed. - By hand in scratch homes: `horizon-launcher play` then `instance list` → "under a minute played"; the window's Play → 11165 s recorded and the row updated when the game exited. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:17:18 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4459
No description provided.