Commit Graph
37 Commits
Author SHA1 Message Date
Kang 5efce4e7cf feat(assets): vendor bundled icons from a pinned manifest
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.
2026-07-26 23:21:58 +08:00
Kang 575b59a401 refactor(desktop): remove the last #[path] declarations
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.
2026-07-26 15:02:51 +08:00
Kang f242c56308 refactor(desktop): nest layout, panels and inspector view modules
`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`.
2026-07-26 14:59:14 +08:00
Kang 99f972d1fa refactor(desktop): remove #[path] from the features root
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`.
2026-07-26 14:56:57 +08:00
Kang 4220c0a3a8 refactor(desktop): nest terminal feature modules
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.
2026-07-26 14:53:04 +08:00
Kang c9b933e814 refactor(desktop): nest session feature modules
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.
2026-07-26 14:48:36 +08:00
Kang 1e0b990ffe refactor(desktop): nest shell feature modules
`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.
2026-07-26 14:44:55 +08:00
Kang a88d04d979 fix(scripts): make architecture boundary check portable
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.
2026-07-26 14:44:25 +08:00
Kang 970e553a2c refactor(desktop): narrow terminal frame event prelude export 2026-07-26 14:23:23 +08:00
Kang 3d9edeed02 refactor(desktop): narrow terminal action link matcher prelude export 2026-07-26 14:18:59 +08:00
Kang 75b77e2226 refactor(desktop): narrow terminal interaction helper prelude export 2026-07-26 14:15:56 +08:00
Kang a712a550fa refactor(desktop): narrow terminal snapshot geometry prelude export 2026-07-26 14:13:58 +08:00
Kang c1078085da refactor(desktop): narrow terminal search result helper prelude export 2026-07-26 14:12:05 +08:00
Kang 32ae3cd0a7 refactor(desktop): narrow terminal output tail cap prelude export 2026-07-26 14:09:35 +08:00
Kang a06aa1b08d refactor(desktop): narrow terminal frame pipeline prelude export 2026-07-26 13:40:14 +08:00
Kang 7ba55db68f refactor(desktop): narrow terminal frame search key prelude export 2026-07-26 13:35:58 +08:00
Kang 5b0cf49f88 refactor(desktop): narrow terminal frame snapshot prelude export 2026-07-26 13:32:33 +08:00
Kang e94689a1d2 refactor(desktop): narrow terminal frame search prelude export 2026-07-26 13:29:26 +08:00
Kang 0cdd1668ce refactor(desktop): narrow terminal frame submission prelude export 2026-07-26 13:25:32 +08:00
Kang d38fe7d3d9 refactor(desktop): narrow terminal frame output prelude export 2026-07-26 13:22:26 +08:00
Kang 8ddd68cc42 refactor(desktop): narrow terminal frame buffer text prelude export 2026-07-26 13:18:57 +08:00
Kang 188df40a8a refactor(desktop): narrow terminal cell position prelude export 2026-07-26 13:13:28 +08:00
Kang 07142623e3 refactor(desktop): narrow terminal selection prelude export 2026-07-26 13:08:28 +08:00
Kang a257d03447 refactor(desktop): narrow terminal protocol state prelude export 2026-07-26 12:41:16 +08:00
Kang e557ffd8d8 refactor(desktop): narrow terminal performance mode prelude export 2026-07-26 12:36:21 +08:00
Kang 0f188c6f74 refactor(desktop): narrow feature prelude exports 2026-07-26 12:33:10 +08:00
Kang 55a4104b40 refactor(architecture): make job imports explicit 2026-07-25 22:10:14 +08:00
Kang 1c49cb5ada refactor(architecture): narrow shared import boundaries 2026-07-25 21:44:31 +08:00
Kang 16ddcd3042 refactor: add architecture boundary check script
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.
2026-07-25 20:29:05 +08:00
Kang 63ff274888 refactor: migrate to GPUI 2026-07-05 17:26:19 +08:00
Kang 312d53a6f5 feat: Implement quick commands import functionality with scripts and example JSON
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.
2026-05-12 13:17:19 +08:00
Kang f7875d7871 refactor: Update references from Dragonfly to NyaTerm across documentation and codebase
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.
2026-05-05 20:05:53 +08:00
Kang a37090e70d feat(logging): introduce console usage linting and enhance error logging structure across components for improved diagnostics 2026-04-20 21:39:55 +08:00
Kang 58df7d6cd5 feat(demos): add various demo scripts for showcasing Dragonfly's terminal features, including action links, file watching, keyword highlighting, and structured output 2026-04-13 15:06:04 +08:00
Kang 74ef53b9a8 chore: update version synchronization in sync-version script 2026-04-11 16:23:17 +08:00
Kang 4ee644d3ad chore: sync version in Cargo.lock and update commit files list 2026-03-06 18:57:10 +08:00
Kang 7894e410c4 chore: bump version to 0.1.5 and add version synchronization script
- 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.
2026-03-06 10:13:42 +08:00