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

feat(PreviewTip): add preview tip #2923

Merged
merged 68 commits into from
Oct 1, 2024
Merged

feat(PreviewTip): add preview tip #2923

merged 68 commits into from
Oct 1, 2024

Conversation

dreamwasp
Copy link
Contributor

@dreamwasp dreamwasp commented Aug 6, 2024

Overview

Add new PreviewTip component, restructures some shared tip components, and adds a 3ms delay to to hover/focus tips (like PreviewTip + ToolTip)

PR Checklist

  • Related to designs: here
  • Related to JIRA ticket: [gm-645]
  • I have run this code to verify it works
  • This PR includes unit tests for the code change
  • This PR includes testing instructions tests for the code change
  • The alpha package of this PR is passing end-to-end tests in all relevant Codecademy repositories

Testing Instructions

  1. Go to the PreviewTip story
  2. Hover over one of the tips and see the text
  3. Turn on VO
  4. Tab into the tip
  5. Hear the tip announced
  6. Do the same for the floating variant
  7. ...
  8. Profit!

PR Links and Envs

Repository PR Link PR Env
Monolith Monolith PR Monolith Env
monorepo Portal Link Portal Env

@dreamwasp dreamwasp marked this pull request as ready for review September 11, 2024 21:45
@dreamwasp dreamwasp requested a review from a team as a code owner September 11, 2024 21:45
Copy link
Contributor

@aresnik11 aresnik11 left a comment

Choose a reason for hiding this comment

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

Couple small comments!

@@ -82,6 +86,6 @@ describe('IconButton', () => {

userEvent.hover(cta);

view.getByText(tip);
await waitFor(() => view.getByText(tip));
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: i think this is the same as doing await findByText(tip)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

since view isn't async, waitFor makes the functions wait around until it's true (or it times out)
)

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

omg TIL

return (
<GridBox
gridTemplateAreas={gridTemplateAreas}
gridTemplateColumns={avatar ? avatarColumnTemplate : '1fr'}
Copy link
Contributor

Choose a reason for hiding this comment

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

should the 1fr here be using defaultGridTemplate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good call, thank you!

overline="overline"
href="/test"
>
I am a test tooltip
Copy link
Contributor

Choose a reason for hiding this comment

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

super nit: should this say preview tip instead?

{(args) => (
<FlexBox py={156} width="100%" justifyContent="space-around">
<PreviewTip {...args} truncateLines={2} alignment="top-right" />
<PreviewTip {...args} truncateLines={5} alignment="bottom-left" />
Copy link
Contributor

Choose a reason for hiding this comment

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

do we want to change the lines here? truncating to 5 lines doesnt actually truncate with the current text


## Loading

The `loading` prop will render a <LinkTo component="Shimmer">`Shimmer`</LinkTo> loading state. See an exmaple below!
Copy link
Contributor

Choose a reason for hiding this comment

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

lol example spelled wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ex maple

<Story name="Loading PreviewTip">
{() => (
<FlexBox center py={156}>
<LoadingTip />
Copy link
Contributor

Choose a reason for hiding this comment

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

hmmm i'm not actually seeing the LoadingTip here...

Copy link
Contributor

@aresnik11 aresnik11 left a comment

Choose a reason for hiding this comment

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

also is the pattern supposed to always match the background? or should it been transparent?
Screenshot 2024-09-17 at 1 48 29 PM
Screenshot 2024-09-17 at 1 48 01 PM

@dreamwasp
Copy link
Contributor Author

also is the pattern supposed to always match the background? or should it been transparent? Screenshot 2024-09-17 at 1 48 29 PM Screenshot 2024-09-17 at 1 48 01 PM

good catch! i'll ask stacey

Copy link
Contributor

@aresnik11 aresnik11 left a comment

Choose a reason for hiding this comment

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

LGTM!

@codecademydev
Copy link
Collaborator

📬Published Alpha Packages:

@codecademy/[email protected]
@codecademy/[email protected]
@codecademy/[email protected]
@codecademy/[email protected]
@codecademy/[email protected]
@codecademy/[email protected]
@codecademy/[email protected]
@codecademy/[email protected]

@codecademydev
Copy link
Collaborator

🚀 Styleguide deploy preview ready!

https://66f57f9b0f7d5e2781a880de--gamut-preview.netlify.app

Deploy Logs

@dreamwasp dreamwasp added the Ship It :shipit: Automerge this PR when possible label Oct 1, 2024
@codecademydev codecademydev merged commit fc90775 into main Oct 1, 2024
17 of 18 checks passed
@codecademydev codecademydev removed the Ship It :shipit: Automerge this PR when possible label Oct 1, 2024
@codecademydev codecademydev deleted the cass-gm-645 branch October 1, 2024 14:10
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