[PR #3637] [MERGED] Launcher: the animated night sky behind every page (redesign R2, draft) #5110

Closed
opened 2026-11-03 05:10:19 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/launcher-night-sky


📝 Commits (2)

  • c0b3b5b Launcher: the night sky behind every page
  • 4bf6577 Merge feat/launcher-night-specimen into feat/launcher-night-sky

📊 Changes

7 files changed (+774 additions, -411 deletions)

View changed files

📝 docs/design-system.md (+3 -1)
📝 launcher/Cargo.toml (+3 -3)
📝 launcher/src/art.rs (+6 -346)
📝 launcher/src/blocks.rs (+0 -24)
📝 launcher/src/main.rs (+57 -33)
➕ launcher/src/sky.rs (+704 -0)
📝 launcher/src/theme.rs (+1 -4)

📄 Description

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

Stacked on #3636 (#3635 merged). Not for merge until Ludovic has seen the screenshots and the
recording. Redesign step R2: the animated pixel backdrop.

What

launcher/src/sky.rs draws the night sky behind every page, replacing the stone texture and Home's
landscape banner (Home's own picture, when the player sets one, still shows under its veil):

  • Sky: the night tokens' six stops in four texel bands each, a stepped gradient with hard pixel
    edges. Plain quads, no image.
  • Stars: a fixed field in the upper half, in four groups that step through four brightness levels.
  • Clouds: three layers of hand-drawn banded sprites (body, lit band, shaded underside) that drift
    2, 4 and 8 px/s, one 4 px texel at a time.
  • Sun and skylines: a sun in three colour bands with its lower half sliced like Horizon's mark,
    and two skylines (a far one with towers and a pine, a near one with trees and posts) on a 6 px grid.
  • Every sprite is ASCII art in the file. Sprites are baked once per appearance and scale into tiles
    whose size doesn't depend on the window, so resizing never re-bakes. Positions snap to device pixels,
    so edges stay crisp at 1x and 2x.
  • Frames only when something changes. The clouds' speeds and the stars' periods put every change
    on a half-second beat, so the sky asks for at most two frames a second, through one timer
    (Launcher::wake_sky). There is no frame loop.
  • Stops: 10 s after the window loses focus (a redraw on activation restarts it where it stopped,
    with no jump); always under macOS reduced motion (NSWorkspace.accessibilityDisplayShouldReduceMotion);
    and with HORIZON_LAUNCHER_MOTION=off. HORIZON_LAUNCHER_MOTION=always keeps it moving unfocused,
    for recordings.
  • Tests:
    • the bands cover the window on whole texels;
    • text without a plate keeps AA on every upper band;
    • the sprites fit their tiles and the skylines repeat without a step;
    • the clock resumes without a jump;
    • every change falls on the beat;
    • a frame is asked for only while moving and in front.
  • Dead code removed: art.rs's stone and landscape (−350 lines) and blocks::stone.

Size: +774 −411. sky.rs is 704 lines, of which about 250 are the hand-drawn sprites and tests.

Screenshots and recording (real launcher, scratch homes, 1280×800 at 1x)

On the Mac mini:

  • ~/builds/horizon/launcher-redesign-1/r2-home-night-1280x800.png
  • ~/builds/horizon/launcher-redesign-1/r2-home-dawn-1280x800.png
  • ~/builds/horizon/launcher-redesign-1/r2-servers-night-1280x800.png
  • ~/builds/horizon/launcher-redesign-1/r2-detail-1x.png (sun and skyline at 1x)
  • ~/builds/horizon/launcher-redesign-1/r2-backdrop-night-20s.mp4 (20 s, 5 fps window captures)

Performance (Mac mini M4 Pro, CPU time of the launcher over 45 s at rest after 15 s; load average 55–110)

Build Idle CPU (% of one core) RSS
main 1.29 / 1.47 / 1.58 120–121 MB
R1 (#3635) 0.47 / 0.49 / 0.51 / 1.29 / 1.56 119–122 MB
R2, sky moving 1.13 / 1.13 121–122 MB
R2, sky still (off) 0.44 / 1.44 / 1.78 121–122 MB
R2, window unfocused > 10 s 0.49 121 MB

Budget (R0): ≤ 2 % of a core while animating, 0 frames hidden or unfocused, memory ≤ today + 20 MB.
Before the half-second beat, the sky changed on its own schedule per layer (about 6–7 frames/s) and
cost 2.1–3.2 %. The beat brought it to 1.13 %.

Self-check

Launcher: cargo fmt --check ✅, cargo clippy --all-targets -- -D warnings ✅, tests ✅ (254 + 48 +
1 + 2). horizon-theme is unchanged from #3635, whose pr_ready block covers the workspace.

Ludovic's answers (2026-10-29)

  1. The style is approved. 2. Near clouds at 8 px/s on the half-second beat: accepted.

🤖 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/3637 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/launcher-night-sky` --- ### 📝 Commits (2) - [`c0b3b5b`](https://github.com/horizon-rust/horizon/commit/c0b3b5b3e9fcab3ecfae6ef045095894ace7a9c2) Launcher: the night sky behind every page - [`4bf6577`](https://github.com/horizon-rust/horizon/commit/4bf65778b60eb0d435002356456b6b00853d9541) Merge feat/launcher-night-specimen into feat/launcher-night-sky ### 📊 Changes **7 files changed** (+774 additions, -411 deletions) <details> <summary>View changed files</summary> 📝 `docs/design-system.md` (+3 -1) 📝 `launcher/Cargo.toml` (+3 -3) 📝 `launcher/src/art.rs` (+6 -346) 📝 `launcher/src/blocks.rs` (+0 -24) 📝 `launcher/src/main.rs` (+57 -33) ➕ `launcher/src/sky.rs` (+704 -0) 📝 `launcher/src/theme.rs` (+1 -4) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. **Stacked on #3636 (#3635 merged).** Not for merge until Ludovic has seen the screenshots and the recording. Redesign step R2: the animated pixel backdrop. ## What `launcher/src/sky.rs` draws the night sky behind every page, replacing the stone texture and Home's landscape banner (Home's own picture, when the player sets one, still shows under its veil): - **Sky:** the night tokens' six stops in four texel bands each, a stepped gradient with hard pixel edges. Plain quads, no image. - **Stars:** a fixed field in the upper half, in four groups that step through four brightness levels. - **Clouds:** three layers of hand-drawn banded sprites (body, lit band, shaded underside) that drift 2, 4 and 8 px/s, one 4 px texel at a time. - **Sun and skylines:** a sun in three colour bands with its lower half sliced like Horizon's mark, and two skylines (a far one with towers and a pine, a near one with trees and posts) on a 6 px grid. - Every sprite is ASCII art in the file. Sprites are baked once per appearance and scale into tiles whose size doesn't depend on the window, so resizing never re-bakes. Positions snap to device pixels, so edges stay crisp at 1x and 2x. - **Frames only when something changes.** The clouds' speeds and the stars' periods put every change on a half-second beat, so the sky asks for at most two frames a second, through one timer (`Launcher::wake_sky`). There is no frame loop. - **Stops:** 10 s after the window loses focus (a redraw on activation restarts it where it stopped, with no jump); always under macOS reduced motion (`NSWorkspace.accessibilityDisplayShouldReduceMotion`); and with `HORIZON_LAUNCHER_MOTION=off`. `HORIZON_LAUNCHER_MOTION=always` keeps it moving unfocused, for recordings. - Tests: - the bands cover the window on whole texels; - text without a plate keeps AA on every upper band; - the sprites fit their tiles and the skylines repeat without a step; - the clock resumes without a jump; - every change falls on the beat; - a frame is asked for only while moving and in front. - Dead code removed: `art.rs`'s stone and landscape (−350 lines) and `blocks::stone`. Size: +774 −411. sky.rs is 704 lines, of which about 250 are the hand-drawn sprites and tests. ## Screenshots and recording (real launcher, scratch homes, 1280×800 at 1x) On the Mac mini: - `~/builds/horizon/launcher-redesign-1/r2-home-night-1280x800.png` - `~/builds/horizon/launcher-redesign-1/r2-home-dawn-1280x800.png` - `~/builds/horizon/launcher-redesign-1/r2-servers-night-1280x800.png` - `~/builds/horizon/launcher-redesign-1/r2-detail-1x.png` (sun and skyline at 1x) - `~/builds/horizon/launcher-redesign-1/r2-backdrop-night-20s.mp4` (20 s, 5 fps window captures) ## Performance (Mac mini M4 Pro, CPU time of the launcher over 45 s at rest after 15 s; load average 55–110) | Build | Idle CPU (% of one core) | RSS | |---|---|---| | main | 1.29 / 1.47 / 1.58 | 120–121 MB | | R1 (#3635) | 0.47 / 0.49 / 0.51 / 1.29 / 1.56 | 119–122 MB | | **R2, sky moving** | **1.13 / 1.13** | 121–122 MB | | R2, sky still (`off`) | 0.44 / 1.44 / 1.78 | 121–122 MB | | R2, window unfocused > 10 s | 0.49 | 121 MB | Budget (R0): ≤ 2 % of a core while animating, 0 frames hidden or unfocused, memory ≤ today + 20 MB. Before the half-second beat, the sky changed on its own schedule per layer (about 6–7 frames/s) and cost 2.1–3.2 %. The beat brought it to 1.13 %. ## Self-check Launcher: `cargo fmt --check` ✅, `cargo clippy --all-targets -- -D warnings` ✅, tests ✅ (254 + 48 + 1 + 2). horizon-theme is unchanged from #3635, whose pr_ready block covers the workspace. ## Ludovic's answers (2026-10-29) 1. The style is approved. 2. Near clouds at 8 px/s on the half-second beat: accepted. 🤖 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 05:10:19 +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#5110
No description provided.