[CodeCleanup] Replace individual optimization calls with recipeData:Optimize#1104
Merged
derfloh205 merged 4 commits intomainfrom Mar 23, 2026
Merged
Conversation
…ize in CraftQueue Co-authored-by: derfloh205 <9341090+derfloh205@users.noreply.github.com> Agent-Logs-Url: https://github.com/derfloh205/CraftSim/sessions/be3bf98d-e82a-4e0d-a2fa-04d111a8b47b
Copilot
AI
changed the title
[WIP] Refactor optimization calls to use RecipeData.Optimize
[CodeCleanup] Replace individual optimization calls with recipeData:Optimize
Mar 21, 2026
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.
RecipeData:Optimizeis the canonical async method for orchestrating recipe optimization steps, but several call sites were still manually chainingOptimizeGear/OptimizeReagents/OptimizeConcentration/OptimizeFinishingReagentswith nested callbacks and conditional branching.Changes
CraftQueue:QueueOpenRecipe— replaced conditional chain ofOptimizeGear→OptimizeReagents→OptimizeConcentration(with splitif/elsefor async concentration path) with a singlerecipeData:Optimizecall; button is now consistently disabled for the full duration of optimizationCraftQueue/UI.luaoptimizeProfitButton — resolved the existingTODO: Refactor using RecipeData:Optimize; replacedOptimizeGear+RunNextFrame(OptimizeReagents → OptimizeConcentration → OptimizeFinishingReagents)nested callback pyramid with a singlerecipeData:OptimizecallRunNextFrame(OptimizeReagents + queueRecipe)branches (patron vs. normal order) with a singlerecipeData:Optimize { optimizeReagentOptions = ..., finally = queueRecipe }Before (UI optimize button):
After:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.