trogon icon indicating copy to clipboard operation
trogon copied to clipboard

Trogon footer broken in Textual 0.60.0 and above

Open daneah opened this issue 1 year ago • 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.

daneah avatar Jun 04 '24 15:06 daneah

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.

daneah avatar Jun 04 '24 16:06 daneah

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

daneah avatar Jun 04 '24 16:06 daneah

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. https://github.com/Textualize/textual/pull/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"),
     ]

TomJGooding avatar Jun 05 '24 20:06 TomJGooding