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 latest and trending builds list to the build list module #7389

Merged
merged 66 commits into from
Jul 25, 2024

Conversation

canuysal
Copy link
Contributor

@canuysal canuysal commented Mar 17, 2024

Description of the problem being solved:

  • Adds a builds list to the BuildList module that displays latest and trending builds that is fetched from the PoB Archives.
  • Adds responsive behaviour to the builds menu.

Steps taken to verify a working solution:

  • Tested fetching errors for connection errors, empty build list, some of the keys are missing and success.
  • Display status messages depending on the fetch state.
  • Checked cpu usage with the new list.
  • Checked for invalid and missing pobb links while importing builds

Before screenshot:

Screenshot from 2024-03-17 20-12-36

After screenshot:

Screenshot from 2024-03-20 16-41-21

@Paliak Paliak added the enhancement New feature, calculation, or mod label Mar 17, 2024
Copy link
Member

@Wires77 Wires77 left a comment

Choose a reason for hiding this comment

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

Thanks for the submission, this looks pretty interesting! I took a brief look at the code and the feature and I do like what I've seen so far. I'll start off by saying I'm usually pretty conservative about website tie-ins like this, for several reasons:

  • Styling is easier/more freeform in a browser (e.g. "Open in PoB" button and you can style the list however you want)
  • Maintenance in case the API changes
  • Potential need to integrate with many build list provider websites and keep those up-to-date
  • Security concerns about opening malformed builds or malicious links due to bugs/website neglect

Specific concerns for a build list website include the risk of baiting users into bad builds (especially non-beginner builds, given that lack of context available in a list like this), influencing the meta just based on how builds are sorted and (if multiple sites are implemented) which site is displayed by default, and build rot due to an outdated game version.

If we decide to integrate this, there are some changes that I'd like to see to improve it:

  • Make the list website-agnostic. If we integrate pobarchives support, I can easily see others asking for support for their sites.
    • Dropdown at the top showing the website this list is coming from
    • More generic API
      • Latest vs. Trending might not exist for every site
      • Character name probably isn't needed
      • Mapping file/function needed for each site
  • Ascendancy assets can be found in TreeData. I'd love to be able to use those somehow instead of adding duplicate images.
  • There's a scrollbar, but scrolling far enough stops showing builds.
  • Styling of Trending vs. Latest is a bit misleading, as they're styled like tabs, but the active-looking tab is actually the inactive one (and is clickable)
  • Some display issues when in portrait mode:
    image

I haven't taken a fine-toothed comb to the code yet, but what I saw seemed pretty well done, so kudos for that and for a decent style otherwise!

src/Classes/ArchivesListControl.lua Outdated Show resolved Hide resolved
@canuysal canuysal force-pushed the feature/pobarchiveslist branch from 1ef4dd1 to 1cf2f59 Compare March 27, 2024 02:57
@canuysal
Copy link
Contributor Author

@Wires77 Please take another look, requested changes are done, and I also implemented the similar builds list as I promised in the discord.


New feature, Similar Builds

similarbuilds

  • Similar Builds button is hidden by default unless the build is imported from somewhere.
  • In order for this to work, I'm saving the import links into the xml's Import node. We can also use this for features such as "Reset to imported version" button in import tab, or we can convert this into a tree to introduce versioning in PoB. I didn't add those since it's out of scope, but let me know if you are interested and we can discuss it further.
  • Once the button is pressed, I make an API call to see if there are similar builds for the current build in the Archives. Other build providers can also implement their own API's and lists for this (See the fixes section, lists are now website agnostic.)
  • My implementation can only find similar builds if the current one's root build are already added to the Archives and classified by the algorithm. Since I'm collecting almost every build from the youtube and reddit, I think it should work for many. If the build is not in the Archives, list will just say "No builds found."

Fixes

  • Lists are now website agnostic. Providers can implement their own lists by inheriting ExtBuildListProvider abstract class and adding it the provider list in relevant modules. Please let the PoB Archives stay the default as a courtesy for my efforts.
  • API's are now modular. Each provider can list their API's as multiple tabs and implement fetching on their classes.
  • Fixed responsiveness issues.
  • Fixed the issue where tab buttons not indicating the active one correctly.
  • Author names are now hidden, but please uncomment that part in ExtBuildList:Draw function and try it with author names while you are reviewing. I think including author names would be better because people would be more interested if a build is from a reliable youtuber/build maker they know.
  • Builds listed in this list, if they are coming from the PoB Archives, will be filtered for edits from now on. So if users edit their builds in any way in the site, it wont be listed to prevent title abuse and injection.
  • I didn't remove the new ascendancy portraits, I tried the ones in TreeData but they are made for TreeView, and I think they look bad as 80x80 portraits, also indistinguishable. I can still use the ones in TreeData or move new ones to an appropriate place, please let me know.

wideangleascendancies1


Known issues, need help

Please point me in the right direction for these issues, direct fixes by others are also appreciated.

  • While in Tree View, similar builds list and the tree share the scrollbar. I'm guessing this can be fixed in PassiveTreeView.
  • Scrollbar doesn't snap to the bottom while scrolling and makes multiple round trips up and down.
  • In the Builds module, scrollbar doesn't start working until the list is clicked.

known_issues

Feel free to add new commits fellow PoB Warriors, I'm happy to share this PR and any help/improvement is appreciated.

@canuysal canuysal requested a review from Wires77 May 23, 2024 21:43
@canuysal canuysal requested review from Wires77 and Nightblade July 22, 2024 07:07
src/Modules/Build.lua Outdated Show resolved Hide resolved
@canuysal canuysal requested a review from Nightblade July 22, 2024 22:53
Copy link
Member

@Wires77 Wires77 left a comment

Choose a reason for hiding this comment

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

Couple of small nitpicks on those buttons, but this already looks way better. The usual pattern in PoB is to create those buttons on class init and only draw them in the Draw function. Reason being Draw is called every frame so doing as little logic as possible in there is the better play.

src/Classes/ExtBuildListControl.lua Outdated Show resolved Hide resolved
src/Classes/ExtBuildListControl.lua Outdated Show resolved Hide resolved
@Wires77 Wires77 merged commit 8bea7bd into PathOfBuildingCommunity:dev Jul 25, 2024
1 of 2 checks passed
mykongee added a commit to mykongee/PathOfBuilding that referenced this pull request Jul 25, 2024
@Bellabong
Copy link

If anything, this should link directly to the build link that Divina scraped from, and not to PoB Archives.

@Araxeus
Copy link

Araxeus commented Jul 25, 2024

FYI This PR is a hot topic on reddit

https://www.reddit.com/r/pathofexile/comments/1ec10fo/path_of_building_has_been_hijacked_by_a_forprofit/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature, calculation, or mod
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants