feat(app): frame a device capture as the device - #368
Merged
Conversation
Greptile SummaryThe PR frames native-device screenshots according to their decoded dimensions and replaces desktop browser chrome with a device label.
Confidence Score: 5/5The PR appears safe to merge; the previously outstanding deferred-sizing issue is fixed and no new actionable failures were found. The deferred callback now verifies that snapshot mode is still active before applying device dimensions, and frame geometry now includes section borders. The earlier empty-mutation classification thread was manually resolved without explanation; under the current thread state it is not outstanding.
|
| Filename | Overview |
|---|---|
| packages/app/src/components/browser/snapshot.ts | Selects device framing for native screenshots, guards deferred sizing against mode changes, and retains browser framing when URL or DOM evidence exists. |
| packages/app/src/components/browser/device-frame.ts | Implements device chrome, computed frame insets, and capture-aspect-aware geometry. |
| packages/app/src/components/browser/snapshot-styles.ts | Adds styling for the device-specific header and label. |
| packages/app/test-ui/workbench/player/snapshot.test.ts | Covers device chrome, capture geometry, screencast transitions, and mobile-browser classification. |
| packages/app/tests/device-frame.test.ts | Verifies frame fitting and padding-plus-border inset calculations. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Captured screenshot] --> B{Device metadata present?}
B -- No --> C[Render browser chrome]
B -- Yes --> D{DOM mutations or metadata URL?}
D -- Yes --> C
D -- No --> E[Decode screenshot dimensions]
E --> F[Render device chrome]
F --> G[Fit capture within pane]
G --> H[Add header, padding, and borders]
H --> I[Set device-shaped section size]
Reviews (2): Last reviewed commit: "fix(app): correct three defects in the d..." | Re-trigger Greptile
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.
What & why
Type of change
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