fix(ui): stop the pages being cached, and the labels duplicating
Firefox served a cached copy of the brewing page after the advice became a button and a pop-out, so the phone kept showing the old inline advice - a long paragraph in the table cell, with the button label reading "Read the adviceAdvice". Two separate causes: The pages had no cache headers, so Firefox was free to reuse them. They now send Cache-Control: no-store, must-revalidate. The rule that hides the short label was scoped to `table.data .short`, so it did not apply to the advice button's label. A stale stylesheet then showed both forms at once. The rule is now on `.short` alone, so it applies wherever the pattern is used - a table heading, the advice button, the Active Beers page - and only ever one form can show. Verified at 390px and 1280px: the phone shows "Advice", the desktop shows "Read the advice" and "BREWING ADVICE", and no element ever shows both. 192 tests pass.
This commit is contained in:
@@ -714,3 +714,15 @@ def test_the_api_exposes_the_attenuation_and_curve(logged_in, repo):
|
||||
assert len(entry["curve"]) == 2
|
||||
assert entry["curve"][0]["progress"] == 0.0
|
||||
assert entry["curve"][1]["progress"] == 1.0
|
||||
|
||||
|
||||
def test_the_pages_are_not_cached(client):
|
||||
"""The HTML pages must not be cached by the browser.
|
||||
|
||||
A phone held on to a cached copy of the brewing page and kept
|
||||
showing the old inline advice after the button and the pop-out had
|
||||
been deployed, so the change was invisible until the cache was
|
||||
cleared by hand.
|
||||
"""
|
||||
response = client.get("/login")
|
||||
assert "no-store" in response.headers.get("Cache-Control", "")
|
||||
|
||||
Reference in New Issue
Block a user