Repository navigation
feat(diff): add -i/--interactive to diff snapshot - #2545
Open
cavalcanticampos wants to merge 1 commit into
Open
cavalcanticampos wants to merge 1 commit into
cavalcanticampos wants to merge 1 commit into
Conversation
`snapshot -i` output could not be diffed: `diff snapshot` always captured the full tree, so every non-interactive line showed up as a change. The flag now passes `interactive` to the snapshot the diff takes, as `snapshot -i` does. The MCP tool takes an `interactive` boolean (default false, so existing calls are unchanged). Fixes vercel-labs#1647 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
@cavalcanticampos is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
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.
Fixes #1647.
What changes for users
diff snapshotaccepts-i/--interactive, the same flag assnapshot. A baseline saved fromsnapshot -ican now be diffed without every static line showing up as a change:Changes
cli/src/commands.rs: parse-i/--interactiveinto"interactive": true; usage strings list it.cli/src/native/actions.rs:handle_diff_snapshotpassesinteractivetoSnapshotOptions.cli/src/mcp.rs:agent_browser_diff_snapshottakes aninteractiveboolean and forwards--interactive. Default isfalse, so existing MCP calls behave as before (note the MCPsnapshottool defaultsinteractivetotrue; I left the diff default alone rather than change existing output). The argument building moved intodiff_snapshot_command_args, followingsnapshot_command_args, so it can be tested against the CLI parser.packages/@agent-browser/sandbox/mcp-tools.json: regenerated withAGENT_BROWSER_UPDATE_MCP_TOOLS=1.--helpoutput anddocs/content/docs/diffing.mdxoptions table document the flag.Verification
On Linux (WSL2), rustc 1.99:
cargo fmt -- --check,cargo clippy -- -D warnings: clean.cargo test: all pass, includingtest_diff_snapshot_interactive(both spellings, absent by default) anddiff_snapshot_arguments_use_canonical_cli_command(MCP arguments go through the CLI parser and come out with the sameinteractive,baseline,selectorand depth), plusmcp_tool_catalog_snapshot_is_current.e2e_diff_snapshot_interactive_matches_interactive_baseline(headless Chrome,snapshot_diff_probefixture): a baseline fromsnapshot -idiffs as changed without the flag and as unchanged with it.cargo test e2e_diff -- --ignored --test-threads=1: all pass.Not run: the docs site suite. The docs change is one table row.
Companion to #2544 (bare
diff snapshotcompares against the last snapshot, #1755). The two touch neighbouring lines inhandle_diff_snapshot; whichever lands second needs a trivial rebase, which I'm happy to do.🤖 Generated with Claude Code