Skip to content

Feature: Modal to allow users to list directly from inventory to CSFloat #288

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

Merged
merged 47 commits into from
May 16, 2025

Conversation

IzaakPrats
Copy link
Contributor

@IzaakPrats IzaakPrats commented Feb 2, 2025

Issue #277 List from Inventory

This PR adds the ability to list items directly on CSFloat from the Steam inventory. Users can create both buy now and auction listings with a streamlined interface.

Features

  • Direct listing creation from Steam inventory
  • Support for both Buy Now and Auction listing types
  • Recommended price fetching from CSFloat*
  • Price adjustment via input or percentage slider
  • Configurable auction duration (1-14 days)
  • Trade hold detection to prevent bad ux
  • Success state with direct links to view listing/stall

Implementation Details

  • Added new FetchRecommendedPrice handler to get price suggestions from CSFloat
  • Added ListItem handler to create listings via CSFloat API
  • Created ListItemModal component with:
    • Buy Now and Auction modes
    • Item tradability validation

Testing

No build / run errors

Screenshot 2025-02-03 at 11 53 22 AM

Buy Now Happy Path

csfloat_buy_now_happy_path.mov

Auction Happy Path

csfloat_auction_happy_path.mov

Not Logged In

csfloat_not_logged_in.mov

Price Fetch Failed

csfloat_cant_fetch_price.mov

@Step7750 Step7750 requested review from Step7750 and GODrums February 3, 2025 23:59
Copy link
Member

@Step7750 Step7750 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 contributing to the CSFloat extension! We appreciate community contributions and definitely wasn't expecting a substantial PR.

I've added a couple comments, some in relation to code style and others for the UX -- it'd be great if we could try to match a similar UI style to either Steam or CSFloat for the model.

@IzaakPrats
Copy link
Contributor Author

IzaakPrats commented Feb 4, 2025

Got to most of it today -- will have time tomorrow to address UX/UI issues, CSS organization, and CSFloat auth state checking.

@IzaakPrats
Copy link
Contributor Author

IzaakPrats commented Feb 12, 2025

Got caught up with work -- still getting this done. Had issues logging in last night. btw I noticed that the API lists valid auction durations as 1, 3, 5, 7, and 14 but (iirc) the csfloat site only allows for 1, 3, 7, or 14.

Screenshot 2025-02-12 at 5 38 31 PM

Screenshot 2025-02-12 at 5 37 42 PM

Also, ran into an issue with listing prices -- what do you think about including subtotal & sale fees? Is there an easy way to fetch a user's sale fee %?

cc @Step7750

@GODrums
Copy link
Collaborator

GODrums commented Feb 13, 2025

Hey @IzaakPrats,

thank you for the great contribution!

You should be correct regarding the auction options, I believe the API docs are just outdated here.
I personally also really like the idea of explicitly displaying the subtotal & sale fee. The fee is always 2% of the sale price, so you should be able to calculate it locally.

@IzaakPrats IzaakPrats force-pushed the izaak/feature/issue-277 branch from 7ecff97 to dfb9291 Compare February 13, 2025 04:59
@IzaakPrats
Copy link
Contributor Author

Got quite a bit done on this. Still need to add auth validation, debug a ux issue where sometimes items won't open the modal, and add a confirmation dialogue. Should be good after that! :)

Also, lmk if there is a better icon i should use instead of the karambit.

Screenshot 2025-02-13 at 12 01 08 AM

@IzaakPrats IzaakPrats requested a review from Step7750 February 14, 2025 21:10
@IzaakPrats
Copy link
Contributor Author

Requested review again and updated PR comment with new e2e tests

@IzaakPrats IzaakPrats force-pushed the izaak/feature/issue-277 branch 2 times, most recently from 60657fb to d7c1c4e Compare February 14, 2025 21:59
@GODrums
Copy link
Collaborator

GODrums commented Feb 17, 2025

Really like the current version already!

I do think we should explicitly handle Dopplers though. Instead of using the standard /price-list, which only features the price for the cheapest overall Doppler, we can use the /price-list/doppler-endpoint to get phase-specific prices with the phase_name-attribute.

@IzaakPrats
Copy link
Contributor Author

IzaakPrats commented Feb 17, 2025

@GODrums -- nice! didn't know that endpoint existed. got it in.

Before (karambit black pearl):
Screenshot 2025-02-17 at 1 51 46 PM

