8 Commits
Author SHA1 Message Date
lucioandClaude Fable 5 f7cd4fde04 Declare UTF-8 for the stylesheet and served text types
style.css uses non-ASCII glyphs in CSS content (panel arrow, pin). Without a
declared encoding the browser can fall back to Latin-1 for the stylesheet and
render them as mojibake, which happened once in the preview. @charset at the
top of style.css fixes it everywhere; serve.py also sends charset=utf-8 for
html/css/js/json.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-22 11:31:43 -07:00
lucioandClaude Fable 5 472c983287 Commit build outputs via LFS; right-click markers, inline edit box, panel pin
Make a fresh clone servable after `git lfs pull` alone, and rebuildable with
`tools/build.py` without re-rendering unchanged PSDs:

- Track build/ (rendered base PNGs, previews, world composites), web/tiles/,
  web/tiles-trimmed/, web/data/world.json and web/data/markers/. Large PNGs
  and the tile pyramids go through Git LFS (.gitattributes); JSON stays plain.
- build.py: decide PSD re-export from build/<id>/base.stamp.json (PSD size,
  mtime, SHA-256 recorded at export time) instead of file mtimes, which are
  meaningless after an LFS checkout. Same size + new mtime hashes once and
  refreshes the stamp; --stamp-only writes stamps for existing base.pngs.
- Ignore .DS_Store and .env files; track sources/**/*.jpg through LFS.

Viewer:
- Right-click (long-press) the map for a category menu that drops a draft
  marker under the pointer and enters marker edit mode for that map.
- Marker editing moves out of the side panel into a box anchored next to the
  marker: Enter or a left click anywhere else saves, Esc cancels, Delete
  inside the box; drags save position plus the box contents.
- Maps panel expands on hover, header click pins/unpins (status shown in the
  header), unpinned collapses 2 s after the pointer leaves; Overview is the
  first list entry instead of a separate button. Only the panel scrolls; the
  page never grows past the viewport. Hover tooltips render above markers.

Also includes the pending source additions (overall square base, skirt
textures, AI regeneration tooling and notes), service worker, Caddyfile and
map config updates.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-22 09:46:02 -07:00
lucio 234dc32c86 Add editable export workflow and new map sources 2026-08-09 17:04:36 -07:00
lucio bbb4cadddd Add per-map editable markers and backups 2026-08-08 22:03:49 -07:00
lucio e71447da5d Add permanent trims and semantic map layers 2026-08-08 18:47:56 -07:00
lucio 3abdc95500 Add interactive map placement and sizing editor 2026-08-08 16:40:09 -07:00
Claude 6c2bd6d27b Serve tiles with Caddy; fix serve.py falling back to HTTP/1.0
serve.py inherited SimpleHTTPRequestHandler's HTTP/1.0 default, which
closes the socket after every response. A map view pulls ~30 tiles, so
that was ~30 TCP handshakes per pan. Setting HTTP/1.1 more than doubled
loopback throughput on its own.

That still leaves thread-per-connection behind the GIL. Measured over 480
tile requests on reused connections:

  conc  8   serve.py 2,622 req/s p95 4.0ms  |  caddy 6,987 req/s p95 1.9ms
  conc 32   serve.py   462 req/s max 1013ms |  caddy 5,877 req/s max  21ms

serve.py does not merely slow down under load, its throughput falls and
tail latency crosses a second. Caddy stays flat, so it is now the default.

run.ps1 picks Caddy when server/caddy.exe is present and falls back to
serve.py, so a fresh clone still works with nothing installed.
get-caddy.ps1 fetches the binary; it is gitignored.

HTTP/2 is not active: browsers only negotiate h2 over TLS, and trusting a
local CA on every phone is not worth it on a LAN. The gain is Go's I/O.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-08-08 02:20:39 -07:00
Claude 5afde00ab7 Base-map tile pipeline and shared-canvas Leaflet viewer
Extracts only the base map art from re3mr PSDs (the top-level LOCATION
group), tiles it to WebP, and renders every map on one shared world canvas.

Pipeline: psd_tree -> export_base -> tile -> build -> preview, driven
entirely by maps.json. Adding a map is a config change.

Maps are placed on an 8192px grid (tileSize * 2^maxZoom) so a cell's tile
index shift is exactly cell * 2^z at every zoom. Each map keeps its own
locally numbered pyramid and the browser translates on the fly, so adding
a map never re-tiles the others.

excludeLayers works around psd-tools rendering stroke-only vector shapes
as solid fills, which otherwise buries Customs under a white fill.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-08-07 23:22:21 -07:00