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

[C-5786] Update user comments endpoint and add user CommentHistoryPage #11427

Merged
merged 3 commits into from
Feb 21, 2025

Conversation

Kyle-Shanks
Copy link
Contributor

Description

  • Update the endpoint to return the entity type and id with the comments
  • Update the tan-query hook for user comments
  • Add CommentHistoryPage for web

How Has This Been Tested?

Lots of manual testing, lots more to do

Screenshot 2025-02-20 at 2 37 07 PM

Notes:

  • There are slight issues with the type, i'll try to work them out so that the ts-ignores are not necessary

Copy link

changeset-bot bot commented Feb 20, 2025

⚠️ No Changeset found

Latest commit: 886cc5a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Kyle-Shanks Kyle-Shanks changed the title Update user comments endpoint and add user CommentHistoryPage [C-5786] Update user comments endpoint and add user CommentHistoryPage Feb 20, 2025
@Kyle-Shanks Kyle-Shanks removed the request for review from DejayJD February 20, 2025 20:30
Copy link
Contributor

@dylanjeffers dylanjeffers left a comment

Choose a reason for hiding this comment

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

looking awesome!!


const UserComment = ({ commentId }: { commentId: number }) => {
const res = useGetCommentById(commentId)
const comment = res.data as Comment
Copy link
Contributor

Choose a reason for hiding this comment

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

const {data: comment } = useGetCommentById

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Causing some type issues. I'm trying to fix bc it looks weird yea

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the Reply type that can be returned from the hook doesn't include the entityId / entityType fields.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not an issue here, but this was causing a different issue so good callout

Copy link
Contributor

@amendelsohn amendelsohn left a comment

Choose a reason for hiding this comment

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

Looks great!

Suggested some tan-query adoption opportunities

Copy link
Contributor

@DejayJD DejayJD left a comment

Choose a reason for hiding this comment

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

LGTM! Avail if you need any assistance wrangling those types!

@@ -3201,6 +3201,8 @@ def get(self, receiving_user_id, grantor_user_id):
{
"id": fields.String(required=True),
"user_id": fields.String(required=False),
"entity_id": fields.String(required=True),
"entity_type": fields.String(required=True),
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mind splitting the discovery/sdk changes into a separate PR and merging that first?
That way we can make sure it's on all nodes before shipping the SDK change that consumes the new fields.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also wondering if we should use an enum for this similar to here

That way, the generated SDK types will show only those literals instead of a generic string.

We may also want to write an extend_ helper for our response model and use it to lowercase the type when we serialize this model so it's 'track' | 'comment' since we usually lowercase values like this.

@Kyle-Shanks Kyle-Shanks force-pushed the kj-Add-comment-history-page branch from 1ba7526 to 657161f Compare February 21, 2025 17:28
userId,
currentUserId,
export const useUserComments = (
userId: ID | null,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: A lot of the other modern tan-query hooks use an object for params instead of positional ones. Should probably follow that pattern? ({userId, pageSize})

@Kyle-Shanks Kyle-Shanks merged commit ae6a324 into main Feb 21, 2025
12 checks passed
@Kyle-Shanks Kyle-Shanks deleted the kj-Add-comment-history-page branch February 21, 2025 20:43
audius-infra pushed a commit that referenced this pull request Feb 22, 2025
[f7023af] [QA-1995] Fix manager mode dropdown rendering off screen (#11442) Randy Schott
[b250f91] Re-enable redux cache sync to tan-query (#11441) Andrew Mendelsohn
[0868942] Remove hcaptcha from mobile (#11438) Reed
[02fc876] [C-5796] Add empty state for comment history (#11436) KJ
[ae6a324] [C-5786] Update user comments endpoint and add user CommentHistoryPage (#11427) KJ
[1e7469f] [PAY-3953] Use db value for public key (#11391) Farid Salau
[13f9ca0] [PAY-3858] Re-do challenge progress status label logic (#11429) Reed
[f96aeec] Don't add computeLimit instruction to buyAudio flow swap (#11430) Marcus Pasell
[5c595da] Custom component for web oneshot challenge (#11428) Reed
[71768b4] [C-5674] Migrate notifications to tan-query (#11425) Dylan Jeffers
[d881678] [C-5204] Fix android comment input clipping (#11386) Dylan Jeffers
[99f5cd1] Fix batcher context resolver (#11426) Dylan Jeffers
[67d4e5e] Refactor web challenge-rewards-modal (#11424) Dylan Jeffers
[509c54e] Upgrade elliptic package to 6.6.1 (#11388) Dylan Jeffers
[15a6c07] Misc fixes for mobile audio, usdc screens (#11422) Reed
[17eef87] [C-5779] Update mobile profile layout (#11421) Randy Schott
[bbf1bcf] Deprecate wallet.ts and formatUtils.ts functions in favor of FixedDecimal (#11423) Marcus Pasell
[1896f71] [QA-1993] Fix suggested-artists UI overflow (#11420) Dylan Jeffers
[2a9c257] Mobile reward notif navs to RewardsScreen, open drawer (#11419) Reed
[9e75c9f] Fix reward panel ordering (#11418) Reed
[be0c636] Remove one shot and listen streak feature flags (#11416) Reed
[52201bf] Fix crash from `useGetTrackCommentNotificationSetting` returning undefined (#11395) Farid Salau
[451a173] Fix android line height (#11413) Dylan Jeffers
[eba6779] Minor profile page style fixes (#11412) Randy Schott
[44b88d3] Update collectibles hook to return null instead of empty objects (#11410) Randy Schott
[2b2124e] [QA-1979] Fix now playing UI in collection pages (#11408) Dylan Jeffers
[fc3b294] Fix edit playlist nav link when unfetched (#11403) Andrew Mendelsohn
[024323e] Fix create playlists for users with capcase handle (#11406) Dylan Jeffers
[7ebd72b] Fix text clipping for rewards text (#11400) Dylan Jeffers
[01e82df] [PAY-3949] Add fire emoji to notification  (#11402) Farid Salau
[5427e77] Fix drag n drop playlist reordering (#11401) Andrew Mendelsohn
[19bb6ab] Add mobile notification for endless streak (#11398) Farid Salau
[9ba62e3] [PAY-3848] Add ListenStreakReminder notification (#11389) Dylan Jeffers
[f653e01] [C-5784] Use normalized batch entities in lineup queries (#11376) Andrew Mendelsohn
[0f8fe4a] Fix top tracks (#11393) Farid Salau
[e68da94] Fix "Complete Upload" crash (#11392) Farid Salau
[7d310ef] [PAY-3850][PAY-3849] Add listen streak noti on web (#11379) Farid Salau
audius-infra pushed a commit that referenced this pull request Feb 24, 2025
[ae6a324] [C-5786] Update user comments endpoint and add user CommentHistoryPage (#11427) KJ
[beeeb22] [PAY-3955] Update dev & stage amount (#11435) Farid Salau
[1e7469f] [PAY-3953] Use db value for public key (#11391) Farid Salau
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants