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

Add one hidden example for Labs/observers ResizeController usage #970

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

AndrewJakubowicz
Copy link
Contributor

@AndrewJakubowicz AndrewJakubowicz commented Oct 6, 2022

Note: For easier reviewing, I'm splitting out the labs/observers example playgrounds into isolated PRs. There will be a final PR that un-hides them.

This change adds a small hidden ResizeController example (the first demo from the labs observers talk).

View the playground example at: /playground/#sample=examples/observers-resize-controller

Add

  • Installed labs/observers package to lit.dev content for type checking.
  • Add a hidden ResizeController playground example.

Test plan

Tested manually on latest Chrome, Safari and Firefox.

@github-actions
Copy link

github-actions bot commented Oct 6, 2022

A live preview of this PR will be available at the URL(s) below.
The latest URL will be appended to this comment on each push.
Each build takes ~5-10 minutes, and will 404 until finished.

https://pr970-c73b471---lit-dev-5ftespv5na-uc.a.run.app/playground/#sample=examples/observers-resize-controller
https://pr970-6883730---lit-dev-5ftespv5na-uc.a.run.app/playground/#sample=examples/observers-resize-controller
https://pr970-9ca2f72---lit-dev-5ftespv5na-uc.a.run.app/playground/#sample=examples/observers-resize-controller

Copy link
Member

@augustjk augustjk left a comment

Choose a reason for hiding this comment

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

I love it! I clicked the bouncy drawer way too much.

</svg>`;

/**
* `mock-drawer` imitates a menu drawer on the page. Clicking this drawer
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm still kind of so-so on the drawer as a way to resize the element. I think it'd be nice to see something like what Shoelace uses to resize samples: https://shoelace.style/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree that the shoelace resize is very nice - thanks for referencing that! I think the reason I added the "menu" is because the divider between the playground source code and preview mimics the behavior and UI of the resize divider that Shoelace has. And I want something that explicitly causes the host to resize without it feeling like a window resize event.

That said, we could definitely have two dividers. One between the code and preview, and another on the right hand side that matches Shoelace. Would we want it to have the same drag behavior?

@AndrewJakubowicz AndrewJakubowicz changed the title Add one hidden example for Labs/observers ReactiveController usage Add one hidden example for Labs/observers ResizeController usage Oct 12, 2022
@AndrewJakubowicz AndrewJakubowicz self-assigned this Oct 12, 2022
@AndrewJakubowicz
Copy link
Contributor Author

AndrewJakubowicz commented Oct 12, 2022

Added @sorvell's feedback of changing the icon on the drawer to be an "expand" and "contract" arrow based on state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🤔 In Review
Development

Successfully merging this pull request may close these issues.

None yet

3 participants