From 9e7419db8deb42c6236b6d6a142f6b225e010573 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Sat, 23 May 2026 09:07:00 -0700 Subject: [PATCH] Remove navigation_search_js_hash mechanism Codex added this because CSS was not reloading in dev. --- datasette/app.py | 1 - datasette/handle_exception.py | 3 --- datasette/templates/base.html | 2 +- tests/test_html.py | 5 +---- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/datasette/app.py b/datasette/app.py index 088403e0..75f05d88 100644 --- a/datasette/app.py +++ b/datasette/app.py @@ -2052,7 +2052,6 @@ class Datasette: and "ds_actor" in request.cookies and request.actor, "app_css_hash": self.app_css_hash(), - "navigation_search_js_hash": self.static_hash("navigation-search.js"), "zip": zip, "body_scripts": body_scripts, "format_bytes": format_bytes, diff --git a/datasette/handle_exception.py b/datasette/handle_exception.py index 25ec26d9..96398a4c 100644 --- a/datasette/handle_exception.py +++ b/datasette/handle_exception.py @@ -67,9 +67,6 @@ def handle_exception(datasette, request, exception): info, urls=datasette.urls, app_css_hash=datasette.app_css_hash(), - navigation_search_js_hash=datasette.static_hash( - "navigation-search.js" - ), menu_links=lambda: [], ) ), diff --git a/datasette/templates/base.html b/datasette/templates/base.html index 02365e68..819715ba 100644 --- a/datasette/templates/base.html +++ b/datasette/templates/base.html @@ -70,7 +70,7 @@ {% endfor %} {% if select_templates %}{% endif %} - + diff --git a/tests/test_html.py b/tests/test_html.py index ac77f10f..4da321d2 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -1022,10 +1022,7 @@ async def test_navigation_menu_links( navigation_search_script = soup.find( "script", {"src": re.compile(r"navigation-search\.js")} ) - assert navigation_search_script["src"] == ( - "/-/static/navigation-search.js?" - + ds_client.ds.static_hash("navigation-search.js") - ) + assert navigation_search_script["src"] == "/-/static/navigation-search.js" assert details.find("li").find("button") == search_button if not actor_id: # The app menu is always visible, but anonymous users do not see logout