Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pills for more Loadout Analysis / Warnings / Upgrade possibilities #10012

Merged
merged 10 commits into from
Oct 31, 2023

Conversation

robojumper
Copy link
Member

@robojumper robojumper commented Oct 29, 2023

grafik

Goals:

  • Be able to run potentially slightly longer checks on many loadouts, potentially also running the process worker (async) in the background
  • Integrate the existing loadout warnings into this framework
  • Add more warnings such as "mods don't fit", info such as "you still need to upgrade these armor pieces to fit mods / hit stats", or upgrades such as "there are better tiers available".

I previously did something similar in #9566 but it did not work well across components and abused React for task scheduling. This one uses a bit of a custom task queue for submitting loadouts for analysis, caching the results, and getting results asynchronously using React.useSyncExternalStore.

This custom task queue prioritizes analysis requests and will ensure that loadouts the user is looking at (which works because of loadouts list virtualization) are analysed first, and everything else is analyzed in the background.

@robojumper robojumper force-pushed the loadout-analysis branch 2 times, most recently from 52cc1c1 to a4d6435 Compare October 31, 2023 00:04
@robojumper robojumper temporarily deployed to pr October 31, 2023 00:05 — with GitHub Actions Inactive
@robojumper robojumper marked this pull request as ready for review October 31, 2023 00:09
Copy link
Contributor

@bhollis bhollis left a comment

Choose a reason for hiding this comment

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

Epic! This was a great read, lots of fantastic changes in here. The feature works well and I'm excited to be able to surface all this advice to users - I think it'll help them discover LO as well.

config/i18n.json Outdated Show resolved Hide resolved
config/i18n.json Outdated Show resolved Hide resolved
config/i18n.json Outdated Show resolved Hide resolved
config/i18n.json Show resolved Hide resolved
} {
autoStatMods: boolean,
/** If set, only sets where at least one stat **exceeds** `resolvedStatConstraints` minimums will be returned */
strictUpgrades: boolean,
Copy link
Contributor

Choose a reason for hiding this comment

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

I see where you're going with this, and I love it!

src/app/loadout-analyzer/store.ts Outdated Show resolved Hide resolved
src/app/loadout-analyzer/store.ts Outdated Show resolved Hide resolved
src/app/loadout-analyzer/store.ts Show resolved Hide resolved
src/app/loadout-analyzer/store.ts Outdated Show resolved Hide resolved
@@ -60,7 +64,12 @@ export default function LoadoutsContainer({ account }: { account: DestinyAccount
return <ShowPageLoading message={t('Loading.Profile')} />;
}

return <Loadouts account={account} />;
// TODO: how high in our tree do we want this analyzer?
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems fine, though if you moved it down into Loadouts I bet you could directly assign selectedStoreId as a prop rather than having to use useUpdateLoadoutAnalysisContext.

Copy link
Member Author

Choose a reason for hiding this comment

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

I actually did that first but ran into the issue that the useSummaryLoadoutsAnalysis hook also needs to exist in Loadouts and that one needs the context outside of it.

There's also a case to be made for placing it even higher in the tree (around our routes) since right now navigating away from the Loadouts page cleans up the analyzer and discards all results.

@robojumper robojumper temporarily deployed to pr October 31, 2023 09:16 — with GitHub Actions Inactive
@robojumper robojumper temporarily deployed to pr October 31, 2023 12:57 — with GitHub Actions Inactive
@robojumper robojumper temporarily deployed to pr October 31, 2023 18:42 — with GitHub Actions Inactive
@robojumper robojumper temporarily deployed to pr October 31, 2023 19:42 — with GitHub Actions Inactive
@robojumper robojumper merged commit 87a4c14 into DestinyItemManager:master Oct 31, 2023
4 checks passed
@robojumper robojumper deleted the loadout-analysis branch October 31, 2023 19:47
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