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: add command menu for navigation #20

Merged
merged 31 commits into from
Jul 27, 2024
Merged

Conversation

ieedan
Copy link
Contributor

@ieedan ieedan commented Jul 24, 2024

Super cool project completely blowing mine out of the water!

I was checking it out on mobile and noticed this wasn't implemented yet.

This is a pretty rough implementation but I think it looks decent and does everything Vercel's does. Unfortunately I can't make use of cmdk-sv here because it only works as a modal not with responsive transformation to a drawer. May be worth opening a PR for in the future.

I had to add a magnifying-glass icon not sure if you are just copy pasting from Vercel but thats what I did.

I put the Command component in the header to save some complexity of having to setup state to call it but it could be moved if needed (would just add some complexity).

Copy link

github-actions bot commented Jul 25, 2024

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
geist ✅ Ready (View Log) Visit Preview bb56007

@ieedan
Copy link
Contributor Author

ieedan commented Jul 25, 2024

Not sure whats up with the preview doesn't seem to have any of my changes

@shyakadavis
Copy link
Owner

Hello, @ieedan

Thank you very much for the P.R. and the kind words! Your project is inspiring and sets a high standard.

Regarding the previews not working, I first noticed it recently, even yesterday in #15. The general assumption is that something changed in either GH Actions or Cloudflare, affecting Adrian's custom action setup for Cloudflare Pages. Please bear with this as we await a resolution.

Thanks again for your contribution. Please give me a few hours (I'm about to commute) and I'll provide a proper review.

Copy link
Owner

@shyakadavis shyakadavis left a comment

Choose a reason for hiding this comment

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

Hey, @ieedan

Thanks again for taking the time. Here are some suggestions about implementation direction.

Please let me know what you think.

package.json Outdated Show resolved Hide resolved
src/lib/assets/icons/index.ts Outdated Show resolved Hide resolved
src/lib/components/shared/command.svelte Outdated Show resolved Hide resolved
src/lib/components/ui/dialog/dialog-content.svelte Outdated Show resolved Hide resolved
@ieedan
Copy link
Contributor Author

ieedan commented Jul 25, 2024

I'll be more available in a few hours and I'll take another look thanks!

@ieedan
Copy link
Contributor Author

ieedan commented Jul 25, 2024

I am going to work on this now.

Is auto closing on selection not the intended behavior? Thats normally my default and what Vercel is doing here.

@shyakadavis
Copy link
Owner

Is auto closing on selection not the intended behavior?

It is. But oddly, it's not working. 🤷

@ieedan
Copy link
Contributor Author

ieedan commented Jul 25, 2024

Is auto closing on selection not the intended behavior?

It is. But oddly, it's not working. 🤷

Yeah sorry I am fixing that right now.

@ieedan
Copy link
Contributor Author

ieedan commented Jul 25, 2024

Everything should be working good now.

I had to create a context for the close function since I separated the list so I added a helper for that.

@ieedan
Copy link
Contributor Author

ieedan commented Jul 25, 2024

Still uses dialog implementation right now but I can change to the cmdk-sv implementation if needed.

@ieedan
Copy link
Contributor Author

ieedan commented Jul 25, 2024

I do think it may still be necessary to have logic for keyboard handling even for 'mobile' users. Sometimes if you are browsing with a smaller screen on a laptop or something it may still be nice to have.

@shyakadavis
Copy link
Owner

Hey, @ieedan

Could you merge the changes from main and see if the previews are working? (You are working off main on your fork, so I can't commit directly to this P.R.)

@ieedan
Copy link
Contributor Author

ieedan commented Jul 25, 2024

(You are working off main on your fork, so I can't commit directly to this P.R.)

Oops next time I'll make a branch

@shyakadavis
Copy link
Owner

Please don’t worry about wasting my time—every contribution is greatly appreciated.

Regarding casing, I'll definitely set up ESLint tomorrow.

If you still have time and energy to work on this, please go ahead!

@ieedan
Copy link
Contributor Author

ieedan commented Jul 26, 2024

Issue Tracker

  • CTRL + K Firefox
  • Ghost class names
  • Double focus traps
  • No more raw dog buttons
  • Unused files
  • Snake case

@ieedan
Copy link
Contributor Author

ieedan commented Jul 26, 2024

Okay I think that is everything.

FF is so dumb sometimes I swear why do I have to stopProp and preventDef

@ieedan
Copy link
Contributor Author

ieedan commented Jul 26, 2024

It'll probably be worth squashing this one for a cleaner history.

Sorry about that 😅

@shyakadavis
Copy link
Owner

shyakadavis commented Jul 27, 2024

These tweaks are in the spirit of keeping the ui components intact in case we wish to re-use them elsewhere. As such, specific overrides ought to happen at the consumer's end, rather than the component definition itself.

As for focus and cmd+k, here is a video of what I was seeing before.

Screen.Recording.2024-07-26.at.22.00.19.mov

Should be resolved on my end, would appreciate confirmation that I didn't mess up anything on your end.


I'm really sorry for dragging this out longer than it should have. 🙂

Copy link
Owner

@shyakadavis shyakadavis left a comment

Choose a reason for hiding this comment

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

Thank you very much @ieedan

@shyakadavis shyakadavis changed the title feat: Add responsive command menu for improved mobile browsing feat: add command menu for navigation Jul 27, 2024
@shyakadavis shyakadavis merged commit 7ba93a7 into shyakadavis:main Jul 27, 2024
4 checks passed
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.

2 participants