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

Collapsible Component #127

Merged
merged 10 commits into from
Oct 2, 2024
Merged

Collapsible Component #127

merged 10 commits into from
Oct 2, 2024

Conversation

simon-wg
Copy link
Contributor

Added a drop in replacement to ContentPane which allows for dropdown.

It's not done being styled yet. Send help I suck at CSS.

@simon-wg simon-wg marked this pull request as draft September 12, 2024 17:22
@simon-wg
Copy link
Contributor Author

image
image

A drop in replacement for content-pane to make it collapsible.

@GAsplund
Copy link
Member

GAsplund commented Sep 26, 2024

With the new design, do we still need to re-implement ContentPane? Since that just provides CSS that wraps its content, none of which I can see affecting this.

@simon-wg
Copy link
Contributor Author

Not sure, I didn't know ContentPane needed changes tbh

@GAsplund
Copy link
Member

What I mean is to instead of creating a ContentPaneCollapsible that seems to duplicate CSS, we could move the functionality into just Collapsible that implements the new UI elements used

@simon-wg
Copy link
Contributor Author

I'm not completely sure how that would work, do you mean something like having a prop passed which determines whether the Content pane should be collapsible then?

@simon-wg
Copy link
Contributor Author

I'm thinking that we don't want to do that since every Content pane would have to be client side then, but maybe the benefit of less duplication is worth it.

@GAsplund
Copy link
Member

I would solve this by replacing:

<ContentPaneCollapsible>
  [...]
</ContentPaneCollapsible>

with:

<ContentPane>
  <Collapsible>
    [...]
  </Collapsible>
</ContentPane>

Since with the new design you propose I cannot see why we would create a derivative of ContentPane to make it work with this.

(Side note, I noticed that Collapsible is not used and has duplicated code with ContentPaneCollapsible)

@simon-wg
Copy link
Contributor Author

That seems to work great honestly, I'll look at replacing it with that solution.

@GAsplund
Copy link
Member

GAsplund commented Sep 26, 2024

I'm thinking that we don't want to do that since every Content pane would have to be client side then, but maybe the benefit of less duplication is worth it.

You could probably make the component entirely server-side by using a hidden checkbox and CSS, similarly to the touchscreen version of header dropdown links

@simon-wg
Copy link
Contributor Author

I was wrong about the client side issue btw, Collapsible just needed to be dropped in like you showed. Not sure why it wasn't used 😅

@simon-wg
Copy link
Contributor Author

@GAsplund thoughts now?

@simon-wg
Copy link
Contributor Author

I think it's fine to keep using a client component here, it shouldn't have any noticeable impact

@GAsplund
Copy link
Member

Overall, I like it! Maybe move the header out of the collapsible so that it won't have a chance of being hidden (and imo makes more sense cuz it's not part of lunch contents).

I would also point out that we would probably like to minimize hydration and bundle size, so keeping client-side code to a minimum is always preferable. If you don't want to change it then that's fine, but I will probably do a pass over it later if that's the case.

@simon-wg
Copy link
Contributor Author

What you're saying sounds good, if you've got time I'd love to see how to do it with checkboxes and CSS instead! We'd probably wanna do the same for the NavDrawer component as well.

@GAsplund
Copy link
Member

GAsplund commented Sep 26, 2024

If it can/should be done for the nav drawer as well then I'm probably ready to approve this (once it's marked ready). I can get a fix for both elements later.

@simon-wg simon-wg marked this pull request as ready for review October 2, 2024 13:54
Copy link
Member

@GAsplund GAsplund left a comment

Choose a reason for hiding this comment

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

LGTM

@simon-wg simon-wg merged commit d0858d8 into main Oct 2, 2024
5 checks passed
@GAsplund GAsplund deleted the feat/collapsible-component branch October 2, 2024 15: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.

2 participants