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

Sidebar Enhancement Reboot #437

Merged
merged 5 commits into from
Feb 16, 2024
Merged

Sidebar Enhancement Reboot #437

merged 5 commits into from
Feb 16, 2024

Conversation

Amnish04
Copy link
Collaborator

@Amnish04 Amnish04 commented Feb 10, 2024

Pull Request #300 has been open for a while, and since then a lot of our preferences have changed regarding sidebar.

I really wanted to get it done, but would have been really difficult to continue on that branch.

Which is why, I have redone the sidebar enhancement from scratch.

  1. As per our discussion, the overlay effect is only applied to mobile devices now and I am using Chakra Drawer for that.
  2. I have also moved the search field to the sidebar on mobile devices due to lack of real estate in the header.
  3. The behaviour on desktop remains the same, except I have added a few animations to make the push content effect smoother.
  4. I also made sure there is no redundant animation on page reloads as it was one of the problems in last PR.
  5. The Pin Sidebar feature has also been removed

Here's how it looks:

On Desktop:
SidebarRebootDesktop

On Mobile:
SidebarRebootMobile

Breakpoint:
SidebarRebootBreakpoint

This fixes #299

Copy link

cloudflare-pages bot commented Feb 10, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: d008d45
Status: ✅  Deploy successful!
Preview URL: https://36b25199.console-overthinker-dev.pages.dev
Branch Preview URL: https://amnish04-issue-299.console-overthinker-dev.pages.dev

View logs

@humphd
Copy link
Collaborator

humphd commented Feb 15, 2024

@Amnish04 can you rebase this, and add the placeholder change there too?

@Amnish04
Copy link
Collaborator Author

@humphd Sure, just rebased

Copy link
Collaborator

@humphd humphd left a comment

Choose a reason for hiding this comment

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

This is a fantastic improvement. The only thing I wonder about, as I read this, is the amount of code duplication. However, we have that now, too.

const isMobile = useMobileBreakpoint();
const sidebarColor = useColorModeValue("blue.600", "blue.200");

const sidebarOpenAnimationKeyframes = keyframes`
Copy link
Collaborator

Choose a reason for hiding this comment

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

We're repeating a bunch of code. It would be good to think about how we might reuse any of this down the road (doesn't need to block this work).

Copy link
Collaborator Author

@Amnish04 Amnish04 Feb 15, 2024

Choose a reason for hiding this comment

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

I agree, this duplication has been itching me as well. To address this, I have packed the entire sidebar into its own module like we are doing the PromptFrom.
image

But I don't want to push it on this branch as it might delay this PR. Can I merge this now, so I can open another PR right away as a follow up for this?

@Amnish04
Copy link
Collaborator Author

@rjwignar @kliu57 Are you guys also okay with this?

Copy link
Collaborator

@kliu57 kliu57 left a comment

Choose a reason for hiding this comment

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

@Amnish04 I tested it and the mobile changes are really good - big improvement from what it is like in production right now (in prod right now if you have the mobile and the sidebar open and refresh the app becomes unuseable)

@Amnish04
Copy link
Collaborator Author

@Amnish04 I tested it and the mobile changes are really good - big improvement from what it is like in production right now (in prod right now if you have the mobile and the sidebar open and refresh the app becomes unuseable)

Great, thanks for reviewing!

@humphd
Copy link
Collaborator

humphd commented Feb 16, 2024

Go ahead and land it, then improve in follow-ups.

@Amnish04 Amnish04 merged commit 638b209 into main Feb 16, 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.

Sidebar Enhancement
3 participants