refactor(core): unify UI context parsing and screenshot handling#1994
Open
refactor(core): unify UI context parsing and screenshot handling#1994
Conversation
Deploying midscene with
|
| Latest commit: |
027f97f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9ba8871a.midscene.pages.dev |
| Branch Preview URL: | https://zzy-ui-context.midscene.pages.dev |
0328c7b to
9bf9032
Compare
- Move screenshot scaling logic from Agent to commonContextParser - Remove screenshotScale calculation from Agent class - Centralize shrink factor computation in commonContextParser - Automatically resize screenshots to match logical dimensions - Remove deprecated getContext method from AbstractInterface - Delete getContext implementations across all platforms (web, chrome-extension, puppeteer) - Simplify context retrieval to use commonContextParser uniformly - Standardize screenshot data structure - Replace screenshotBase64 field usage with ScreenshotItem.create() - Update StaticPage to use screenshot property consistently - Remove legacy compatibility layer for screenshotBase64 - Clean up type definitions - Remove WebUIContext type alias (use UIContext directly) - Delete PlaygroundWebUIContext related types - Update imports across packages - Consolidate context parsers - Remove WebPageContextParser (superseded by commonContextParser) - Update all usages to use commonContextParser from @midscene/core/agent - Simplify evaluation and test utilities This refactoring unifies UI context handling across all device types, reduces code duplication, and improves maintainability by centralizing screenshot processing logic in a single location.
9bf9032 to
027f97f
Compare
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.
Move screenshot scaling logic from Agent to commonContextParser
Remove deprecated getContext method from AbstractInterface
Standardize screenshot data structure
Clean up type definitions
Consolidate context parsers
This refactoring unifies UI context handling across all device types, reduces code duplication, and improves maintainability by centralizing screenshot processing logic in a single location.