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) {{
|
function openTile(tile) {{
|
||||||
if (!tile || !tile.slug) return;
|
if (!tile || !tile.slug) return;
|
||||||
window.open(`/?route_key=${{encodeURIComponent(tile.slug)}}`, `webterm-${{tile.slug}}`);
|
window.open(`/?route_key=${{encodeURIComponent(tile.slug)}}`, `webterm-${{tile.slug}}`);
|
||||||
|
// Dismiss typeahead after launching from floating results.
|
||||||
|
searchQuery = '';
|
||||||
|
activeResultIndex = -1;
|
||||||
|
renderFloatingResults();
|
||||||
}}
|
}}
|
||||||
|
|
||||||
function normalizeText(value) {{
|
function normalizeText(value) {{
|
||||||
|
|||||||
@@ -257,6 +257,8 @@ class TestLocalServerHelpers:
|
|||||||
response = await server._handle_root(request)
|
response = await server._handle_root(request)
|
||||||
assert "/?route_key=${encodeURIComponent(tile.slug)}" in response.text
|
assert "/?route_key=${encodeURIComponent(tile.slug)}" in response.text
|
||||||
assert "visibilitychange" in response.text
|
assert "visibilitychange" in response.text
|
||||||
|
assert "searchQuery = ''" in response.text
|
||||||
|
assert "activeResultIndex = -1" in response.text
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def config(self):
|
def config(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user