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

Feature: useFocus hook #99

Merged
merged 43 commits into from
Jun 4, 2024
Merged

Feature: useFocus hook #99

merged 43 commits into from
Jun 4, 2024

Conversation

Hugos68
Copy link
Collaborator

@Hugos68 Hugos68 commented May 15, 2024

Linked Issue

Closes #5

Description

Adds the useFocus hook, tests for it and docs.

Changesets

We use Changesets to automatically create our changelog per each release. Any changes or additions to the Library assets in /lib must be documented with a new Changeset. This can be done as follows:

  1. Navigate to the root of the project on your feature branch.
  2. Run pnpm changeset to trigger the Changeset CLI.
  3. Follow the instructions when prompted.
    • Changesets should be either minor or patch. Never major.
    • Prefix your Changeset description using: feature:, chore: or bugfix:.
  4. Changeset .md files are added to the /.changeset directory.
  5. Commit and push the the new changeset file.

Checklist

Please read and apply all contribution requirements.

  • PR targets the dev branch (NEVER master)
  • All website documentation is current with your changes
  • Ensure Prettier formatting is current - run pnpm format
  • Ensure ESLint linting is current - run pnpm lint
  • All test cases are passing - run pnpm test
  • Includes a changeset (if relevant; see above)

Copy link

vercel bot commented May 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
floating-ui-svelte ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 5:41pm

@Hugos68 Hugos68 marked this pull request as draft May 15, 2024 11:30
@Hugos68 Hugos68 marked this pull request as ready for review May 15, 2024 18:29
@Hugos68 Hugos68 requested a review from endigo9740 May 15, 2024 18:29
@Hugos68 Hugos68 self-assigned this May 15, 2024
@Hugos68
Copy link
Collaborator Author

Hugos68 commented May 15, 2024

Tests are still failing, this is being looked into. They're only failing in CI... 😄

@Hugos68
Copy link
Collaborator Author

Hugos68 commented May 15, 2024

I honestly don't know why CI is failing, if anyone could clone the repo and confirm tests are running locally just fine that would be great:

  1. clone repo
  2. cd to root
  3. pnpm i
  4. pnpm test

Copy link
Contributor

@endigo9740 endigo9740 left a comment

Choose a reason for hiding this comment

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

@Hugos68 A few odds and ends, otherwise LGTM.

A couple things of note:

  • I know you're working through the test cases, but it's extremely hard to review the PR when so many extra files are edited.
  • The /utils directory is kind of blowing up. Consider grouping similar utils. I know it differs from Floating UI, but it's getting a bit crazy!
  • I'll do further testing when we implement in a practical example.

src/lib/hooks/useFocus/index.test.ts Show resolved Hide resolved
src/routes/(inner)/api/use-focus/+page.svelte Outdated Show resolved Hide resolved
src/lib/hooks/useFocus/index.svelte.ts Outdated Show resolved Hide resolved
Copy link

changeset-bot bot commented May 24, 2024

⚠️ No Changeset found

Latest commit: 4b375de

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

Copy link
Contributor

@endigo9740 endigo9740 left a comment

Choose a reason for hiding this comment

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

Note I made a few revisions to the doc page (just added/updated some text)

I requested a small update to the CodeBlock component, which will improve this page. But that should be a separate follow up PR:

Also note the CI / tests checks are failing.

Once the latter are resolved it should be good to merge.

@endigo9740 endigo9740 merged commit 9542fe3 into dev Jun 4, 2024
7 checks passed
@endigo9740 endigo9740 deleted the feat/use-focus branch June 4, 2024 18:00
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.

Add: useFocus hook
2 participants