feat(phase-14): htmx shareable web client — server-rendered optimizer UI#20
Merged
Conversation
Phase 14 adds a minimal, dependency-free server-rendered web client
that drives the optimizer through plain HTML + htmx attributes. The
point is shareable result links: every run lands at /htmx/run/{rid}
and that URL can be sent to anyone with network access to the API.
Routes (registered in create_app, unauthenticated by design — synthetic
terrain only, no DEM upload, no project leakage):
GET / landing page (length, seed, system, generations)
POST /htmx/run run synthetic optimize, return HTML fragment
with metrics + a permanent run link
GET /htmx/run/{rid} shareable read-only view of a stored run
The implementation is a single ~200 line module (src/ropeway/server/htmx.py)
with no template engine — inline HTML strings with a small CSS block,
htmx attributes for the form post + result swap. Runs are stored in
process memory; the link is valid for the lifetime of the server.
The authenticated FastAPI surface (/auth, /projects, /optimize/dem) is
untouched.
Tests: 5 new in tests/test_server_htmx.py (landing form, run returns
metrics + permalink, unknown system 400, share link returns stored run,
unknown rid 404). Suite 157 → 162.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 14 adds a minimal, dependency-free server-rendered web client that drives the optimizer through plain HTML + htmx attributes. The point is shareable result links: every run lands at
/htmx/run/{rid}and that URL can be sent to anyone with network access to the API.Routes
Registered in
create_app, unauthenticated by design — synthetic terrain only, no DEM upload, no project leakage://htmx/run/htmx/run/{rid}Implementation
Single ~200-line module (
src/ropeway/server/htmx.py):hx-post,hx-target,hx-swap,hx-indicator)The authenticated FastAPI surface (
/auth,/projects,/optimize/dem) is untouched.Test plan
tests/test_server_htmx.py— 5 new tests: landing form, run returns metrics + permalink, unknown system 400, share link returns stored run, unknown rid 404test_server_api.py/test_server_phase95.pyall green — the existing API surface is unchanged