Commit Graph
6 Commits
Author SHA1 Message Date
Willie ad34dbde2d fix(server): load the dashboard when opened at a nested route
The build links its files as ./assets/..., so a page reloaded at
/targets/claude asked for /targets/assets/... and got index.html back.
The browser refused the chunks as text/html and the page stayed on its
skeleton. The server now injects a <base> for the base path.
2026-09-27 23:03:21 +08:00
Willie 5aae64539e fix(server): serve SVG icons as images whatever the system says
Go takes a file's type from the Windows registry when it has one, and a
machine whose registry gets .svg wrong was served icons the browser
refused to draw. Only logos too large to inline are files at all, which is
why Antigravity's broke while the rest showed.

Refs #289
2026-09-21 22:23:12 +08:00
Willie f0e164ce9c refactor: simplify base path code after review
- Export NormalizeBasePath and reuse in ui.go (eliminate duplication)
- Use json.Marshal for safe __BASE_PATH__ injection (prevent XSS)
- Always cache index.html at startup (avoid per-request disk reads)
- Extract shared BASE_PATH module in frontend (single source of truth)

Ref: #85
2026-03-18 22:35:02 +08:00
Willie 768c9f4a67 feat(server): inject __BASE_PATH__ into SPA index.html when base path is set
When spaHandlerFromDisk receives a non-empty basePath, it pre-computes
a modified index.html with a <script> tag injecting window.__BASE_PATH__.
This allows the frontend to discover its base path at runtime without
build-time configuration. The injection applies to both direct index.html
requests and SPA fallback routes.
2026-03-18 22:35:02 +08:00
Willie cb9db75dfb fix: improve dev mode placeholder with actionable instructions
Show exact commands (cd ui && pnpm run dev, make ui-dev) instead of
a vague mention of Vite, so developers know how to start the frontend.
2026-02-16 12:29:53 +08:00
Willie 41e822d979 feat: remove go:embed, serve UI exclusively via runtime download
Replace the embedded SPA (go:embed + build tags) with runtime download
from GitHub Releases. The binary no longer bundles UI assets — they are
downloaded on first `skillshare ui` launch and cached at
~/.cache/skillshare/ui/<version>/.

- Delete embed.go / embed_dev.go; add spa_disk.go with placeholder handler
- Simplify ensureUIAvailable(): cache check before dev-mode fallback
- Pre-download UI assets in `skillshare upgrade` (best-effort)
- Remove Node stages from production and CI Dockerfiles
- Keep Node stage in sandbox for playground UI cache pre-population
- Remove ui-embed-check CI job and -tags dev build flag
- Update Makefile, mise.toml, GoReleaser, release workflow
2026-02-16 02:58:22 +08:00