Make forge flips really detailed - #1528
Open
Ekwav wants to merge 6 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the “forge flips” (and craft flips) UX by adding a detailed, interactive cost breakdown that can expand/collapse subcrafts, combine duplicate materials into a single shopping list, and compare “buy orders” vs “no-wait (NPC + insta-buy)” acquisition costs.
Changes:
- Introduces a shared
CostBreakdownUI (combined shopping list + recipe breakdown + craft-depth control + no-wait mode) and wires it into both forge flip details and craft details. - Adds new crafting utilities to combine ingredient trees, limit expansion depth, and estimate direct-buy cost using acquisition plans.
- Improves acquisition pricing logic (handling inconsistent backend price fields), adds deep-link opening for craft details, and adds Cypress coverage for the new flows.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/Parser/APIResponseParser.tsx | Extends parseProfitableCrafts to allow parsing a subset while using another set for subcraft expansion. |
| utils/Formatter.tsx | Adjusts acquisition price selection to preserve “order=min / insta=max” invariant across inconsistent backend fields. |
| utils/CraftingUtils.ts | Adds helpers for craft depth limiting, combined shopping lists, and direct-buy cost estimation. |
| components/CraftsList/CostBreakdown/CostBreakdown.tsx | New shared detailed breakdown component (shopping list + recipe tree + toggles). |
| components/CraftsList/CostBreakdown/CostBreakdown.module.css | Styles for the new breakdown UI. |
| components/CraftsList/IngredientList/IngredientList.tsx | Upgrades ingredient rows with acquisition compare button, collapse/expand behavior, and richer savings display. |
| components/CraftsList/IngredientList/IngredientList.module.css | Adds button styling for the new controls. |
| components/CraftsList/CraftDetails/CraftDetails.tsx | Switches craft details from raw ingredient list to the shared CostBreakdown. |
| components/CraftsList/CraftsList.tsx | Adds deep-link support (?craft=) by initially opening a specific craft and rendering enough items to include it. |
| components/ForgeFlips/ForgeFlips.tsx | Reworks forge flip cards + click details modal to use CostBreakdown, adds “no-wait flips only” filtering, and loads subcraft data on demand. |
| components/ForgeFlips/ForgeFlips.module.css | New layout/styling for the enhanced forge flips UI. |
| components/Tooltip/Tooltip.tsx | Adds initiallyOpen to support deep-linked/open-by-default modal tooltips. |
| components/Premium/PremiumPurchaseWizard/Steps/DurationSelectionStep.tsx | Expands the Starter quarterly CoflCoins display string with total pricing details. |
| app/crafts/page.tsx | Adds ?craft= query parsing to open a craft detail from deep links. |
| cypress/e2e/forge.cy.ts | New end-to-end coverage for forge flip breakdown + no-wait behavior. |
| cypress/e2e/crafts.cy.ts | Extends crafts E2E to assert new breakdown sections and craft deep-link opening behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+12
to
+15
| export default async function Page({ searchParams }: { searchParams: Promise<{ craft?: string | string[] }> }) { | ||
| let api = initAPI(true) | ||
| let [crafts, bazaarTags] = await Promise.all([api.getProfitableCrafts(), api.getBazaarTags()]) | ||
| let [crafts, bazaarTags, params] = await Promise.all([api.getProfitableCrafts(), api.getBazaarTags(), searchParams]) | ||
| let openCraftTag = Array.isArray(params.craft) ? params.craft[0] : params.craft |
Comment on lines
95
to
+99
| let popover = ( | ||
| <Popover id={`acquisition-plan-${ingredient.item.tag}`} style={{ maxWidth: 360 }}> | ||
| <Popover.Header>Buy {numberWithThousandsSeparators(plan.totalCount)}× {ingredient.item.name}</Popover.Header> | ||
| <Popover.Header> | ||
| Buy {numberWithThousandsSeparators(plan.totalCount)}× {ingredient.item.name} | ||
| </Popover.Header> |
Comment on lines
+62
to
+66
| <Form.Check | ||
| type="switch" | ||
| id="modal-no-wait-costs" | ||
| label="No-wait flips only — use NPC + insta-buy costs" | ||
| checked={noWait} |
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.
No description provided.