feat: mark tap/swipe UI operation

This commit is contained in:
lilong.129
2025-05-05 16:31:13 +08:00
parent 6569121d5d
commit cfc71819d2
12 changed files with 438 additions and 88 deletions

View File

@@ -132,6 +132,7 @@ func (o *ActionOptions) Options() []ActionOption {
options = append(options, o.GetScreenShotOptions()...)
options = append(options, o.GetScreenRecordOptions()...)
options = append(options, o.GetMarkOperationOptions()...)
return options
}

View File

@@ -8,6 +8,7 @@ type ScreenOptions struct {
ScreenShotOptions
ScreenRecordOptions
ScreenFilterOptions
MarkOperationOptions
}
type ScreenShotOptions struct {
@@ -273,3 +274,29 @@ func WithIndex(index int) ActionOption {
o.Index = index
}
}
// MarkOperationOptions contains options for marking UI operations
type MarkOperationOptions struct {
// mark UI operation, enable/disable UI operation marking
MarkOperationEnabled bool `json:"mark_operation_enabled,omitempty" yaml:"mark_operation_enabled,omitempty"`
}
func (o *MarkOperationOptions) GetMarkOperationOptions() []ActionOption {
options := make([]ActionOption, 0)
if o == nil {
return options
}
if o.MarkOperationEnabled {
options = append(options, WithMarkOperationEnabled(true))
}
return options
}
// WithMarkOperationEnabled enables or disables UI operation marking
func WithMarkOperationEnabled(enabled bool) ActionOption {
return func(o *ActionOptions) {
o.MarkOperationEnabled = enabled
}
}