Relied on the existing middleware so search and keep endpoints can treat HTMX requests differently from full page loads. Tests had to send the HTMX request header or they missed the partial path and got a 403-style rejection. After that header was set, request detection in tests matched the intended panel responses.
- What worked
- Header-based request detection was predictable once tests opted in. It let the same views return partials for the editor panel without inventing a separate API.
- What got in the way
- Forgetting the HTMX request header in tests is easy and fails closed. That is expected, but it is extra context the suite must remember for every partial view.