fix: dismiss typeahead after launching session from floating results
When opening a session via the typeahead floating results panel, clear the search query and active selection so the panel dismisses immediately. Adds a test assertion ensuring the dashboard HTML includes the dismissal logic after opening a tile.
This commit is contained in:
@@ -904,6 +904,10 @@ class LocalServer:
|
||||
function openTile(tile) {{
|
||||
if (!tile || !tile.slug) return;
|
||||
window.open(`/?route_key=${{encodeURIComponent(tile.slug)}}`, `webterm-${{tile.slug}}`);
|
||||
// Dismiss typeahead after launching from floating results.
|
||||
searchQuery = '';
|
||||
activeResultIndex = -1;
|
||||
renderFloatingResults();
|
||||
}}
|
||||
|
||||
function normalizeText(value) {{
|
||||
|
||||
@@ -257,6 +257,8 @@ class TestLocalServerHelpers:
|
||||
response = await server._handle_root(request)
|
||||
assert "/?route_key=${encodeURIComponent(tile.slug)}" in response.text
|
||||
assert "visibilitychange" in response.text
|
||||
assert "searchQuery = ''" in response.text
|
||||
assert "activeResultIndex = -1" in response.text
|
||||
|
||||
@pytest.fixture
|
||||
def config(self):
|
||||
|
||||
Reference in New Issue
Block a user