Share --session/--file flags via @OptionGroup; drop dead PreviewHost.Mode#114
Merged
obj-p merged 1 commit intocli-mcp-parityfrom Apr 15, 2026
Merged
Conversation
…Mode Two cleanups to the CLI/MCP-parity refactor work that were deferred on the main PR. SessionTargetingOptions: - Introduce a shared @OptionGroup with --session <uuid> and --file <path>. Adopted by configure, switch, elements, touch, and stop — 5 commands whose session-resolution flags were literally duplicated with identical help text. - VariantsCommand and SnapshotCommand keep their positional `file` argument (it doubles as source-for-ephemeral-session) and their own --session Option, since the @OptionGroup's --file Option would collide with the positional. PreviewHost.Mode cleanup: - `.interactive` and `.snapshot` became unreachable after the variants migration in #109; only `.serve` was ever constructed. - Delete the Mode enum entirely. PreviewHost is now a zero-argument init. `headless` is a constant true; `keepAliveWithoutWindows` collapses into `applicationShouldTerminateAfterLastWindowClosed` returning false unconditionally. - Updated the one remaining test call site to use `PreviewHost()`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two cleanups deferred on PR #113.
SessionTargetingOptions@OptionGroupwith--session <uuid>and--file <path>.VariantsandSnapshotkeep their positionalfileargument (doubles as source-for-ephemeral-session) plus their own--sessionOption; the OptionGroup's--fileOption would collide with the positional.PreviewHost.Modecleanup.interactiveand.snapshotbecame unreachable after the variants migration in Migrate variants to daemon client #109; only.servewas ever constructed.Modeenum entirely.PreviewHostis now a zero-argument init.headlesscollapses to a constanttrue;keepAliveWithoutWindowscollapses intoapplicationShouldTerminateAfterLastWindowClosedreturningfalseunconditionally.Test plan
swift buildswift test --filter 'ElementsCommandTests|SwitchCommandTests|ConfigureCommandTests|TouchCommandTests|StopCommandTests|PreviewHostTests'— 28 tests all green.🤖 Generated with Claude Code