fix(tui): surface mouse slash command (#17126)
This commit is contained in:
@@ -980,6 +980,14 @@ def test_complete_slash_includes_tui_details_command():
|
||||
assert any(item["text"] == "/details" for item in resp["result"]["items"])
|
||||
|
||||
|
||||
def test_complete_slash_includes_tui_mouse_command():
|
||||
resp = server.handle_request(
|
||||
{"id": "1", "method": "complete.slash", "params": {"text": "/mou"}}
|
||||
)
|
||||
|
||||
assert any(item["text"] == "/mouse" for item in resp["result"]["items"])
|
||||
|
||||
|
||||
def test_complete_slash_details_args():
|
||||
resp_root = server.handle_request(
|
||||
{"id": "0", "method": "complete.slash", "params": {"text": "/details"}}
|
||||
@@ -1547,6 +1555,19 @@ def test_commands_catalog_surfaces_quick_commands(monkeypatch):
|
||||
assert resp["result"]["canon"]["/notes"] == "/notes"
|
||||
|
||||
|
||||
def test_commands_catalog_includes_tui_mouse_command():
|
||||
resp = server.handle_request(
|
||||
{"id": "1", "method": "commands.catalog", "params": {}}
|
||||
)
|
||||
|
||||
pairs = dict(resp["result"]["pairs"])
|
||||
tui_cat = next(c for c in resp["result"]["categories"] if c["name"] == "TUI")
|
||||
tui_pairs = dict(tui_cat["pairs"])
|
||||
|
||||
assert "/mouse" in pairs
|
||||
assert "/mouse" in tui_pairs
|
||||
|
||||
|
||||
def test_command_dispatch_exec_nonzero_surfaces_error(monkeypatch):
|
||||
monkeypatch.setattr(
|
||||
server,
|
||||
|
||||
@@ -3354,6 +3354,7 @@ _TUI_HIDDEN: frozenset[str] = frozenset(
|
||||
_TUI_EXTRA: list[tuple[str, str, str]] = [
|
||||
("/compact", "Toggle compact display mode", "TUI"),
|
||||
("/logs", "Show recent gateway log lines", "TUI"),
|
||||
("/mouse", "Toggle mouse/wheel tracking [on|off|toggle]", "TUI"),
|
||||
]
|
||||
|
||||
# Commands that queue messages onto _pending_input in the CLI.
|
||||
@@ -4133,6 +4134,11 @@ def _(rid, params: dict) -> dict:
|
||||
"display": "/logs",
|
||||
"meta": "Show recent gateway log lines",
|
||||
},
|
||||
{
|
||||
"text": "/mouse",
|
||||
"display": "/mouse",
|
||||
"meta": "Toggle mouse/wheel tracking [on|off|toggle]",
|
||||
},
|
||||
]
|
||||
for extra in extras:
|
||||
if extra["text"].startswith(text_lower) and not any(
|
||||
|
||||
Reference in New Issue
Block a user