Skip to content

Remove --no-background, promote --no-progressive, carry foreground through - #1381

Merged
max-sixty merged 8 commits into
mainfrom
foreground-background
Mar 9, 2026
Merged

max-sixty merged 8 commits into
mainfrom
foreground-background

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Removes the deprecated --no-background flag (replaced by --foreground) from
remove, hook post-start, hook post-switch, and hook post-remove. Removes
all supporting deprecation infrastructure: warning message, is_foreground_mode
helper, DEPRECATED_ARGS completion filtering.

Promotes --no-progressive from deprecated to hidden flag with inline mention
in --progressive's help text, using flag_pair() for consistent handling.

Carries foreground: bool through the entire call chain instead of negating to
background at call sites. Refactors print_message to use
success_message()/progress_message() helpers instead of manual color
construction, adding FormattedMessage::append() for integration symbols that
need native styling outside the message's color span.

This was written by Claude Code on behalf of maximilian

max-sixty and others added 3 commits March 8, 2026 14:12
Remove the deprecated `--no-background` flag from `remove`, `hook post-start`,
and `hook post-switch` commands. The replacement `--foreground` has been
available since the deprecation was introduced.

Promote `--no-progressive` from a hidden flag to a proper visible flag on
`list`, shown inline under `--progressive` help text (hidden from top-level
help, documented in description). Canonicalize its dispatch to use `flag_pair()`.

Co-Authored-By: Claude <[email protected]>
# Conflicts:
#	src/cli/mod.rs
…sage

Instead of negating `foreground` to `background` at the call site and carrying
the negated bool through, pass `foreground` directly through the entire call
chain — from CLI dispatch through handle_remove_output to print_message.

Refactor print_message to use success_message()/progress_message() helpers
instead of manually constructing colored output. Add FormattedMessage::append()
to support integration symbols that need their native styling outside the
message's color span.

Co-Authored-By: Claude <[email protected]>
worktrunk-bot
worktrunk-bot previously approved these changes Mar 8, 2026

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

CI failed — 11 shell wrapper / PTY snapshot tests need updating for the ◎ / ✓ color span change (symbol now outside the cyan/green span via progress_message()/success_message()). These tests are behind the shell-integration-tests feature flag so they weren't caught locally.

Failing tests (all snapshot mismatches)
  • test_approval_prompt_remove_decline
  • test_readme_example_hooks_pre_merge
  • test_readme_example_remove
  • test_wrapper_merge_with_mixed_stdout_stderr (cases 1, 2)
  • test_wrapper_merge_with_pre_merge_success (cases 1, 2)
  • test_wrapper_remove (cases 1–4)

Fix: cargo test --test integration --features shell-integration-tests and accept the snapshot updates, or run cargo insta test --accept --features shell-integration-tests.

@worktrunk-bot
worktrunk-bot dismissed their stale review March 8, 2026 23:11

CI failed — shell wrapper snapshots need updating for color span change

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

CI failed — 11 shell wrapper / PTY snapshot tests need updating for the ◎ / ✓ color span change (symbol now outside the cyan/green span via progress_message()/success_message()). These tests are behind the shell-integration-tests feature flag so they weren't caught locally.

Failing tests (all snapshot mismatches)
  • test_approval_prompt_remove_decline
  • test_readme_example_hooks_pre_merge
  • test_readme_example_remove
  • test_wrapper_merge_with_mixed_stdout_stderr (cases 1, 2)
  • test_wrapper_merge_with_pre_merge_success (cases 1, 2)
  • test_wrapper_remove (cases 1–4)

Fix: cargo test --test integration --features shell-integration-tests and accept the snapshot updates, or run cargo insta test --accept --features shell-integration-tests.

max-sixty and others added 3 commits March 8, 2026 16:18
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Clean PR — the polarity flip from background to foreground is correct at every call site, and the print_message refactor to use success_message()/progress_message() is a nice simplification.

Verified call sites (5 callers)
  • merge.rs: false (background removal) — was true for background, correctly flipped
  • select/mod.rs: true (foreground removal) — was false for background, correctly flipped
  • step_commands.rs: passes foreground directly — was !foreground, correctly simplified
  • main.rs remove command: passes foreground directly — was !is_foreground_mode(foreground, no_background) → background, correctly simplified
  • handle_removed_worktree_output: both the detached HEAD path and the main branch path correctly swap their if/else arms

Two minor observations (not blocking):

  1. flag_pair reuse for progressive — nice cleanup. The inline match was identical to flag_pair's logic.

  2. Snapshot churn — the ◎/✓ symbol now renders outside the color span (via progress_message()/success_message() helpers), which is consistent with how other messages like hook progress already render. The ~40 snapshot updates are all this same mechanical change.

LGTM.

@max-sixty max-sixty closed this Mar 8, 2026
@max-sixty max-sixty reopened this Mar 8, 2026
worktrunk-bot added a commit that referenced this pull request Mar 9, 2026
Addresses two behavioral issues observed in the past hour:

1. Bot posted identical CI failure comments twice on PR #1381 during the
   dismiss-and-recomment flow (reviews 7 seconds apart). Adds a duplicate
   check before posting CI failure comments, similar to the existing guard
   for initial reviews.

2. Bot asserted pre-commit.ci failure was "transient infrastructure" on
   PR #1381 without checking main branch CI history (recurrence of #1335
   despite fix in #1337). Adds explicit verification step with gh api
   command directly in the CI failure handling section.

Closes #1383
Closes #1384

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Resolve conflicts in format_path_mismatch_warning (3-arg signature from
#1377) and path mismatch warning snapshots.

Co-Authored-By: Claude <[email protected]>
@max-sixty
max-sixty merged commit fe56eaa into main Mar 9, 2026
22 checks passed
@max-sixty
max-sixty deleted the foreground-background branch March 9, 2026 00:25
max-sixty added a commit that referenced this pull request Mar 9, 2026
Extends the pattern from #1381 (foreground over !background) to remaining
negation patterns: no_verify→verify, skip_hooks→hooks_approved,
no_verify→run_hooks in execute_switch, skip_spacing→is_first in layout.

Co-Authored-By: Claude <[email protected]>
max-sixty added a commit that referenced this pull request Mar 9, 2026
Extends the pattern from #1381 (foreground over !background) to remaining
negation patterns: no_verify→verify, skip_hooks→hooks_approved,
no_verify→run_hooks in execute_switch, skip_spacing→is_first in layout.

Co-Authored-By: Claude <[email protected]>
max-sixty added a commit that referenced this pull request Mar 9, 2026
Extends the pattern from #1381 (`foreground` over `!background`) to
three
remaining negation patterns in the codebase:

- **`no_verify` → `verify`** in `CommitOptions`, `step_commit`,
`handle_squash`, `merge.rs` — removes `!verify` inversions at the CLI
boundary and double-negation checks like `if !self.no_verify`
- **`skip_hooks` → `hooks_approved`** / **`no_verify` → `run_hooks`** in
`handle_switch`, `select`, `execute_switch` — eliminates `!skip_hooks`
double negation
- **`skip_spacing` → `is_first`** in `layout.rs` — aligns variable name
with `try_allocate`'s parameter

No behavior changes — pure rename with polarity flip.

> _This was written by Claude Code on behalf of maximilian_

Co-authored-by: Claude <[email protected]>
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