pacocoursey Github contribution chart
pacocoursey Github Stats
pacocoursey Most Used Languages

Activity

30 Sep 2022

Issue Comment

Pacocoursey

When I add 'class' as an attribute to the theme provider I get this error. I use Nextjs with tailwindcss. Is there any hope for me?

image image

If i remove the 'class' from the attribute then error gone.

Forked On 22 Sep 2022 at 03:01:23

Pacocoursey

@AryanKuAg are you still seeing this issue? I really think it can only be a browser bug, or something deep inside your application code.

Commented On 22 Sep 2022 at 03:01:23
Issue Comment

Pacocoursey

Option to disable theme storage or use system value first

I just thought I ran into a bug on my app because it's night time and in Safari it kept showing light theme. But for some reason on Chrome it was dark.

After numerous hacks and changes, it dawned upon me that the browser was saving my last set theme value and used that on next relaunch.

But I may not necessarily want this behavior, i.e., when I launch my site I just want it to take the system value always first. Then if I toggle the theme, it's just persistent for the session my app is active until I close the tab or browser.

Any chance there is an option that supports disabling local storage or workaround to facilitate my desired behavior?

Forked On 22 Sep 2022 at 03:00:36

Pacocoursey

Sounds like a duplicate of #72 (using sessionStorage should achieve your desired behavior)

Commented On 22 Sep 2022 at 03:00:36

Pacocoursey

started

Started On 21 Sep 2022 at 06:35:03

Pacocoursey

started

Started On 21 Sep 2022 at 03:33:21

Pacocoursey

started

Started On 21 Sep 2022 at 02:47:47
Issue Comment

Pacocoursey

Nextjs Interpolation Error with dynamic routes

When I change theme in a dynamic page I get Interpolation error. Couldn't find a solution in the documentation. Thanks in advance.

Error: The provided href (/products/[category]) value is missing query values (category) to be interpolated properly. Read more: https://nextjs.org/docs/messages/href-interpolation-failed

Forked On 15 Sep 2022 at 11:21:17

Pacocoursey

Hey, this doesn't look like an error with this library, but rather a Next.js error. The error message shows you a link with more info and how to fix it: https://nextjs.org/docs/messages/href-interpolation-failed

Commented On 15 Sep 2022 at 11:21:17
Issue Comment

Pacocoursey

[question][urgent] arbitrary number of applicable themes supported?

Does this package support more than the binary system of theming?

For example, instead of light and dark, I would require a light, dark and custom.

Forked On 15 Sep 2022 at 04:26:40

Pacocoursey

Yes.

Commented On 15 Sep 2022 at 04:26:40
Issue Comment

Pacocoursey

i tried to use this one Reactjs app instead of nextjs app. darkmode flashes if i refresh the page. how do it fix.

Forked On 15 Sep 2022 at 04:14:26

Pacocoursey

No guarantee this library works outside of Next.js. PRs welcome to support CRA, or maybe someone else can help you out here.

Commented On 15 Sep 2022 at 04:14:26

Pacocoursey

started

Started On 14 Sep 2022 at 03:27:49

Pacocoursey

started

Started On 14 Sep 2022 at 03:27:07

Pacocoursey

started

Started On 11 Sep 2022 at 04:24:09

Pacocoursey

docs: link npm-version badge to npm package-site (#136)

Pushed On 08 Sep 2022 at 09:15:51

Pacocoursey

docs: link npm-version badge to npm package-site

Created On 08 Sep 2022 at 09:15:51

Pacocoursey

docs: link npm-version badge to npm package-site
Merged On 08 Sep 2022 at 09:15:44

Pacocoursey

Thanks as always :)

Commented On 08 Sep 2022 at 09:15:44
Issue Comment

Pacocoursey

Option to not change selected item via mouse events

I'm building a raycast clone for linux as a learning project, using cmdk and wails.io. It worked really well for me so far, thanks a lot for releasing this !

One pain point I have is the keyboard/mouse interaction during the selection. When I scroll a list using a keyboard, the mouse is often stealing the focus.

https://user-images.githubusercontent.com/17577332/188937337-b5bd1537-d63d-47b0-9e75-8008ea5fb222.mov

