feat(examples): polish workout phone UI
Give the workout exemplar a durable gym-floor command-slate direction, serve focused CSS, keep the first viewport centered on one action, and extend the HTTP E2E to verify stylesheet delivery. req: examples/001 req: local/001 req: local/003 req: host/002
This commit is contained in:
@@ -667,8 +667,8 @@ mod tests {
|
||||
let html = render(&WorkoutState::demo()).to_string();
|
||||
assert!(html.contains("Now-first Workout Copilot"));
|
||||
assert!(html.contains("Complete set"));
|
||||
assert!(html.contains("Export via browser/PWA share"));
|
||||
assert!(html.contains("Request native haptic"));
|
||||
assert!(html.contains("Share export"));
|
||||
assert!(html.contains("Haptic"));
|
||||
assert!(!html.contains(&format!("<{}", "script")));
|
||||
assert!(!html.contains("querySelector"));
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ async fn main() {
|
||||
pub fn app(state: AppState) -> Router {
|
||||
Router::new()
|
||||
.route("/", get(page).post(interact))
|
||||
.route("/workout.css", get(workout_css))
|
||||
.route(runtime_js_path(), get(runtime))
|
||||
.with_state(state)
|
||||
}
|
||||
@@ -41,6 +42,13 @@ async fn interact(
|
||||
request.dispatch_async(workout_app::registry(state)).await
|
||||
}
|
||||
|
||||
async fn workout_css() -> impl IntoResponse {
|
||||
(
|
||||
[("content-type", "text/css; charset=utf-8")],
|
||||
include_str!("../templates/workout.css"),
|
||||
)
|
||||
}
|
||||
|
||||
async fn runtime() -> impl IntoResponse {
|
||||
runtime_js()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user