Skip to content

Enhance Local Server Discovery UI & Mobile Testing Flow#14

Open
RZDESIGN wants to merge 1 commit intohytopiagg:mainfrom
RZDESIGN:developer-login-ui-ux-enhancement
Open

Enhance Local Server Discovery UI & Mobile Testing Flow#14
RZDESIGN wants to merge 1 commit intohytopiagg:mainfrom
RZDESIGN:developer-login-ui-ux-enhancement

Conversation

@RZDESIGN
Copy link
Copy Markdown

@RZDESIGN RZDESIGN commented Mar 4, 2026

Summary

This PR significantly improves the local development experience by overhauling the "Connect to Server" modal. It introduces automatic local server discovery, a polished HYTOPIA-branded UI, and a seamless QR code flow to make testing local dev servers on mobile devices effortless.

Changes

  • Auto-Discovery & QR Codes:
    • Added a /__hytopia/local-ip endpoint to the Vite dev server to reliably auto-detect the developer's LAN IP.
    • The server health check (/) now also returns local network addresses.
    • Automatically generates a QR code pointing to hytopia.com/play/?join=... (mapping the private IP to our cert-compatible wildcard hostname) so developers can instantly join their local server from a phone or tablet.
  • UI/UX Polish:
    • Replaced the basic prompt and error alerts with a smooth, multi-state modal (Searching → Found → Manual Entry).
    • Added a HYTOPIA-gradient loading spinner while searching for local servers.
    • Implemented a persistent, pulsing gradient glow anchored to the bottom of the viewport.
    • Added the HYTOPIA square logo to the overlay.
    • Styled the "SERVER FOUND / LET'S PLAY" headers with custom gradient text.
    • Created a glowing, hovering "Play" button for desktop connections.
    • Added smooth CSS fade/slide-in animations (hytopia-fade-in-up) for state transitions.
  • Graceful Error Handling:
    • Replaced the abrupt "Could not connect" alert popup with a seamless transition back to the "Looking for local server" spinner.
    • If the server disconnects mid-game, the client intelligently drops the ?join= param and returns to the glowing search state instead of getting stuck in a refresh loop.
  • Dependencies: Added qrcode and @types/qrcode for canvas-based QR generation.

Test Plan

  • Run npm run dev in the client and hytopia start for the server.
  • Verify the initial state shows the gradient loading spinner.
  • Verify the modal smoothly transitions to the "SERVER FOUND" view once the server is healthy.
  • Scan the QR code with a mobile device on the same Wi-Fi network and confirm it successfully connects to the local dev server.
  • Stop the local server while the "Found" modal is open, and verify it gracefully falls back to the searching spinner.
  • Connect to the server, then kill the server. Verify the page reloads and drops you cleanly back into the search spinner.
  • Click "Other address" and ensure the manual IP fallback works and correctly maps raw IPs to the *.dns-is-boring... hostname.

…nt in Vite config, improved modal prompts for server connection with QR code support, and updated styles for modals and QR components. Updated package dependencies including QR code libraries.
@RZDESIGN
Copy link
Copy Markdown
Author

RZDESIGN commented Mar 4, 2026

Schermopname.2026-03-04.om.22.08.32.mp4

@web3dev1337
Copy link
Copy Markdown

Noting #5 has a similar use, so should be compared for best solution

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