After (karambit black pearl):
Screenshot 2025-02-17 at 1 48 24 PM

@GODrums
Copy link
Collaborator

GODrums commented Feb 17, 2025

Thank you, looks great!

Just tested it myself and noticed that in some cases the font-family is not applied correctly due to Steam's default CSS, for example the input and button elements still use Steam's original font-family.

We likely have to create a manual rule to overwrite it for these elements.

@GODrums
Copy link
Collaborator

GODrums commented Feb 17, 2025

Another nit:

There seems to be an edge case whenever a user is not signed in to csfloat right now, where the /listings-request returns a 401. In that case the modal seems to be stuck at Loading... - optimally we would have an error case here displaying some sort of warning telling the user to sign in on Csfloat again.
Screenshot 2025-02-17 214351
Screenshot 2025-02-17 214332

We / I can also solve this as follow-up to this PR though.

@IzaakPrats
Copy link
Contributor Author

IzaakPrats commented Feb 19, 2025

@GODrums - good catches! got both of those issues handled. Added a css override at the modal content level and made a new way for unauth exceptions to bubble up to the modal.

Screenshot 2025-02-18 at 8 20 57 PM

Copy link
Collaborator

@GODrums GODrums left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for this huge PR!

Tested on Chrome and works.
Tested also on Firefox, but the /listings endpoint doesn't support moz-extension origins yet (@Step7750 should probably be fixed server-sided?)
image

@Step7750
Copy link
Member

Step7750 commented Feb 22, 2025

This is awesome! I'll try to get to re-reviewing this tomorrow -- feel free to ping me if I don't get to it.

@GODrums I can allow-list that endpoint for the Firefox extension, I'll set a reminder before this goes live.

@GODrums GODrums linked an issue Feb 22, 2025 that may be closed by this pull request
Copy link
Member

@Step7750 Step7750 left a comment

Choose a reason for hiding this comment

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

Thank you @IzaakPrats!

I've added a few comments, but we're very close to getting this merged. As mentioned briefly earlier, it's rare to see a quality PR like this from a community contribution -- so thank you again.

@IzaakPrats IzaakPrats force-pushed the izaak/feature/issue-277 branch from b005282 to 7d4ce04 Compare March 1, 2025 22:25
@IzaakPrats IzaakPrats requested a review from Step7750 March 1, 2025 22:26
@IzaakPrats
Copy link
Contributor Author

Got those nits in @Step7750

by the way, do you have logging on extension usage? I'd be curious to know how many people use the extension to list and in the future, how many people use the Search on CSFloat button that go on to purchase.

@IzaakPrats
Copy link
Contributor Author

Looks like I missed a few comments. Will address those this week

@IzaakPrats IzaakPrats force-pushed the izaak/feature/issue-277 branch from 7d4ce04 to f12284c Compare March 4, 2025 23:52
Copy link
Member

@Step7750 Step7750 left a comment

Choose a reason for hiding this comment

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

Added two nits, but I think this is good to go after the outstanding comments are resolved.

Thanks again @IzaakPrats !

@GODrums
Copy link
Collaborator

GODrums commented Apr 1, 2025

Again, thank you for your work on this @IzaakPrats!

Let me know if you get stuck on the last few feedback items – I'm happy to assist and help getting it merged.

@IzaakPrats
Copy link
Contributor Author

Hey @GODrums / @Step7750 -- I just got home from a vacation. Will likely get this merged in either this afternoon or this weekend. Thanks for the support!

@IzaakPrats IzaakPrats force-pushed the izaak/feature/issue-277 branch from 0dbd64d to ecde70d Compare April 13, 2025 12:28
@IzaakPrats IzaakPrats force-pushed the izaak/feature/issue-277 branch from 8c286de to 394bfe7 Compare April 19, 2025 17:19
@IzaakPrats
Copy link
Contributor Author

rebased on master

Copy link
Member

@Step7750 Step7750 left a comment

Choose a reason for hiding this comment

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

Thank you so much @IzaakPrats !

Apologies for the late review and all the comments/nits -- this looks to be ready to merge in! Thanks again for such a sizable community contribution -- excited to see users try it out in the next release.

@Step7750 Step7750 merged commit b3e3af5 into csfloat:master May 16, 2025
2 checks passed
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.

List Inventory Item directly on CSFloat
3 participants