Skip to content

Refactor the codebase and add --dry-run feature#8

Merged
yuk1ty merged 8 commits into
mainfrom
refactor/actions-calculations-data
Jul 16, 2026
Merged

Refactor the codebase and add --dry-run feature#8
yuk1ty merged 8 commits into
mainfrom
refactor/actions-calculations-data

Conversation

@yuk1ty

@yuk1ty yuk1ty commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Refactor the codebase and add dry-run feature.

yuk1ty added 8 commits July 16, 2026 07:34
…space Calculation

Add pure Data types (PaneHandle, BackendOp) and Calculation functions
(plan_workspace, plan_file) to engine.rs. This is the duplication phase:
the old apply/apply_workspace/MockBackend stay untouched.

18 plan-level tests added covering the full decision logic.
- Add Clone to Workspace, Tab, Pane
- resolve_workspace_paths takes &Workspace and returns owned Workspace
- resolve_paths takes &SpreadFile and returns owned SpreadFile
- No .take() calls remain
- Update main.rs call site to pass &spread_file
…se_focus_strategy

- Add FocusStrategy enum and pure choose_focus_strategy Calculation
- Add socket_path field to CliBackend, thread from main.rs
- focus_pane_via_socket takes explicit socket_path parameter
- No std::env::var in backend/cli.rs anymore
- Unit tests for strategy selection and explicit path threading
…ation

Add two tests that assert engine::plan_file(&file) produces exact
Vec<BackendOp> for the integration test fixtures, demonstrating the
Actions/Calculations split at the integration seam.

Existing subprocess tests pass unchanged.
- Add #[arg(long)] dry_run: bool to Command::Apply
- Add pure render_op function for human-readable BackendOp display
- Wire main.rs: when dry_run is true, print plan lines and exit
- Update existing cli.rs test to include dry_run: false
…itecture

- Replace MockBackend/apply_workspace/focus_pane mentions with
  BackendOp/PaneHandle/plan_workspace/execute_plan/RecordingBackend
- Update data flow diagram to flat Vec<BackendOp> story
- Rewrite focus section: per-call --focus/--no-focus, no focus_pane call
- Add choose_focus_strategy to pure functions list
- Update testing strategy: plan tests + RecordingBackend + plan-pinning
@yuk1ty
yuk1ty force-pushed the refactor/actions-calculations-data branch from 0029027 to f9dbbce Compare July 16, 2026 14:03
@yuk1ty
yuk1ty marked this pull request as ready for review July 16, 2026 14:05
@yuk1ty
yuk1ty merged commit 3e9a1a0 into main Jul 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant