From cbee99b4617044d464293a4e7440fc14dc59f4cd Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Fri, 25 Sep 2026 17:08:36 -0700 Subject: [PATCH] prompt: keep login buttons from reviving beside a late-arriving handle When the session landed after the prompt booted, the logged-out Login / signup pair was only disabled once the profile button appeared, and activated() / setTheme() re-enabled it on the next focus change, drawing all three buttons on top of each other. Drop the pair on late arrival and route every curtain toggle through one helper where the profile wins. Co-Authored-By: Claude Fable 5.1 --- .../aesthetic.computer/disks/prompt.mjs | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/system/public/aesthetic.computer/disks/prompt.mjs b/system/public/aesthetic.computer/disks/prompt.mjs index 66c4533465..369de3007e 100644 --- a/system/public/aesthetic.computer/disks/prompt.mjs +++ b/system/public/aesthetic.computer/disks/prompt.mjs @@ -8055,10 +8055,15 @@ function sim($) { } }); - if (login) login.btn.disabled = true; - if (signup) signup.btn.disabled = true; + // The session landed after boot: the logged-out buttons were built for a + // user we did not know yet. Drop them (not just disable them) so nothing + // in `activated` or `setTheme` can revive them beside the handle. + login = undefined; + signup = undefined; delete $.store["handle:received"]; profileAction = "profile"; + // Match whatever curtain state the prompt is in right now. + profile.btn.disabled = $.system.prompt.input.canType || theme !== "default"; $.needsPaint(); } @@ -9155,13 +9160,24 @@ function activated($, state) { } // console.log(state, firstCommandSent) // if (state === false && firstCommandSent) return; - const hideCurtain = theme !== "default"; - if (login) login.btn.disabled = state || hideCurtain; - if (signup) signup.btn.disabled = state || hideCurtain; - if (profile) profile.btn.disabled = state || hideCurtain; + setCurtainButtons(state || theme !== "default"); if (chatTickerButton) chatTickerButton.disabled = state; } +// Enable or disable the curtain's buttons. The profile button (a logged-in +// user) always wins over the login / signup pair, so a session that lands +// after boot can never show both sets at once. +function setCurtainButtons(disabled) { + if (profile) { + profile.btn.disabled = disabled; + if (login) login.btn.disabled = true; + if (signup) signup.btn.disabled = true; + return; + } + if (login) login.btn.disabled = disabled; + if (signup) signup.btn.disabled = disabled; +} + // 💬 Receive each response in full. function reply(text) { // firstCommandSent = true; @@ -9451,10 +9467,7 @@ function setTheme(newTheme, $) { $["store"]["prompt:theme"] = theme; $["store"].persist?.("prompt:theme"); } - const hideCurtain = theme !== "default"; - if (login) login.btn.disabled = hideCurtain; - if (signup) signup.btn.disabled = hideCurtain; - if (profile) profile.btn.disabled = hideCurtain; + setCurtainButtons(theme !== "default"); } async function makeMotd({ system, needsPaint, handle, user, net, api, notice }) { -- 2.51.2