Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trogon footer broken in Textual 0.60.0 and above #82

Closed
daneah opened this issue Jun 4, 2024 · 3 comments · Fixed by #83
Closed

Trogon footer broken in Textual 0.60.0 and above #82

daneah opened this issue Jun 4, 2024 · 3 comments · Fixed by #83

Comments

@daneah
Copy link
Collaborator

daneah commented Jun 4, 2024

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
Copy link
Collaborator Author

daneah commented Jun 4, 2024

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
Copy link
Collaborator Author

daneah commented Jun 4, 2024

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

@daneah daneah changed the title Trogon footer broken in Textual 0.63.0 and above Trogon footer broken in Textual 0.60.0 and above Jun 4, 2024
@TomJGooding
Copy link
Contributor

TomJGooding commented Jun 5, 2024

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"),
     ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants