Skip to content

Conversation

@priscilawebdev
Copy link
Member

@priscilawebdev priscilawebdev commented Jul 24, 2025

Note
The idea is to replace PlayStationSdkAccessModal after this is merged

closes https://linear.app/getsentry/issue/TET-921/collect-github-handle

Screen.Recording.2025-07-24.at.10.08.56.mov

@linear
Copy link

linear bot commented Jul 24, 2025

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 24, 2025
@priscilawebdev priscilawebdev marked this pull request as ready for review July 24, 2025 08:10
@priscilawebdev priscilawebdev requested a review from a team as a code owner July 24, 2025 08:10
@priscilawebdev priscilawebdev force-pushed the priscila/feat/add-private-gaming-sdk-access-modal branch from 511f9b9 to 9a120e9 Compare July 24, 2025 10:16
})
);
setIsSubmitting(false);
closeModal();
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Feedback Formatting and Submission State Issues

The PrivateGamingSdkAccessModal has two issues:

  1. The feedback message sent via captureFeedback inconsistently formats gaming platform names: single platforms use raw values (e.g., 'playstation'), while multiple platforms use display labels (e.g., 'PlayStation'), resulting in inconsistent capitalization.
  2. If the captureFeedback call fails, the isSubmitting state is not reset and the modal remains open, leaving the UI in a perpetual submitting state.
Locations (1)

Fix in CursorFix in Web

Base automatically changed from priscila/feat/getting-started-docs/add-playstation-doc to master July 25, 2025 09:03
})
);
setIsSubmitting(false);
closeModal();
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Feedback Submission Timing and Formatting Issues

The captureFeedback function is asynchronous but not awaited, leading to premature isSubmitting state reset, early success message display, and modal closure before feedback is sent. Additionally, the feedback message inconsistently formats gaming platform names, using raw values for single selections and human-readable labels for multiple selections.

Locations (1)

Fix in CursorFix in Web

openModal(deps => <Modal {...deps} {...options} />);
}

export async function openPrivateGamingSdkAccessModal(
Copy link
Collaborator

Choose a reason for hiding this comment

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

this function is unused, so I’d expect knip to complain here (which it doesn’t). I’ll look into that, but can we make the function used somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes it did not complain which is weird, but this function will be used in 3 different places. Examples: #96300 and #96415


const isFormValid = !!githubProfile.trim() && gamingPlatforms.length > 0;

const handleSubmit = useCallback(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we please not wrap every function we create in useCallback 🙏 . There is absolutely no need here, because:

  • it’s only passed to the click handler of a Button, which doesn’t care about referential stability.
  • it is dependent on onSubmit, which is a prop, which is always an inline function, so the useCallback has to run every time anyways.

All it does in this instance is add more code and complexity and mental overhead.

Copy link
Member Author

Choose a reason for hiding this comment

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

hey thanks! it is not always super clear when we should use useCallback, and I noticed we've been applying it by default whenever we define a function in our codebase. This one for example was copied and pasted from here.

I was wondering...do we have a linter or any tooling that could help us identify when useCallback is actually necessary? That would be super helpful!

sdkName,
})
);
setIsSubmitting(false);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I’m unsure how this should work. This handleSubmit function is a synchronous callback, so it first calls setIsSubmitting(true) followed by setIsSubmitting(false), so I don’t see where the true state would ever be rendered 🤔 .

This is part of the reason why merging something that has no usage is a bit counter productive imo because we can’t know how it works / what it does.

I’m guessing onSubmit is going to maybe trigger a mutation on the call-side? Would it be better to trigger that mutation from inside here, which would also give us mutation state like isPending and callbacks to add the success messages properly?

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 agree - it would be great to use isPending and show a success message only if everything went well. But we're using captureFeedback, which doesn't wait for the result. It just tries to send the feedback and returns immediately. You can read more about it here.

This modal will be removed in a future phase, but for now, we’re keeping it simple by reusing what we already have.

@priscilawebdev priscilawebdev force-pushed the priscila/feat/add-private-gaming-sdk-access-modal branch from 8588c04 to b9c2a51 Compare July 28, 2025 06:56
@priscilawebdev priscilawebdev merged commit 6224b01 into master Jul 28, 2025
47 checks passed
@priscilawebdev priscilawebdev deleted the priscila/feat/add-private-gaming-sdk-access-modal branch July 28, 2025 09:13
@github-actions github-actions bot locked and limited conversation to collaborators Aug 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants