Skip to content

fix: capture a hybrid app's webview half as a page - #384

Merged
vishnuv688 merged 9 commits into
mainfrom
fix/376-follow-the-runtime-context
Sep 21, 2026
Merged

vishnuv688 merged 9 commits into
mainfrom
fix/376-follow-the-runtime-context

Conversation

@vishnuv688

@vishnuv688 vishnuv688 commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

What & why

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Polish (an improvement to an existing feature)
  • Breaking change (existing behavior changes for users)
  • Documentation
  • Internal (build, CI, dependencies, tooling)

Packages touched

  • shared (types and contracts)
  • core (framework-agnostic capture/reporting)
  • elements (published element/snapshot API — @wdio/elements)
  • service (WebdriverIO adapter)
  • nightwatch-devtools (Nightwatch adapter)
  • selenium-devtools (Selenium adapter)
  • selenium-devtools-py (Selenium Python adapter)
  • backend (server)
  • app (UI)
  • script (page-injected runtime)
  • trace (Trace mode)

Notes for reviewers

Screenshots / recordings

@greptile-apps

greptile-apps Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The changes since the previous review appear safe to merge, with no new actionable defects identified.

Findings

  1. P1 In player mode, the saved vertical split can be as large as 70% of the window, but the device column is shorter after accounting for the header, playback controls, and timeline. This applies that value as a non-shrinking flex-basis without the documented max-height cap. The action list can therefore exceed the column, collapse the dock to zero height, and place the resize handle outside the clipped row, leaving the split inaccessible. Keep the controller’s literal flex-basis while capping the top pane to the available column height. ▶

Summary

This PR makes capture behavior follow a hybrid Appium session’s runtime context and renders replayed portrait mobile captures using the device-oriented workbench layout.

  • Introduces a shared context-aware document predicate and tracks successful Appium context switches.
  • Uses native snapshots only while the session is in NATIVE_APP, while avoiding in-hook page probes for Appium webviews.
  • Restores per-action snapshots for native Appium traces without running document scripts.
  • Adds replay device sizing and adjusts the device-column split, dock, controls, and tests.
  • The previously reported device-layout split issues are addressed by capping and refreshing the controller’s actual position rather than applying a separate CSS-only cap.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[WebDriver command hook] --> B{Appium session?}
    B -->|No| C[Capture page action snapshot]
    B -->|Yes| D{Current context has document?}
    D -->|NATIVE_APP| E[Capture native source and screenshot]
    D -->|Webview| F[Skip in-hook action probes]
    G[Successful switchContext] --> H[Update currentContext]
    H --> D
    C --> I[Trace action evidence]
    E --> I
    F --> J[Collector and command evidence]
    I --> K[Trace player]
    J --> K
    K --> L{Portrait mobile geometry?}
    L -->|Yes| M[Device-column layout]
    L -->|No| N[Stacked desktop layout]
Loading

Reviews (8) · Last reviewed commit: "fix(service): skip per-action capture on..."

Comment thread packages/app/src/components/browser/snapshot.ts
@greptile-apps

This comment has been minimized.

Comment thread packages/app/src/components/workbench.ts Outdated
Comment thread packages/app/src/components/workbench.ts
Comment thread packages/app/src/components/workbench.ts Outdated
@vishnuv688
vishnuv688 merged commit c9a01ef into main Sep 21, 2026
11 checks passed
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.

Hybrid sessions lose webview DOM capture: native detection is fixed at session start

1 participant