I love how raycast solve the issue: the mouse only provide an hover effect, and only select on click.

https://user-images.githubusercontent.com/17577332/188936938-39d7154b-770a-4338-be39-5ee5dbe2d4d9.mov

Would you be interested in adding this behaviour to the app ? I can work on the pr.

Forked On 08 Sep 2022 at 09:15:03

Pacocoursey

I'm not so sure, both React Aria (Combobox) and Radix UI (Dropdown) combine "mouse selection" with "keyboard selection" rather than separating them. However, Aria Combobox patterns keep them distinct.

Personally I find using the mouse "finicky" to select items, sometimes your pointer just happens to move (you bump the table, it slips on mousepad, or is generally bad) and it's annoying when that has adverse effects. That's one of the reasons I disabled scroll-into-view from pointer events in #3. So I'd be in favor of making this the new default.

Commented On 08 Sep 2022 at 09:15:03
Issue Comment

Pacocoursey

Memoize ThemeContext.Provider value

Every time <Theme /> renders, a new object is constructed and passed to ThemeContext.Provider. This guarantees that regardless of what inputs changed the Context will be propagated. This is particularly harmful when React is doing hydration because if an unhydrated Suspense boundary exists in the sub-tree of the Provider it will fall back to client rendering regardless of whether the context is an actual dependency for that Suspense boundary.

This commit adds memoization so the value only changes if one of it's inputs change To make this memoization effective the default argument for themes needed to be statically extracted (it constructs a new array on each function invocation otherwise)

Forked On 08 Sep 2022 at 07:09:42

Pacocoursey

Published as 0.2.1 @gnoff

Commented On 08 Sep 2022 at 07:09:42

Pacocoursey

Memoize ThemeContext.Provider value (#135)

Every time renders a new object is constructed and passed to ThemeContext.Provider. This guarantees that regardless of what inputs changed the Context will be propagated. This is particularly harmful when React is doing hydration because if an unhydrated Suspense boudnary exists in the sub-tree of the Provider it will fall back to client rendering regardless of whether the context is an actual dependency for that Suspense boundary.

This commit adds memoization so the value only changes if one of it's inputs change To make this memoization effective the default argument for themes needed to be statically extracted (it constructs a new array on each function invocation otherwise)

Pushed On 08 Sep 2022 at 07:04:57

Pacocoursey

Memoize ThemeContext.Provider value

Created On 08 Sep 2022 at 07:04:56

Pacocoursey

Memoize ThemeContext.Provider value

Every time <Theme /> renders, a new object is constructed and passed to ThemeContext.Provider. This guarantees that regardless of what inputs changed the Context will be propagated. This is particularly harmful when React is doing hydration because if an unhydrated Suspense boundary exists in the sub-tree of the Provider it will fall back to client rendering regardless of whether the context is an actual dependency for that Suspense boundary.

This commit adds memoization so the value only changes if one of it's inputs change To make this memoization effective the default argument for themes needed to be statically extracted (it constructs a new array on each function invocation otherwise)

Merged On 08 Sep 2022 at 07:04:50

Pacocoursey

Thanks!

Commented On 08 Sep 2022 at 07:04:50
Issue Comment

Pacocoursey

Option to not change selected item via mouse events

I'm building a raycast clone for linux as a learning project, using cmdk and wails.io. It worked really well for me so far, thanks a lot for releasing this !

One pain point I have is the keyboard/mouse interaction during the selection. When I scroll a list using a keyboard, the mouse is often stealing the focus.

https://user-images.githubusercontent.com/17577332/188937337-b5bd1537-d63d-47b0-9e75-8008ea5fb222.mov

I love how raycast solve the issue: the mouse only provide an hover effect, and only select on click.

https://user-images.githubusercontent.com/17577332/188936938-39d7154b-770a-4338-be39-5ee5dbe2d4d9.mov

Would you be interested in adding this behaviour to the app ? I can work on the pr.

Forked On 07 Sep 2022 at 09:50:50

Pacocoursey

Interesting use case! I think I'd be open to offering this behavior. Want to take a stab at it through a new prop passed to Command? Not sure of the name, maybe something like disablePointerSelections: boolean

Commented On 07 Sep 2022 at 09:50:50