Repository navigation
角色管理 - #677
角色管理#677
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24ace5b2d2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| nextLayers.splice(toIndex, 0, moved); | ||
| return { ...doc, layers: nextLayers }; |
There was a problem hiding this comment.
Keep preset ordering consistent with reordered layers
When layers belonging to an existing preset are reordered, this operation changes only doc.layers, leaving the preset's bottom-to-top array unchanged. For example, moving face below base changes the canvas order to [face, base] but still saves presets.normal as [base, face]. CharacterCanvas also renders exclusively in global layer order, so selecting that preset conceals the discrepancy. Update the affected preset ordering along with the layers, or render preset-specific ordering so the preview accurately represents the saved preset.
Useful? React with 👍 / 👎.
| const components = Object.fromEntries( | ||
| [...doc.layers].reverse().map((layer) => [layer.key, serializeComponent(layer.component)]), | ||
| ); |
There was a problem hiding this comment.
Prevent numeric layer names from losing their saved order
For layers named with integer strings, such as those automatically derived from 1.png and 2.png, Object.fromEntries enumerates the component keys in numeric order regardless of the requested layer order. Consequently, a top-to-bottom layer list of ["1", "2"] becomes ["2", "1"] after serialization and parsing. Dragging these layers therefore cannot reliably persist their stacking order. Generate and validate non-integer layer keys, or use an ordering representation that survives the JSON round trip.
Useful? React with 👍 / 👎.
No description provided.