diff --git a/CHANGELOG.md b/CHANGELOG.md index d2e7e00..d3d2167 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -- No unreleased changes. +- Changed the HotView HMR host from loopback-only `127.0.0.1` to the detected Tailscale IPv4 address, with a `VITE_HMR_HOST` override for other private intranet addresses. ## 0.1.34 - 2026-07-15 @@ -10,7 +10,7 @@ - Made map and audio Bible resources optional, collapsible, session-aware, and skipped when disabled. - Added current-session and new-session switches for contextual maps and KJV audio Bible. - Surfaced Strong's pronunciation metadata in the definition panel when the lexicon package provides it. -- Pinned the Vite HMR websocket host to `127.0.0.1` so the active HotView tab can receive updates when opened on that address. +- Configured the Vite HMR websocket for the active HotView tab. - Documented the current resource behavior and the remaining blocker for licensed pronunciation audio packages. ## 0.1.33 - 2026-07-15 diff --git a/docs/study-resource-depth.md b/docs/study-resource-depth.md index 3050395..2cd1410 100644 --- a/docs/study-resource-depth.md +++ b/docs/study-resource-depth.md @@ -26,7 +26,7 @@ Maps and audio are first-class session resources now. Existing and new sessions Disabled maps and audio do not load their package data in the background. The map and audio cards also persist collapsed state through the shared study settings snapshot. -HotView is expected to run on `127.0.0.1:5174` in the active local loop. Vite's HMR websocket is pinned to that host so live updates keep flowing when the browser tab uses the same address. +HotView is expected to run on port `5174` in the active local loop. Open it from connected machines at `http://desktop:5174/`. Vite's HMR websocket defaults to the machine's Tailscale IPv4 address when available, which avoids ambiguous local hostname records while keeping the dev loop on the private Tailnet/local intranet. This is a private development path, not a public internet deployment. If a device needs a different reachable address, start HotView with `VITE_HMR_HOST` set to that address. ## Pronunciation Boundary diff --git a/vite.config.ts b/vite.config.ts index 9cc79ee..060d969 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,5 +1,13 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' +import { networkInterfaces } from 'node:os' + +function tailscaleHost() { + const addresses = networkInterfaces().Tailscale ?? [] + return addresses.find((address) => address.family === 'IPv4' && !address.internal)?.address +} + +const hmrHost = process.env.VITE_HMR_HOST?.trim() || tailscaleHost() || 'desktop' // https://vite.dev/config/ export default defineConfig({ @@ -7,7 +15,7 @@ export default defineConfig({ server: { allowedHosts: ['desktop'], hmr: { - host: '127.0.0.1', + host: hmrHost, protocol: 'ws', }, fs: {