diff --git a/src/posting/app.py b/src/posting/app.py index 6283a5e3..2b8ff42d 100644 --- a/src/posting/app.py +++ b/src/posting/app.py @@ -104,6 +104,7 @@ class AppBody(Vertical): class MainScreen(Screen[None]): AUTO_FOCUS = None + BINDING_GROUP_TITLE = "Main Screen" BINDINGS = [ Binding( "ctrl+j,alt+enter", @@ -804,6 +805,7 @@ class Posting(App[None], inherit_bindings=False): AUTO_FOCUS = None COMMANDS = {PostingProvider} CSS_PATH = Path(__file__).parent / "posting.scss" + BINDING_GROUP_TITLE = "Global Keybinds" BINDINGS = [ Binding( "ctrl+p", diff --git a/src/posting/commands.py b/src/posting/commands.py index 974f3aaf..041a1843 100644 --- a/src/posting/commands.py +++ b/src/posting/commands.py @@ -94,7 +94,7 @@ def commands( ( "help: Hide keybindings sidebar", app.action_hide_help_panel, - "Hide the keybindings sidebar.", + "Hide the keybindings sidebar", True, ), ) diff --git a/src/posting/posting.scss b/src/posting/posting.scss index 3847ae1d..2f2ae0f7 100644 --- a/src/posting/posting.scss +++ b/src/posting/posting.scss @@ -39,6 +39,14 @@ Footer { padding-left: 2; } +HelpPanel { + #title { + display: block; + } + KeyPanel { + scrollbar-size-vertical: 1; + } +} .modal-body { background: $background; padding: 1 2; diff --git a/src/posting/widgets/collection/browser.py b/src/posting/widgets/collection/browser.py index 7d2b821d..23bc9126 100644 --- a/src/posting/widgets/collection/browser.py +++ b/src/posting/widgets/collection/browser.py @@ -54,6 +54,8 @@ class CollectionTree(PostingTree[CollectionNode]): """, ) + BINDING_GROUP_TITLE = "Collection Browser" + BINDINGS = [ Binding( "d", diff --git a/src/posting/widgets/request/header_editor.py b/src/posting/widgets/request/header_editor.py index 3be1b90a..f07444a6 100644 --- a/src/posting/widgets/request/header_editor.py +++ b/src/posting/widgets/request/header_editor.py @@ -25,8 +25,12 @@ class HeaderInput(PostingInput): """, ) + BINDING_GROUP_TITLE = "HTTP Header Input" + class HeaderEditor(Vertical): + BINDING_GROUP_TITLE = "HTTP Header Editor" + def compose(self) -> ComposeResult: yield KeyValueEditor( HeadersTable(), @@ -70,6 +74,8 @@ class HeadersTable(PostingDataTable): """, ) + BINDING_GROUP_TITLE = "Headers Table" + BINDINGS = [ Binding("backspace", action="remove_row", description="Remove header"), ] diff --git a/src/posting/widgets/request/method_selection.py b/src/posting/widgets/request/method_selection.py index 09fc8d23..fd00bfcf 100644 --- a/src/posting/widgets/request/method_selection.py +++ b/src/posting/widgets/request/method_selection.py @@ -22,6 +22,8 @@ class MethodSelector(PostingSelect[str]): """, ) + BINDING_GROUP_TITLE = "HTTP Method Selector" + BINDINGS = [ Binding("g", "select_method('GET')", "GET", show=False), Binding("p", "select_method('POST')", "POST", show=False), diff --git a/src/posting/widgets/request/request_body.py b/src/posting/widgets/request/request_body.py index eb1f1684..a705f01d 100644 --- a/src/posting/widgets/request/request_body.py +++ b/src/posting/widgets/request/request_body.py @@ -12,6 +12,8 @@ class RequestBodyTextArea(PostingTextArea): For editing request bodies. """ + BINDING_GROUP_TITLE = "Request Body Text Area" + help = HelpData( title="Request Body Text Area", description="""\ diff --git a/src/posting/widgets/request/url_bar.py b/src/posting/widgets/request/url_bar.py index 00ee3631..0afb3bd9 100644 --- a/src/posting/widgets/request/url_bar.py +++ b/src/posting/widgets/request/url_bar.py @@ -53,6 +53,8 @@ class UrlInput(PostingInput): """, ) + BINDING_GROUP_TITLE = "URL Input" + BINDINGS = [ Binding("down", "app.focus_next", "Focus next", show=False), ] diff --git a/src/posting/widgets/response/response_body.py b/src/posting/widgets/response/response_body.py index 85978d0a..1b4ea42e 100644 --- a/src/posting/widgets/response/response_body.py +++ b/src/posting/widgets/response/response_body.py @@ -24,6 +24,8 @@ class ResponseTextArea(ReadOnlyTextArea): """, ) + BINDING_GROUP_TITLE = "Response Body Text Area" + @on(TextArea.Changed) def on_change(self, event: TextArea.Changed) -> None: empty = len(self.text) == 0 diff --git a/src/posting/widgets/response/script_output.py b/src/posting/widgets/response/script_output.py index 2f12dab2..8ebf3cf7 100644 --- a/src/posting/widgets/response/script_output.py +++ b/src/posting/widgets/response/script_output.py @@ -23,6 +23,8 @@ class ScriptOutput(VerticalScroll): """, ) + BINDING_GROUP_TITLE = "Script Output" + setup_status: Reactive[ScriptStatus] = reactive("no-script") request_status: Reactive[ScriptStatus] = reactive("no-script") response_status: Reactive[ScriptStatus] = reactive("no-script") diff --git a/src/posting/widgets/variable_input.py b/src/posting/widgets/variable_input.py index fce593a0..656503e4 100644 --- a/src/posting/widgets/variable_input.py +++ b/src/posting/widgets/variable_input.py @@ -20,6 +20,8 @@ class VariableInput(PostingInput): """, ) + BINDING_GROUP_TITLE = "Variable Input" + def on_mount(self) -> None: self.highlighter = VariableHighlighter() self.auto_complete = VariableAutoComplete(