Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d6f9abf8b6
ℹ️ 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".
frontend/src/lib/applyCommands.ts
Outdated
| merged.fleets = merged.fleets.filter( | ||
| (fleet) => (fleet.composition ?? []).reduce((sum, c) => sum + c.count, 0) > 0, |
There was a problem hiding this comment.
Preserve non-target fleets during merge/split cleanup
Restrict the post-merge cleanup to fleets touched by the merge_split_fleets command; this global filter currently drops any fleet with unknown/empty composition. In player state, visible enemy fleets usually have composition unset, so staging a merge/split immediately removes those enemy fleets from the optimistic view (map/orbit panels) until a refresh, which gives the player an incorrect tactical state.
Useful? React with 👍 / 👎.
frontend/src/lib/applyCommands.ts
Outdated
| id: entry.fleetId, | ||
| owner: playerState.player, | ||
| name: entry.name ?? entry.fleetId, | ||
| position: merged.fleets[0]?.position ?? { x: 0, y: 0 }, |
There was a problem hiding this comment.
Set tmp fleet position from the merged group location
Use the location of the fleets referenced by the command when creating a tmp_ fleet. This code assigns position from merged.fleets[0], which can be an unrelated fleet elsewhere in the galaxy; in that case, a newly split fleet appears at the wrong coordinates in the optimistic UI and follow-up local actions (selection/waypoint planning) are based on the wrong origin.
Useful? React with 👍 / 👎.
No description provided.