Skip to content

chore: add imageUrl#8448

Open
joaosantos15 wants to merge 6 commits intomainfrom
TSA-372-385-387-social-updates
Open

chore: add imageUrl#8448
joaosantos15 wants to merge 6 commits intomainfrom
TSA-372-385-387-social-updates

Conversation

@joaosantos15
Copy link
Copy Markdown
Contributor

@joaosantos15 joaosantos15 commented Apr 14, 2026

Explanation

Add tokenImageUrl to Position and avgHoldMinutes to TraderStats types and superstruct schemas so the extension can consume the new API fields. Also fixes fetchClosedPositions hitting a v2 URL that doesn't exist (the closed positions endpoint is v1-only), which was causing 404s.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Moderate risk because it changes the URL selection logic for position fetching (v1 vs v2), which could affect production API calls and caching, though the change is small and covered by tests.

Overview
Updates social-api response typing/validation to accept two new optional fields: Position.tokenImageUrl and TraderStats.avgHoldMinutes (including superstruct schemas and test fixtures).

Fixes fetchClosedPositions to call the v1 closed-positions endpoint (v2 doesn’t exist), by selecting v1/v2 base URLs based on open vs closed status; tests are updated to assert the corrected URL.

Reviewed by Cursor Bugbot for commit b316248. Bugbot is set up for automated code reviews on this repo. Configure here.

@joaosantos15 joaosantos15 marked this pull request as ready for review April 14, 2026 09:38
@joaosantos15 joaosantos15 requested review from a team as code owners April 14, 2026 09:38
zone-live
zone-live previously approved these changes Apr 14, 2026
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e4313f9. Configure here.

Copy link
Copy Markdown
Contributor

@Bigshmow Bigshmow left a comment

Choose a reason for hiding this comment

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

Just a note on median vs mean, otherwise LGTM.

Comment on lines +108 to +109
/** Median holding time in minutes. */
avgHoldMinutes?: number | null;
Copy link
Copy Markdown
Contributor

@Bigshmow Bigshmow Apr 14, 2026

Choose a reason for hiding this comment

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

I just realized our UI designs show this as "avg. hold" but clicker calls this medianHoldingTimeMinutes
See profile response: https://docs.clicker.xyz/api-reference/profile
And the comment acknowledge this discrepancy, so wdyt is it ok to keep as is or is the misrepresentation (median vs mean) not acceptable?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can go with medianHoldMinutes here instead, aligned with product needs the front end will now simply say "hold time" instead of avg. hold.

Suggested change
/** Median holding time in minutes. */
avgHoldMinutes?: number | null;
/** Median holding time in minutes. */
medianHoldMinutes?: number | null;

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.

3 participants