Textualize/trogon

Trogon footer broken in Textual 0.60.0 and above

Closed this issue · 3 comments

On Textual 0.63.0 and above, the footer in Trogon is no longer functional. The Close and Run option and the About option still work, but other options don't respond to keyboard shortcuts or clicks.

Textual 0.63.0 changed the footer behavior, which may be related.

Downgrading to Textual 0.62.0 restores the functionality.

Reproduction and more details here.

Er, sorry, before you get at all deep into this—although the visual footer change occured in 0.63.0, I think the actual functional part is broken earlier than 0.63.0—looking for that version now and will update.

It appears the functional portion of the footer broke in version 0.60.0 and above.

The problem is this change in Textual v0.61.0:

Breaking change: Actions (as used in bindings) will no longer check the app if they are unhandled. This was undocumented anyway, and not that useful. Textualize/textual#4516

The fix is pretty simple but would require a new Trojon release:

diff --git a/trogon/trogon.py b/trogon/trogon.py
index 1238747..36b1884 100644
--- a/trogon/trogon.py
+++ b/trogon/trogon.py
@@ -48,10 +48,14 @@ class CommandBuilder(Screen):
     BINDINGS = [
         Binding(key="ctrl+r", action="close_and_run", description="Close & Run"),
         Binding(
-            key="ctrl+t", action="focus_command_tree", description="Focus Command Tree"
+            key="ctrl+t",
+            action="app.focus_command_tree",
+            description="Focus Command Tree",
         ),
-        Binding(key="ctrl+o", action="show_command_info", description="Command Info"),
-        Binding(key="ctrl+s", action="focus('search')", description="Search"),
+        Binding(
+            key="ctrl+o", action="app.show_command_info", description="Command Info"
+        ),
+        Binding(key="ctrl+s", action="app.focus('search')", description="Search"),
         Binding(key="f1", action="about", description="About"),
     ]