Skip to content

fix(editor): make global hotkeys work from panels - #160

Merged
fcoury merged 10 commits into
masterfrom
feat/global-panel-hotkeys
Aug 6, 2026
Merged

fix(editor): make global hotkeys work from panels#160
fcoury merged 10 commits into
masterfrom
feat/global-panel-hotkeys

Conversation

@fcoury

@fcoury fcoury commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Focused plugin panels currently intercept normal-mode keymaps before editor commands can run. That leaves built-in shortcuts such as Ctrl-p and Ctrl-z unavailable in Neo-tree, while the blanket allowance for plugin commands and nested prefixes can expose commands that are not safe or meaningful from a panel.

This change introduces an explicit command scope for panel-safe dispatch:

  • admit panel-safe built-in actions such as file/command pickers, suspend, diagnostics, and window management
  • add plugin command metadata with an editor default and explicit global opt-in
  • mark bundled workspace pickers, pane toggles, Agent commands, Git dashboard, and symbol launchers as global
  • filter nested keymaps to global leaves so contextual sibling commands cannot leak through
  • preserve unmodified row-panel keys, including Neo-tree file operations, ahead of user-defined global bindings
  • document the new plugin command scope in docs/PLUGIN_API.md and docs/PLUGIN_SYSTEM.md

How to Test

  1. Open Neo-tree with Ctrl-e, keep focus in the tree, and press Ctrl-p. The file picker should open.
  2. From a focused panel, verify Ctrl-z, F1, and Ctrl-w w still invoke their application/window actions.
  3. In Neo-tree, verify unmodified file-operation keys such as x remain panel-local even if the normal keymap assigns that key to a global action.
  4. Run:
    • cargo test --all-targets --all-features
    • cargo clippy --all-targets --all-features -- -D warnings

@fcoury
fcoury force-pushed the feat/global-panel-hotkeys branch from 9edd3ed to 6a94a0d Compare July 26, 2026 23:44
@fcoury
fcoury force-pushed the feat/global-panel-hotkeys branch from 6a94a0d to 6b6d92e Compare August 4, 2026 18:33
@fcoury

fcoury commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b6d92e992

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/editor.rs Outdated
@fcoury

fcoury commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ac02678b72

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/editor.rs
@fcoury

fcoury commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a894fead3d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/editor.rs
@fcoury

fcoury commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d29d0874b8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/plugin/runtime.rs
@fcoury

fcoury commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fc72e9861d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/editor.rs Outdated
@fcoury

fcoury commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@fcoury
fcoury force-pushed the feat/global-panel-hotkeys branch from 8e750d5 to b0e627e Compare August 4, 2026 19:59
@fcoury

fcoury commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b0e627e8e9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/plugin/package.rs
@fcoury

fcoury commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0aed426d05

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/plugin/api.rs Outdated
Comment thread src/editor.rs Outdated
@fcoury

fcoury commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7e7ed96a44

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/plugin/api.rs
Comment on lines +580 to +582
StmtKind::Loop { body } | StmtKind::Block(body) => {
self.visit_statements(&body.stmts);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve metadata bindings across nested scopes

When a red_api = "^0.6.0" package stores scoped command metadata in an outer local and then shadows that local inside a nested block before calling red::add_command with the outer value, this visitor leaves the shadow's false entry in command_metadata_bindings after the block. The later call is then treated as scope-free, so the manifest check accepts a package that still uses 0.7-only scope metadata and older 0.6 hosts will reject it. Saving/restoring bindings when entering block-like statements would keep the scope check aligned with Husk's lexical shadowing.

Useful? React with 👍 / 👎.

@fcoury
fcoury merged commit 931b7a0 into master Aug 6, 2026
24 checks passed
@fcoury
fcoury deleted the feat/global-panel-hotkeys branch August 6, 2026 00:58
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 this pull request may close these issues.

1 participant