Icons were previously hand-added, so their provenance and licensing lived in
folklore and a mis-painted asset was invisible at runtime: GPUI's `svg()`
reduces a file to an alpha mask, and `img()` keeps its pixels, but nothing
complains when the two are swapped.
Assets are now described by `scripts/icons.manifest` and vendored by
`scripts/sync-icons.sh` from pinned upstream releases, keeping the tree
reproducible and reviewable. `icons/**` stays monochrome and `color/**` full
colour; `scripts/check-icon-references.sh` fails the build when a referenced
asset is missing or painted through the wrong element, and runs in CI.
The lookup tables move out of `formatting/` into a dedicated `features/icons`
module so a ~1000-line brand table is not rebuilt inside a render closure, and
saved connections gain `icon_auto_detect`, which fills in a blank icon from the
detected remote system without ever overwriting a deliberate choice.
The `pages` tree, `http/cloud_sync` and `models/workspace_tabs` were the
last pseudo-module roots. Each moves to `X/mod.rs` so its children
resolve by directory, and `pages/remote/docker` stops aliasing six
sibling files (`docker_containers.rs` as `mod containers`, and so on)
in favour of a normal `docker/` directory.
`nyaterm-terminal-gpui` had one redundant `#[path = "tests.rs"]` that
already pointed at the default location; it is dropped too.
`#[path = "..."]` is now absent from both crates, so the twenty-two
per-directory guards collapse into one crate-wide `check_no_matches`.
Module paths always match the directory layout again, which is what
makes `pub(in ...)` bounds mean something and what makes the next step,
replacing the `use super::*` chain with explicit imports, worth doing.
`layout`, `panels`, `inspector`, `formatting` and `view_widgets` were the
same pattern as the runtime areas: an `X.rs` pseudo-module root next to
an `X/` directory whose children were pulled in with `#[path]`.
Move each root to `X/mod.rs` and let the children resolve by directory,
including the nested `security_panel/panel`, `workspace/surface`,
`quick_commands_panel/panel`, `send_command_bar`, `tab_actions_overlay`
and `ai_widgets` subtrees. All five areas are guarded against new
`#[path]` declarations.
Desktop `#[path]` count drops from 178 to 90. What remains is the
`pages` tree plus two files under `models` and `http`.
The remaining twenty-one flattened declarations in `features/mod.rs`
covered the AI, commands, settings, sync, transfers, remote and
translation directories. Each becomes a real module with its own
`mod.rs`, and their `ai_runtime`, `command_runtime`,
`quick_command_runtime`, `security_runtime`, `settings_runtime`,
`cloud_sync_runtime`, `transfer_jobs` and `remote_runtime` subtrees
become directory modules as well, along with the deeper `ai_runtime/chat`,
`ai_runtime/settings` and `quick_command_runtime/import` trees.
`features/mod.rs` now contains zero `#[path]` declarations, which the
boundary script enforces, and every feature directory is guarded too.
As in the previous rounds, nesting surfaced real visibility: three
event-drain methods were `pub(super)` and only reachable because their
module used to be a flat sibling of the event pump. Ten more
`crate::features` level re-exports turned out to be unused once each
consumer sat inside the owning subtree, and were removed.
Desktop `#[path]` count drops from 247 to 178; what is left lives in the
view layer (`pages`, `panels`, `layout`, `inspector`) and in `models`.
Eight terminal modules were declared in `features/mod.rs` through
`#[path = "terminal/..."]`, and four of them declared their own children
the same way.
Make the whole area a real module tree:
- `mod terminal;` with `features/terminal/mod.rs` owning the children.
- `terminal_runtime`, `terminal_surface`, `terminal_selection_runtime`
and `terminal_context_menu_runtime` become directory modules,
removing seventeen further `#[path]` declarations.
- Terminal internals are addressed as
`crate::features::terminal::terminal_runtime` instead of a top-level
`crate::features::terminal_runtime`.
Nesting also showed that nine prompt and terminal symbols no longer
needed a `crate::features` level alias, because every consumer now
reaches them inside the owning subtree. Those re-exports are removed,
which keeps the warning count at the existing baseline.
`features/mod.rs` is down from 52 `#[path]` declarations to 21, and the
desktop total drops from 272 to 247.
Thirteen session modules were declared in `features/mod.rs` through
`#[path = "session/..."]`, so `features/session` was a directory with no
module of its own.
Make it a real module:
- `mod session;` with `features/session/mod.rs` owning the children.
- `session_runtime` becomes a directory module, removing its two
remaining `#[path]` declarations.
- Prompt and auth exports, plus the trzsz/zmodem session-state types
used by `app_state`, reach `crate::features` through explicit
re-exports instead of flattened module declarations.
Nesting immediately surfaced real visibility: four prompt-drain methods
were declared `pub(super)` and were only reachable from the event pump
because the module used to be a flat sibling. They are now
`pub(in crate::features)` on purpose rather than by accident.
`features/session` has zero `#[path]` declarations and is guarded.
Desktop `#[path]` count drops from 287 to 272.
`features/mod.rs` declared twelve shell modules through
`#[path = "shell/..."]`, so the directory looked layered while the module
tree stayed flat: every shell module was a direct child of
`crate::features` and `pub(in crate::features)` meant "visible to the
whole desktop feature crate".
Make `features/shell` a real module:
- `mod shell;` with `features/shell/mod.rs` owning the twelve children.
- `event_pump` and `keybinding_runtime` become directory modules, so
their own `#[path]` declarations go away too.
- Shell chrome exports reach the rest of `crate::features` through
explicit re-exports in `features/shell/mod.rs` instead of twelve
flattened module declarations.
`features/shell` now has zero `#[path]` declarations, and the boundary
script guards that instead of allowing a baseline of five. Desktop
`#[path]` count drops from 306 to 287.
The suggested order in the migration status doc is reworked to put the
module tree first: narrowing the shared prelude one symbol at a time
produced little real encapsulation while every feature directory was
still flattened into one namespace.
The guard was only reliable on the machine it was written on:
- `rg` prints backslash separators on Windows, so the legacy-source
allowlist and the `use super::*` scope check never matched their
`case` patterns and reported every file as a violation. Both call
sites now pass `--path-separator /`.
- `IGNORECASE` is a gawk extension. Under gawk the secret-Debug scan
matched CamelCase names such as `KeywordHighlightRule` and produced
dozens of false positives; under mawk it was silently case-sensitive.
Drop it so the result is the same everywhere, and note that the
heuristic is currently weak and still needs a real triage pass.
- `\(` and `\.` inside an awk regex are implementation-defined; some
awks strip the backslash and then fail with "unbalanced (". Use
bracket expressions instead.
- Drop the stale `pages/connections.rs` path; that module became a
directory earlier and `rg` failed on the missing file.
This commit introduces a new script, `check-architecture-boundaries.sh`, which enforces architectural boundaries within the project. The script checks for dependencies between different components, ensuring that low-level crates remain independent of higher-level presentation code. It also validates that certain fields and methods are accessed only through designated state management methods, preventing direct mutations that could lead to inconsistencies.
Key features of the script include:
- Dependency checks between crates.
- Validation of access patterns for state management.
- Enforcement of limits on specific code patterns to maintain architectural integrity.
- Reporting of violations with detailed output for easier debugging.
This addition aims to improve code quality and maintainability by enforcing architectural guidelines.
This commit introduces two new scripts, `import-quick-commands.ps1` and `import-quick-commands.sh`, for importing quick commands into the NyaTerm database. It also adds an example JSON file, `quick-commands.import.example.json`, demonstrating the expected format for quick commands and categories. Additionally, a new Rust example, `import_quick_commands.rs`, is added to handle the import logic, including options for database path, replacement, dry run, and backup. This enhancement streamlines the process of managing quick commands within the application.
This commit replaces all instances of "Dragonfly" with "NyaTerm" in various files, including documentation, configuration, and UI elements. The changes ensure consistency in branding and improve clarity for users transitioning from the previous version. Additionally, updates to the changelog and README reflect the new application name and its features.
- Updated version in package.json, Cargo.toml, Cargo.lock, and tauri.conf.json to 0.1.5.
- Introduced a new script (sync-version.mjs) to synchronize version across configuration files.
- Modified build and release scripts to include version synchronization.