Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

refactor(site): clean up clipboard functionality and define tests#12296

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Parkreiner merged 19 commits intomainfrommes/clipboard-tests
Feb 28, 2024

Conversation

Parkreiner
Copy link
Member

@ParkreinerParkreiner commentedFeb 25, 2024
edited
Loading

Closes#12171 and makes more progress towards completing#11421

Changes made

  • Refactors the currentuseClipboard functionality for better clarity
    • Also renamed one of the returned properties and added a JSDoc comment to help communicate some of the limitations around it
  • Adds functionality for notifying the user of a failed clipboard copy
    • By default, this goes through the global snackbar, but it can be overridden if need be
  • Added tests foruseClipboard, both for HTTPS and HTTP-only connections
  • Updated the code for ourCodeExample component to ensure that clicking the component doesn't cause the inner button to double-fire
  • Figured out a way to add back the anti-flicker styling for the HTTP workaround that got removed by a previous PR

Notes

  • The testing setup for this PR is very...unconventional. I would recommend readinguseClipboard.test-setup.ts to get a overview of why things are set up the way they are
  • To be on the safe side, in addition to the automated tests, I also tested the HTTP-only functionality on Chrome, Firefox, and Safari. Didn't notice any issues with any of them
  • Once this PR is through, I am planning to update the code to useClipboard.js, using the tests to ensure there aren't any regressions
  • Also still planning to figure out how to update the Firefox visual bug where the CLI auth panel isn't fully centered
    • Need to look into Emotion docs to see what options there are for declaring multiple browser-specific values for the same style property

@ParkreinerParkreiner changed the titlechore: add tests for useClipboardchore(site): add tests for useClipboard for HTTPS and HTTP connectionsFeb 26, 2024
@ParkreinerParkreiner changed the titlechore(site): add tests for useClipboard for HTTPS and HTTP connectionsrefactor(site): clean up clipboard functionality and define testsFeb 26, 2024
@ParkreinerParkreiner requested review froma team andcode-asher and removed request fora teamFebruary 26, 2024 14:01
@ParkreinerParkreiner marked this pull request as ready for reviewFebruary 26, 2024 14:01
Comment on lines +74 to +75
* It feels silly that you have to make a whole dummy input just to simulate a
* clipboard, but that's really the recommended approach for older browsers.
Copy link
Member

Choose a reason for hiding this comment

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

I remember having to do similar things a long time ago, traumatic memories. 😆

@ParkreinerParkreiner merged commit087f973 intomainFeb 28, 2024
@ParkreinerParkreiner deleted the mes/clipboard-tests branchFebruary 28, 2024 02:05
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsFeb 28, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@code-ashercode-ashercode-asher approved these changes

Assignees

@ParkreinerParkreiner

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Unable to copy session token from the cli-auth page
2 participants
@Parkreiner@code-asher

[8]ページ先頭

©2009-2025 Movatter.jp