Skip to content

Adds inspect-live skill and e2e-dev-inspect script for UI inspection with Playwright#5070

Open
sergeibbb wants to merge 1 commit intomainfrom
chore/inspect-live-skill
Open

Adds inspect-live skill and e2e-dev-inspect script for UI inspection with Playwright#5070
sergeibbb wants to merge 1 commit intomainfrom
chore/inspect-live-skill

Conversation

@sergeibbb
Copy link
Copy Markdown
Member

@sergeibbb sergeibbb commented Mar 25, 2026

Adds /inspect-live — Playwright-based live extension inspection

Adds a CLI tool (scripts/e2e-dev-inspect.mjs) that launches a real VS Code instance with GitLens and lets you programmatically inspect it via Playwright — read UI text, query webview DOM, check accessibility trees, search extension logs, take screenshots, and evaluate runtime values.

Why: There was no lightweight way to answer "what does the running extension actually show?" without manually launching VS Code or writing a throwaway E2E test. This is especially useful for AI-assisted workflows where an agent needs to verify UI state, feature flag behavior, or debug output.

What's included:

  • scripts/e2e-dev-inspect.mjs — the CLI with composable, ordered actions (--command, --query-frame, --aria, --logs, --screenshot, --eval, etc.)
  • .claude/skills/inspect-live/SKILL.md — skill doc for AI agents
  • AGENTS.md — registers the new skill

CLI examples:

# What heading does the Welcome view show?
node scripts/e2e-dev-inspect.mjs --command gitlens.showWelcomeView --query-frame h1

# Check feature flags against dev API
node scripts/e2e-dev-inspect.mjs --env dev --logs FeatureFlagService

# Get accessibility tree of Home view
node scripts/e2e-dev-inspect.mjs --command gitlens.showHomeView --aria

AI agent examples:

Is the new banner showing up in the Home view?

Agent runs /inspect-live, builds the extension, executes --command gitlens.showHomeView --query-frame ".banner h2", and reports back the text content — or confirms the element doesn't exist.

The Welcome view heading is wrong for dev environment users

Agent runs /inspect-live with --env dev --command gitlens.showWelcomeView --query-frame h1 --logs FeatureFlagService to see both the rendered heading and the flag evaluation logs, pinpointing whether the issue is in the flag config or the rendering logic.

Two modes: Development (default, respects gitkraken.env) and Test (--with-evaluator, enables evaluate() for runtime inspection). Each run uses an isolated temp directory — no interference with your real VS Code.

@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Mar 25, 2026

🤖 Augment PR Summary

Summary: Introduces a new /inspect-live workflow to launch VS Code with GitLens and inspect/interact with the running UI using Playwright.

Changes:

  • Adds .claude/skills/inspect-live/SKILL.md documenting recipes for querying webview DOM, printing aria snapshots, evaluating runtime values (via evaluator mode), reading logs, and taking screenshots.
  • Updates AGENTS.md to list /inspect-live among the available skills.
  • Adds scripts/e2e-dev-inspect.mjs, a CLI that launches VS Code with a temp user-data dir, applies provided settings, waits for activation, and executes ordered actions like --command, --query/--query-frame, --click/--click-frame, --aria, --logs, --screenshot, and --pause.
  • Supports two launch modes: Development mode (uses settings like gitkraken.env) and Test mode (--with-evaluator) which connects to the VS Code test server and enables extension-host evaluate().

Technical Notes: The script reuses the E2E runner’s test-server bridge approach (via Playwright Electron internals) and prints structured stdout markers (e.g. >>> query-frame, >>> aria, >>> eval) intended for automated agent parsing.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new “live inspection” workflow for running GitLens inside a real VS Code instance and inspecting/interacting with the UI via Playwright, documented as an agent skill.

Changes:

  • Adds scripts/e2e-dev-inspect.mjs, a CLI for launching VS Code + GitLens and running ordered inspection actions (ARIA snapshots, DOM queries, clicks, screenshots, log search, optional evaluator bridge).
  • Adds a new /inspect-live skill documenting how to use the script for UI/log/runtime inspection.
  • Updates AGENTS.md to reference the new skill.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
scripts/e2e-dev-inspect.mjs New Playwright-based VS Code launcher + inspection CLI (actions, optional evaluator bridge, log search, screenshots).
AGENTS.md Adds /inspect-live to the available skills table.
.claude/skills/inspect-live/SKILL.md Documents the new skill, modes, and common usage recipes for the inspection script.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sergeibbb sergeibbb force-pushed the chore/inspect-live-skill branch from 0de6de4 to eb20df9 Compare March 25, 2026 22:20
@sergeibbb sergeibbb requested a review from Copilot March 25, 2026 22:20
@sergeibbb
Copy link
Copy Markdown
Member Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sergeibbb sergeibbb force-pushed the chore/inspect-live-skill branch from eb20df9 to 6ae55c2 Compare March 25, 2026 23:02
@sergeibbb
Copy link
Copy Markdown
Member Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sergeibbb sergeibbb force-pushed the chore/inspect-live-skill branch 2 times, most recently from afe4046 to c623406 Compare March 26, 2026 17:24
@sergeibbb
Copy link
Copy Markdown
Member Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 4 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sergeibbb
Copy link
Copy Markdown
Member Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 4 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sergeibbb
Copy link
Copy Markdown
Member Author

augment review

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sergeibbb sergeibbb force-pushed the chore/inspect-live-skill branch from c42f5b9 to 21bd4a8 Compare March 27, 2026 19:11
@sergeibbb sergeibbb requested a review from d13 March 27, 2026 19:26
@sergeibbb sergeibbb requested review from eamodio and ramin-t March 27, 2026 19:26
@sergeibbb sergeibbb assigned sergeibbb and d13 and unassigned ramin-t Mar 27, 2026
Copy link
Copy Markdown
Contributor

@ramin-t ramin-t left a comment

Choose a reason for hiding this comment

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

Looks neat - looking forward to trying it

Comment on lines +196 to +216
function findVSCode(explicit) {
if (explicit) return explicit;
const candidates = [
'/Applications/Visual Studio Code.app/Contents/MacOS/Electron',
`${os.homedir()}/Applications/Visual Studio Code.app/Contents/MacOS/Electron`,
// Linux — Electron binaries (not wrapper scripts like /usr/bin/code)
'/usr/share/code/code', // deb/rpm install
`${os.homedir()}/.local/share/code/code`, // user-local install
'/snap/code/current/usr/share/code/code', // snap install
];
if (process.env.LOCALAPPDATA) {
candidates.push(`${process.env.LOCALAPPDATA}/Programs/Microsoft VS Code/Code.exe`);
}
if (process.env.ProgramFiles) {
candidates.push(`${process.env.ProgramFiles}/Microsoft VS Code/Code.exe`);
}
for (const c of candidates) {
if (existsSync(c)) return c;
}
throw new Error('Could not find VS Code. Provide --vscode-path.');
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would be nice to detect and use insiders if the user prefers it (it lives in a different folder)

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.

4 participants