From b0783dac38d9fa238ecd2a38aadc0049936506a2 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Mon, 26 Oct 2026 22:54:33 +0100 Subject: [PATCH 1/2] launcher: Sculk's banner at the foot of the sidebar, seen without scrolling On Home it sat under every row, so nobody saw it without scrolling. It now sits small (228 px wide) above the Discord and Website links on every page but Servers, which keeps the large one. Co-Authored-By: Claude Opus 5.5 --- launcher/src/main.rs | 8 ++++++-- launcher/src/partner.rs | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/launcher/src/main.rs b/launcher/src/main.rs index 50e62756d..9438f1af0 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -1749,6 +1749,11 @@ impl Launcher { } _ => {} } + // Sculk's banner, small, above the links: seen without scrolling, on every page but Servers, which + // shows it large. + if self.page != Page::Servers { + foot = foot.child(partner::banner("partner-side", theme::SIDEBAR - 20., &t).mb(px(8.))); + } if !self.links.discord.is_empty() { foot = foot.child(link( "discord", @@ -2131,8 +2136,7 @@ impl Launcher { if let Some(crash) = self.crash.clone() { page = page.child(self.crash_notice(crash, cx)); } - // Below everything the player needs to start, so it never moves Play. - page.child(partner::banner("partner-home", 560., &t)) + page } /// "Horizon crashed": the report and the logs, and where to report it. diff --git a/launcher/src/partner.rs b/launcher/src/partner.rs index eea1a3524..5e1cdb695 100644 --- a/launcher/src/partner.rs +++ b/launcher/src/partner.rs @@ -1,5 +1,5 @@ -//! Sculk's banner: a server host that sponsors Horizon (Ludovic, 2026-10-26), on the Servers page -//! and under Home's rows. The picture is in the binary, never fetched; a click opens Sculk's page in +//! Sculk's banner: a server host that sponsors Horizon (Ludovic, 2026-10-26), large on the Servers page +//! and small at the foot of the sidebar on the other pages, where it shows without scrolling. The picture is in the binary, never fetched; a click opens Sculk's page in //! the browser. A "Partner" label above it says it is an ad. use crate::theme::Theme; use gpui::{div, img, prelude::*, px, ClickEvent, Div, Image, ImageFormat, Stateful}; @@ -19,7 +19,7 @@ static BANNER: LazyLock> = LazyLock::new(|| { }); /// The banner `width` logical pixels wide, under its label. Hovering lifts it a little and turns the -/// label to ink. The narrowest window (960) leaves the page 648 pixels, so it always fits. +/// label to ink. The narrowest window (960) leaves the page 648 pixels, so the Servers one always fits. pub fn banner(id: &'static str, width: f32, t: &Theme) -> Stateful
{ let t = *t; let el = div() From 12bf15cfd7658e118b29a1f695f64554b140168f Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Mon, 26 Oct 2026 22:58:09 +0100 Subject: [PATCH 2/2] launcher: the sidebar's partner banner can be hidden once it has been seen A "Hide" shows beside its label after the banner has been on screen for 3 minutes, counted over every start (settings: partner_seen_secs, saved each minute). Hiding it is kept (partner_hidden); the Servers page keeps its own banner. Co-Authored-By: Claude Opus 5.5 --- launcher/src/backend.rs | 7 +++++ launcher/src/main.rs | 57 ++++++++++++++++++++++++++++++++++++++--- launcher/src/partner.rs | 4 +++ 3 files changed, 65 insertions(+), 3 deletions(-) diff --git a/launcher/src/backend.rs b/launcher/src/backend.rs index 85818a67c..55a78193a 100644 --- a/launcher/src/backend.rs +++ b/launcher/src/backend.rs @@ -2545,6 +2545,13 @@ pub struct Settings { /// first-run question, or on the Play page once if they answered that before it existed. #[serde(default)] pub ping_notice_seen: bool, + /// Seconds the sidebar's partner banner has been on screen, over every start, up to + /// `partner::SEEN_BEFORE_HIDE`: only then can the player hide it. + #[serde(default)] + pub partner_seen_secs: u64, + /// The player hid the sidebar's partner banner. The Servers page keeps its own. + #[serde(default)] + pub partner_hidden: bool, } impl Settings { diff --git a/launcher/src/main.rs b/launcher/src/main.rs index 9438f1af0..7cc6d0ccd 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -248,6 +248,32 @@ impl Launcher { } }) .detach(); + // Counts the time the sidebar's partner banner is on screen, until it may be hidden. + cx.spawn(async move |this, cx| loop { + cx.background_executor() + .timer(Duration::from_secs(10)) + .await; + let counting = this.update(cx, |this, cx| { + let s = &mut this.settings; + if s.partner_hidden || s.partner_seen_secs >= partner::SEEN_BEFORE_HIDE { + return false; + } + if this.page != Page::Servers { + s.partner_seen_secs += 10; + if s.partner_seen_secs % 60 == 0 + || s.partner_seen_secs >= partner::SEEN_BEFORE_HIDE + { + s.save(); + cx.notify(); + } + } + true + }); + if !matches!(counting, Ok(true)) { + break; + } + }) + .detach(); let mut settings = Settings::load(); if settings.minecraft_dir.is_none() { settings.minecraft_dir = backend::default_minecraft_dir(); @@ -1750,9 +1776,34 @@ impl Launcher { _ => {} } // Sculk's banner, small, above the links: seen without scrolling, on every page but Servers, which - // shows it large. - if self.page != Page::Servers { - foot = foot.child(partner::banner("partner-side", theme::SIDEBAR - 20., &t).mb(px(8.))); + // shows it large. After a while on screen a "Hide" beside its label puts it away for good. + if self.page != Page::Servers && !self.settings.partner_hidden { + let mut side = div().relative().mb(px(8.)).child(partner::banner( + "partner-side", + theme::SIDEBAR - 20., + &t, + )); + if self.settings.partner_seen_secs >= partner::SEEN_BEFORE_HIDE { + let hide = div() + .id("partner-hide") + .absolute() + .top(px(0.)) + .right(px(0.)) + .cursor_pointer() + .child( + text(theme::MICRO) + .text_color(t.muted) + .hover(move |s| s.text_color(t.ink)) + .child("HIDE"), + ) + .on_click(cx.listener(|this, _: &ClickEvent, _, cx| { + this.settings.partner_hidden = true; + this.settings.save(); + cx.notify(); + })); + side = side.child(keyboard(hide, &t)); + } + foot = foot.child(side); } if !self.links.discord.is_empty() { foot = foot.child(link( diff --git a/launcher/src/partner.rs b/launcher/src/partner.rs index 5e1cdb695..c4feac7b8 100644 --- a/launcher/src/partner.rs +++ b/launcher/src/partner.rs @@ -7,6 +7,10 @@ use std::sync::{Arc, LazyLock}; pub const URL: &str = "https://my.sculkhosting.com/ref/horizon"; +/// How long the sidebar's banner stays on screen, counted over every start, before a "Hide" shows +/// beside its label: long enough to be seen, then the player may put it away for good. +pub const SEEN_BEFORE_HIDE: u64 = 180; + /// 1200×441: twice the widest it is shown at, for Retina screens. Its transparent edges let the /// characters stand out of the card. const WIDTH: f32 = 1200.;