Skip to content

Improved UX and resolved console flashing bug#1

Merged
adi21-dev merged 6 commits into
mainfrom
dev
Jul 4, 2026
Merged

Improved UX and resolved console flashing bug#1
adi21-dev merged 6 commits into
mainfrom
dev

Conversation

@adi21-dev

Copy link
Copy Markdown
Owner

Changed

  • Zero-Friction Portable Workflow: Redesigned the onboarding process by completely removing the setup key requirements. Added a welcoming onboarding screen (Step 0) in the browser before configuring the system.
  • Cloudflare Tunnel Auto-Start: Configured the Cloudflare tunnel to dynamically start immediately upon completing the setup wizard if the user opts in, removing any need for a server restart.
  • User-Friendly Startup Console: Updated the server CLI banner on launch to show a clean box-drawing layout directing the user to press Enter to instantly minimize the window to system tray and open their default browser.

Fixed

  • Windows Console Flashing: Resolved an issue where multiple empty Command Prompt/PowerShell terminal windows flashed on the screen on Windows during startup and periodic background operations (telemetry WMI polling, network/hardware status checks, registry queries, and Cloudflare tunnel spawning) by forcin

Copilot AI review requested due to automatic review settings July 4, 2026 06:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates SysDeck’s first-run and startup experience by removing the setup-key gate, adding a browser “welcome” step to onboarding, auto-starting the Cloudflare relay after setup (when opted in), and reducing Windows console flashing by spawning child processes without creating a new window.

Changes:

  • Frontend: replaced the setup-token gate with a new Welcome step and adjusted the setup step flow.
  • Backend: introduced new_command / new_tokio_command wrappers to spawn child processes silently on Windows, and auto-start the tunnel after setup completion when opted in.
  • Project hygiene/docs: added a Keep-a-Changelog CHANGELOG.md, adjusted CI triggers for dev, and updated README setup documentation.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
README.md Updates onboarding + setup API documentation (currently needs alignment with the new no-setup-key flow).
frontend/src/pages/Setup.tsx Adds Welcome step and updates step indicator / step transitions for the setup wizard.
CHANGELOG.md Introduces a changelog documenting 1.0.0–1.1.0 changes.
backend/tests/common/mod.rs Updates test app state construction after removing setup token from AppState.
backend/src/tunnel.rs Switches tunnel spawning to the new silent tokio command helper.
backend/src/telemetry.rs Uses the silent command helper for PowerShell WMI polling on Windows.
backend/src/setup.rs Prevents password setup after setup completion; auto-starts tunnel after finishing setup when opted in.
backend/src/script.rs Uses silent command helpers for process killing and script execution to prevent console flashing.
backend/src/process.rs Uses silent command helper for taskkill on Windows.
backend/src/power.rs Uses silent command helper for OS power-management commands.
backend/src/network.rs Uses silent command helper for network probing commands (including PowerShell).
backend/src/main.rs Removes setup-key banner and replaces startup console output with a new box-drawing banner + Enter-to-open behavior.
backend/src/lib.rs Removes setup_token from AppState; adds new_command / new_tokio_command helpers; updates registry startup commands to use the helper.
backend/src/hardware.rs Uses silent command helper for PowerShell and shutdown invocations.
.github/workflows/ci.yml Expands CI triggers to include the dev branch.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/src/lib.rs
Comment on lines +91 to 98
pub fn new_tokio_command<S: AsRef<std::ffi::OsStr>>(program: S) -> tokio::process::Command {
let mut cmd = tokio::process::Command::new(program);
#[cfg(target_os = "windows")]
{
cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW
}
cmd
}
Comment thread README.md
Comment on lines +142 to +143
5. Generates a one-time **Setup Key** printed to the console window. This key acts as a security token to verify physical/owner access to the host machine.
6. Opens your browser to the first-run Setup Wizard, where you must enter this Setup Key to unlock configuration steps (admin credentials, TOTP, and remote access relay).
Comment thread README.md
Comment on lines 266 to +268
| POST | `/api/setup/totp` | Generate TOTP secret (step 2) |
| POST | `/api/setup/verify-totp` | Verify TOTP code (step 3) |
| POST | `/api/setup/recovery-codes` | Generate recovery codes (step 4) |
| POST | `/api/setup/relay` | Set Cloudflare relay opt-in (step 4) |
Comment thread backend/src/setup.rs
Comment on lines +92 to +107
let needs_setup = {
let conn = state.db.lock().await;
db::is_setup_complete(&conn).map(|c| !c).unwrap_or(true)
};

if !needs_setup {
tracing::warn!(handler = "api_password_handler", "setup already complete");
return (
StatusCode::BAD_REQUEST,
Json(serde_json::json!({
"success": false,
"error": "Setup is already completed"
})),
)
.into_response();
}
Comment thread backend/src/setup.rs
Comment on lines +313 to +318
if flow.relay_opt_in {
let ts = state.tunnel_state.clone();
tokio::spawn(async move {
let _ = crate::tunnel::TunnelState::start(ts).await;
});
}
Comment thread backend/src/main.rs
Comment on lines +420 to +434
tokio::task::spawn_blocking(move || {
let mut buf = String::new();
// Returns Ok(0) on EOF (stdin closed by FreeConsole) or Ok(n) on Enter.
let _ = std::io::stdin().read_line(&mut buf);

#[cfg(windows)]
{
detach_splash_console();
open_dashboard_once();
}
#[cfg(not(windows))]
{
let _ = open::that(format!("http://localhost:{}", port));
}
});
@adi21-dev
adi21-dev merged commit 8735fd1 into main Jul 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants