Skip to content

Conversation

@dongwlin
Copy link
Member

No description provided.

@dongwlin dongwlin requested a review from Copilot December 31, 2025 15:36
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Sorry @dongwlin, your pull request is larger than the review limit of 150000 diff characters

Copy link
Contributor

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

This pull request introduces significant refactoring and feature additions to the MAA Go bindings. The changes focus on reorganizing the pipeline/node code structure and adding new API capabilities.

Key Changes

  • Refactored pipeline code by extracting all Node-related types and functions from pipeline.go into a new node.go file
  • Added new resource loading methods: PostOcrModel, PostPipeline, and PostImage
  • Added support for PlayCover controller
  • Introduced new recognition types (And, Or) and node configuration fields (Repeat, RepeatDelay, RepeatWaitFreezes)
  • Updated GitHub Actions workflow to support pre-release downloads

Reviewed changes

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

Show a summary per file
File Description
resource.go Added three new Post methods for loading OCR models, pipelines, and images separately
pipeline.go Removed all Node-related code (moved to node.go), added conceptual documentation comments
node.go New file containing all Node types, methods, and helper functions previously in pipeline.go, plus new features
node_test.go New test file with basic tests for Node manipulation methods
controller.go Added NewPlayCoverController function for PlayCover support
internal/native/framework.go Registered new native functions for resource loading and PlayCover controller
.github/workflows/test.yml Updated release-downloader version and added preRelease parameter

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

Comment on lines +378 to +404
// AddNext appends a node to the next list and returns the node for chaining.
func (n *Node) AddNext(name string, opts ...NodeAttributeOption) *Node {
if name == "" {
return n
}

newItem := NodeNextItem{
Name: name,
}
for _, opt := range opts {
opt(&newItem)
}

found := false
for i, item := range n.Next {
if item.Name == name {
n.Next[i] = newItem
found = true
break
}
}

if !found {
n.Next = append(n.Next, newItem)
}
return n
}
Copy link

Copilot AI Dec 31, 2025

Choose a reason for hiding this comment

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

The AddNext method has changed behavior to update existing items with the same name instead of ignoring duplicates. This is a breaking change that should be covered by tests. Consider adding a test case that verifies when calling AddNext with the same name but different options (e.g., WithJumpBack()), the existing item is updated with the new options.

Copilot uses AI. Check for mistakes.
Comment on lines +419 to +445
// AddOnError appends a node to the on_error list and returns the node for chaining.
func (n *Node) AddOnError(name string, opts ...NodeAttributeOption) *Node {
if name == "" {
return n
}

newItem := NodeNextItem{
Name: name,
}
for _, opt := range opts {
opt(&newItem)
}

found := false
for i, item := range n.OnError {
if item.Name == name {
n.OnError[i] = newItem
found = true
break
}
}

if !found {
n.OnError = append(n.OnError, newItem)
}
return n
}
Copy link

Copilot AI Dec 31, 2025

Choose a reason for hiding this comment

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

The AddOnError method has changed behavior to update existing items with the same name instead of ignoring duplicates. This is a breaking change that should be covered by tests. Consider adding a test case that verifies when calling AddOnError with the same name but different options (e.g., WithAnchor()), the existing item is updated with the new options.

Copilot uses AI. Check for mistakes.
@dongwlin
Copy link
Member Author

@sourcery-ai title

@sourcery-ai sourcery-ai bot changed the title Dev feat: add PlayCover controller and new resource posts Dec 31, 2025
@dongwlin dongwlin merged commit 1dba8be into main Dec 31, 2025
10 checks passed
@dongwlin dongwlin deleted the dev branch December 31, 2025 16:02
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.

2 participants