refactor(desktop): remove shell shortcut wildcard import

This commit is contained in:
Kang
2026-07-28 12:49:13 +08:00
parent 65d2556584
commit fe222d5ebf
4 changed files with 17 additions and 5 deletions
@@ -60,7 +60,7 @@ pub(super) use crate::models::{
pub(super) use crate::send_command::{
build_send_command_units_for, format_send_command_hex_display, parse_send_command_hex,
};
pub(super) use crate::shortcuts::{event_to_hotkey_string, shortcut_matches};
pub(super) use crate::shortcuts::event_to_hotkey_string;
pub(super) use crate::terminal::{
NyaTerminalElement, NyaTerminalLayoutCache, TerminalBufferMatch, TerminalKeyMode,
TerminalKeywordHighlightSnapshot, TerminalKeywordHighlighter, TerminalLineDecorations,
@@ -1,6 +1,8 @@
use super::*;
use gpui::{Context, KeyDownEvent, Window};
use crate::models::{BottomPanelMode, StartupCommandAction};
use crate::features::NyaTermApp;
use crate::models::{BottomPanelMode, NavItem, StartupCommandAction};
use crate::shortcuts::shortcut_matches;
impl NyaTermApp {
pub(in crate::features) fn handle_global_shortcut(
+6 -2
View File
@@ -12,8 +12,8 @@ Last updated from the working tree on 2026-07-28.
| `NyaTermApp` fields | 261 | Counted from `features/app_state/mod.rs`; down from 585, still transitional. |
| `impl NyaTermApp` blocks | 240 | Spread across 235 files under `crates/nyaterm-desktop/src`. |
| `#[path = "..."]` declarations in desktop | 0 | Cleared. Every directory is a real module; the boundary script fails on any new occurrence. |
| `use super::*` imports in desktop | 366 | Includes indented test-module imports; historical migration debt, do not add new occurrences. |
| `features/prelude.rs` rough exported-token count | 230 | Still a broad shared prelude; two hundred fifteen low-frequency transport/core/http/model exports are now explicit imports. |
| `use super::*` imports in desktop | 365 | Includes indented test-module imports; historical migration debt, do not add new occurrences. |
| `features/prelude.rs` rough exported-token count | 229 | Still a broad shared prelude; two hundred sixteen low-frequency transport/core/http/model/helper exports are now explicit imports. |
| Entity Store structs | 4 | `Runtime`, `WindowRuntime`, `StartupRestore`, `Overlay`. Each owns state the app does not. |
| Snapshot structs | 0 | Cleared. No store is a projection of `NyaTermApp` any more. |
| `replace_snapshot` methods | 0 | Cleared. |
@@ -271,6 +271,10 @@ these as staged extraction candidates, not as formatting-only refactor targets.
- `shell/event_pump/mod.rs` no longer depends on the shell wildcard import or
the helper wildcard import; the event-pump entrypoint now names its GPUI,
prompt, text-input, navigation and timing-helper dependencies explicitly.
- `shell/global_shortcut_runtime.rs` no longer depends on the shell wildcard
import; global shortcut routing now names its GPUI event types, app adapter,
navigation models and shortcut matcher explicitly. `shortcut_matches` is no
longer re-exported through `features/prelude.rs`.
- `connection_runtime/helpers.rs` no longer depends on the connection runtime
wildcard import; its GPUI, app, model, and core dependencies are explicit.
- `connection_runtime/actions.rs` no longer depends on the connection runtime
+6
View File
@@ -436,6 +436,11 @@ check_no_matches \
'(^|[,{[:space:]])(SendCommandControlFocus|SendCommandDataType|SendCommandLineEnding|SendCommandMode|SendCommandTarget)([},[:space:]]|$)' \
crates/nyaterm-desktop/src/features/prelude.rs
check_no_matches \
"shortcut matching helper must stay out of features/prelude.rs" \
'(^|[,{[:space:]])(shortcut_matches)([},[:space:]]|$)' \
crates/nyaterm-desktop/src/features/prelude.rs
# Keep the terminal GPUI crate root's public surface explicit. These modules
# are implementation details; callers use the named facade exports below.
check_no_matches \
@@ -510,6 +515,7 @@ declare -A SUPER_BASELINE=(
[crates/nyaterm-desktop/src/features/pages/tunnels/tunnel/row.rs]=0
[crates/nyaterm-desktop/src/features/pages/tunnels/tunnel/sections.rs]=0
[crates/nyaterm-desktop/src/features/shell/mod.rs]=1
[crates/nyaterm-desktop/src/features/shell/global_shortcut_runtime.rs]=0
[crates/nyaterm-desktop/src/features/shell/event_pump/mod.rs]=0
[crates/nyaterm-desktop/src/features/shell/event_pump/bridge.rs]=0
[crates/nyaterm-desktop/src/features/shell/event_pump/helpers.rs]=0