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

Support custom emojis & declarative loading state in MarkdownEditor suggestions #3004

Merged
merged 6 commits into from
Mar 9, 2023

Conversation

iansan5653
Copy link
Contributor

@iansan5653 iansan5653 commented Mar 9, 2023

  1. Adds support for custom emojis (like :octocat:, which has no Unicode representation) by allowing emoji suggestions to take the shape of {name: string, url: string} where url is an image.
  2. Adds support for a declarative loading state for Markdown editor suggestions by providing the string "loading" as the suggestions prop. We already supported asynchronous suggestions via an async function, but this imperative strategy isn't idiomatic React and is incompatible with react-query, which we'd like to use in Projects for caching data more effectively. My bad for originally writing it this way 😬. I'd really like to completely change it but I want to avoid breaking changes for now and this works just fine.

This change is completely non-breaking and won't require any additional QA if we can get it into this release (as evidenced by the Storybook stories which didn't require any changes).

@iansan5653 iansan5653 requested review from a team and joshblack March 9, 2023 16:27
@changeset-bot
Copy link

changeset-bot bot commented Mar 9, 2023

🦋 Changeset detected

Latest commit: 19f6833

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2023

size-limit report 📦

Path Size
dist/browser.esm.js 94.68 KB (0%)
dist/browser.umd.js 95.25 KB (0%)

@github-actions github-actions bot temporarily deployed to storybook-preview-3004 March 9, 2023 16:34 Inactive
@iansan5653 iansan5653 temporarily deployed to github-pages March 9, 2023 16:39 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3004 March 9, 2023 16:40 Inactive
@iansan5653 iansan5653 changed the title Support custom emojis & declarative Support custom emojis & declarative loading state in MarkdownEditor suggestions Mar 9, 2023
@iansan5653 iansan5653 temporarily deployed to github-pages March 9, 2023 16:50 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3004 March 9, 2023 16:51 Inactive
{name: '+1', character: '👍'},
{name: '-1', character: '👎'},
{name: 'heart', character: '❤️'},
{name: 'wave', character: '👋'},
{name: 'raised_hands', character: '🙌'},
]
{name: 'octocat', url: 'https://github.githubassets.com/images/icons/emoji/octocat.png'},
] satisfies Emoji[]
Copy link
Contributor

Choose a reason for hiding this comment

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

Ohh I've read about satisfies but haven't actually used it yet. Nice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

turns out I had to remove it because the Jest transpiler doesn't work with it

@joshblack
Copy link
Member

@iansan5653 sorry about the Jest issue! just opened up: #3005 to avoid this in the future for TypeScript 4.9 features like satisfies 😎

Merged via the queue into main with commit 45107bc Mar 9, 2023
@iansan5653 iansan5653 deleted the markdown-editor-suggestion-improvements branch March 9, 2023 17:10
@primer-css primer-css mentioned this pull request Mar 9, 2023
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.

None yet

3 participants