refactor(workspace): relocate compact_text to CLI presentation module (YT-19) #62

Merged
nrupard merged 1 commit from refactor/relocate-presentation-YT-19 into main 2026-05-27 18:13:14 +02:00
Member

Final subtask of the workspace refactor epic (YT-15). Depends on the merged youtrack-client (YT-17) and youtrack-config (YT-18) extractions.

What

Move the last display-only helper out of the former src/yt/ shim so the library crates provably carry no presentation logic. This is the cleanup that guarantees the MCP never transitively pulls comfy-table.

How

compact_text (whitespace-collapsing truncation) moves from crates/yt-cli/src/yt/output.rs to a new top-level crates/yt-cli/src/presentation.rs via git mv (history + unit tests preserved). The now-empty src/yt/output.rs and the src/yt/mod.rs shim are deleted, and mod yt; becomes mod presentation; in main.rs. The two call sites (issue/inspect.rs, issue/history.rs) import crate::presentation::compact_text.

The data-shaped formatters (format_millis, parse_ymd_to_ms_utc, custom-field value presentation, author_name, tail) stay in youtrack_client::output since the MCP needs human-readable values; only the pure display helper is CLI-local. Table rendering (comfy-table) was already command-local and is untouched.

Acceptance criteria

  • cargo tree -p youtrack-client and cargo tree -p youtrack-config show no comfy-table / clap / rpassword dependency.
  • No src/yt/output.rs remains; display helpers live under crates/yt-cli.
  • compact_text and table rendering are in the CLI crate only.
  • just pre-commit green (fmt, clippy -D warnings, build, 121 tests); table and inspect output byte-identical.

Epic

This closes the four subtasks of YT-15 (workspace skeleton, youtrack-client, youtrack-config, presentation relocation).

🤖 Generated with Claude Code

Final subtask of the workspace refactor epic (YT-15). Depends on the merged `youtrack-client` (YT-17) and `youtrack-config` (YT-18) extractions. ## What Move the last display-only helper out of the former `src/yt/` shim so the library crates provably carry no presentation logic. This is the cleanup that guarantees the MCP never transitively pulls comfy-table. ## How `compact_text` (whitespace-collapsing truncation) moves from `crates/yt-cli/src/yt/output.rs` to a new top-level `crates/yt-cli/src/presentation.rs` via `git mv` (history + unit tests preserved). The now-empty `src/yt/output.rs` and the `src/yt/mod.rs` shim are deleted, and `mod yt;` becomes `mod presentation;` in `main.rs`. The two call sites (`issue/inspect.rs`, `issue/history.rs`) import `crate::presentation::compact_text`. The data-shaped formatters (`format_millis`, `parse_ymd_to_ms_utc`, custom-field value presentation, `author_name`, `tail`) stay in `youtrack_client::output` since the MCP needs human-readable values; only the pure display helper is CLI-local. Table rendering (comfy-table) was already command-local and is untouched. ## Acceptance criteria - [x] `cargo tree -p youtrack-client` and `cargo tree -p youtrack-config` show no comfy-table / clap / rpassword dependency. - [x] No `src/yt/output.rs` remains; display helpers live under `crates/yt-cli`. - [x] `compact_text` and table rendering are in the CLI crate only. - [x] `just pre-commit` green (fmt, clippy -D warnings, build, 121 tests); table and inspect output byte-identical. ## Epic This closes the four subtasks of YT-15 (workspace skeleton, youtrack-client, youtrack-config, presentation relocation). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
refactor(workspace): relocate compact_text to CLI presentation module (YT-19)
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 15s
Create release / Create release from merged PR (pull_request) Has been skipped
92bf5a4762
Final subtask of the workspace refactor epic (YT-15). Moves the last display-only helper out of the former `src/yt/` shim so the library crates provably carry no presentation logic.

`compact_text` (whitespace-collapsing truncation) moves from `crates/yt-cli/src/yt/output.rs` to a new top-level `crates/yt-cli/src/presentation.rs` (git mv, history + tests preserved). The now-empty `src/yt/output.rs` and the `src/yt/mod.rs` shim are deleted, and `mod yt;` becomes `mod presentation;`. The two call sites (`issue/inspect.rs`, `issue/history.rs`) import `crate::presentation::compact_text`.

The data-shaped formatters (`format_millis`, `parse_ymd_to_ms_utc`, custom-field value presentation, `author_name`, `tail`) stay in `youtrack_client::output` since the MCP needs human-readable values; only the pure display helper is CLI-local.

Verified: `cargo tree -p youtrack-client` and `cargo tree -p youtrack-config` show no comfy-table / clap / rpassword. `just pre-commit` green: fmt, clippy -D warnings, build, 121 tests; `yt` output unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
nrupard deleted branch refactor/relocate-presentation-YT-19 2026-05-27 18:13:15 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pandoras-box/youtrack-cli!62
No description provided.