From 9352cf2997d443a30bd25370cebe6045ede108df Mon Sep 17 00:00:00 2001 From: Kang Date: Tue, 28 Jul 2026 13:24:22 +0800 Subject: [PATCH] refactor(desktop): remove transfer path helper wildcard import --- .../src/features/pages/transfers/helpers/paths.rs | 6 ++++-- docs/architecture/gpui-migration-status.md | 5 ++++- scripts/check-architecture-boundaries.sh | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/crates/nyaterm-desktop/src/features/pages/transfers/helpers/paths.rs b/crates/nyaterm-desktop/src/features/pages/transfers/helpers/paths.rs index 3d1eb53a3..c0ba3375e 100644 --- a/crates/nyaterm-desktop/src/features/pages/transfers/helpers/paths.rs +++ b/crates/nyaterm-desktop/src/features/pages/transfers/helpers/paths.rs @@ -1,4 +1,6 @@ -use super::*; +use gpui::Pixels; + +use crate::models::TransferBrowserColumnWidths; pub(in crate::features::pages::transfers) fn remote_file_name(path: &str) -> String { path.trim_end_matches('/') @@ -76,7 +78,7 @@ impl TransferPathPart { pub(in crate::features::pages::transfers) fn transfer_browser_table_width( widths: TransferBrowserColumnWidths, -) -> gpui::Pixels { +) -> Pixels { widths.name + widths.modified + widths.size + widths.permissions + widths.owner + widths.group } diff --git a/docs/architecture/gpui-migration-status.md b/docs/architecture/gpui-migration-status.md index 1ae7c3b35..74ae6dc14 100644 --- a/docs/architecture/gpui-migration-status.md +++ b/docs/architecture/gpui-migration-status.md @@ -12,7 +12,7 @@ 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 | 349 | Includes indented test-module imports; historical migration debt, do not add new occurrences. | +| `use super::*` imports in desktop | 348 | 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. | @@ -320,6 +320,9 @@ these as staged extraction candidates, not as formatting-only refactor targets. - `pages/transfers/helpers/editor.rs` no longer carries an unused helper wildcard import; the editor preview/search/permission helpers are pure local functions with no parent-module dependency. +- `pages/transfers/helpers/paths.rs` no longer depends on the transfer helper + wildcard import; remote path helpers now name their column-width model and + GPUI pixel type explicitly. - `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 diff --git a/scripts/check-architecture-boundaries.sh b/scripts/check-architecture-boundaries.sh index a1780cb4f..425ef1ee0 100755 --- a/scripts/check-architecture-boundaries.sh +++ b/scripts/check-architecture-boundaries.sh @@ -515,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/pages/transfers/helpers/editor.rs]=0 + [crates/nyaterm-desktop/src/features/pages/transfers/helpers/paths.rs]=0 [crates/nyaterm-desktop/src/features/shell/mod.rs]=0 [crates/nyaterm-desktop/src/features/shell/activity_bar_runtime.rs]=0 [crates/nyaterm-desktop/src/features/shell/appearance.rs]=0 @@ -557,6 +558,7 @@ done < <(rg -n --path-separator / '^[[:space:]]*use super::\*;' \ crates/nyaterm-desktop/src/features/pages/connections \ crates/nyaterm-desktop/src/features/pages/tunnels \ crates/nyaterm-desktop/src/features/pages/transfers/helpers/editor.rs \ + crates/nyaterm-desktop/src/features/pages/transfers/helpers/paths.rs \ crates/nyaterm-desktop/src/features/shell/mod.rs \ crates/nyaterm-desktop/src/features/shell/activity_bar_runtime.rs \ crates/nyaterm-desktop/src/features/shell/appearance.rs \