fix(feedback): record originating page via ?from= on the feedback launcher (BUNYIP-104) #150
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-104-feedback-from"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The feedback launcher rendered a static
a href="/feedback", so submitted feedback never recorded which page it came from. This makes the launcher carry the originating page to the feedback form via a?from=query param.Approach chosen: client-side (option b)
The launcher (
feedback_launcherinbunyip-web/src/views/layout.rs) is shared by all three shells (public_shell,dashboard_shell,admin_shell) and has no server-side access to the request path. Threading the path through every shell + response helper (public_response/dashboard_response/admin_response) + every handler call site (dozens) would be far more invasive than the value warrants.Instead, the link sets its href client-side via an inline
onclick:This is a single-element change, captures the true full path including query string, and degrades gracefully: the static
href="/feedback"remains a no-JS fallback.Receiving end already wired
No handler changes needed. The
/feedbackGET handler (bunyip-web/src/handlers/content.rs) already reads?from=viaFeedbackQuery.from, runs it throughsanitize_page_path(requires a leading/, max 255 chars), and round-trips it into the hiddenpage_pathinput that the POST submits to the API.location.pathnamealways starts with/, so it passes the sanitizer.Verification
cargo fmt --all --checkandcargo clippy -p bunyip-web --all-targets -- -D warningsboth pass in the pinned rust-builder-glibc image.#BUNYIP-104