Skip to content

feat: editor only in interactive mode - #7

Merged
jopmiddelkamp merged 1 commit into
developfrom
feature/editor-only-in-interactive-mode
Oct 29, 2026
Merged

jopmiddelkamp merged 1 commit into
developfrom
feature/editor-only-in-interactive-mode

Conversation

@jopmiddelkamp

@jopmiddelkamp jopmiddelkamp commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Why

With worktree=true, every gflow start … opened the configured editor (for example IntelliJ IDEA). Scripted callers such as AI agents and CI then spawn editor windows nobody asked for. The editor should open only when a person uses the interactive menu.

What changed

  • WorktreeEnv gets an open_editor flag. open_worktree skips the editor when it is false.
  • main.rs sets it to command.is_none(): only gflow with no subcommand (the interactive menu) opens the editor. This is the same signal init::ensure already uses for interactive runs.
  • Subcommands such as gflow start feature --name x still create the worktree and run the worktrees.json setup commands. They print the worktree path, but open no editor.
  • README, skills/gflow/SKILL.md and CHANGELOG (Unreleased → Changed) describe the new rule.

Out of scope: the editor config key and the none value work as before.

Test review

  • New: start_work_branch_worktree_without_open_editor_skips_open (tests/start_test.rs). It fails if a run with open_editor: false still calls the editor. Watched it fail before adding the guard.
  • Existing tests: every other WorktreeEnv fixture sets open_editor: true, so their assertions (editor opens, editor failure is a warning, editor=none skips) are unchanged.
  • Deleted tests: none.
  • cargo test: all suites pass on this commit alone. The TDD coverage gate (.claude/hooks/tdd-gate.sh) passes.
  • End to end with the release binary against a fake GitHub remote (verify skill), with worktree=true and a logging fake editor:
    • gflow start feature --name x → worktree created, editor not run.
    • interactive menu → start feature → worktree created, editor run on the worktree path.

Subcommands such as 'gflow start feature --name x' still create the worktree but no longer launch the editor, so scripted callers (CI, agents) do not spawn editor windows.
Copilot AI balanced review requested due to automatic review settings October 29, 2026 15:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the change restricting automatic editor launches to gflow’s interactive menu.

No open issues 🎉

What changed in this PR

This PR limits automatic worktree editor launches to gflow’s interactive menu, preventing scripted and CI callers from opening unwanted editor windows.

Changes:

  • Adds an open_editor flag, enabled only when no subcommand is supplied; worktree creation and setup commands remain unchanged.
  • Adds a regression test for disabled editor launches and updates existing test fixtures.
  • Documents the new behavior in the README, plugin skill, and changelog.
File Description
tests/​worktree_test.rs Preserves editor-enabled behavior in existing fixtures.
tests/​start_test.rs Tests editor suppression while preserving worktree creation; updates fixtures.
tests/​lifecycle_test.rs Adds the editor flag to lifecycle fixtures.
src/​worktree.rs Gates editor launch on open_editor.
src/​main.rs Enables editor launch only for interactive runs.
skills/​gflow/​SKILL.md Documents interactive-only editor launching.
README.md Clarifies editor behavior for menus and subcommands.
CHANGELOG.md Records the behavior change under Unreleased.

Review effort: Balanced

@claude

claude Bot commented Oct 29, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@jopmiddelkamp
jopmiddelkamp enabled auto-merge (squash) October 29, 2026 16:00
@jopmiddelkamp
jopmiddelkamp merged commit 1694f44 into develop Oct 29, 2026
11 checks passed
@jopmiddelkamp
jopmiddelkamp deleted the feature/editor-only-in-interactive-mode branch October 29, 2026 16:02
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.

2 participants