Skip to content

Conversation

joshstobbs
Copy link
Contributor

This should solve #47 - which allows min-size to be respected and used as a floor when there is no max-size set. In my testing all seems to work well. I've added a test to the suite, everything still passes.

I haven't added anything to the docs as this doesn't necessarily seem like a feature that needs to be called out, but I'm happy to amend that if needed!

Otherwise, let me know if there's any changes and I can jump on them. Thanks!

@rijkvanzanten
Copy link
Member

Glad to see you found some time between work today 😄

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds functionality to respect minimum size constraints when no maximum size is set in the grid template. This allows minSizePercentage to act as a floor value for panel sizing when maxSizePercentage is undefined.

  • Introduces a new conditional branch to handle when only minSizePercentage is defined
  • Uses clamp() and max() CSS functions to enforce the minimum size constraint
  • Adds test coverage for the new functionality

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
use-grid-template.ts Adds logic to use minSizePercentage as a floor when maxSizePercentage is not set
use-grid-template.test.ts Adds test case verifying minSizePercentage behavior when max is undefined

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@rijkvanzanten rijkvanzanten changed the title feat(#47): allow min to be used as a floor feat: allow min to be used as a floor Sep 3, 2025
@rijkvanzanten rijkvanzanten merged commit 38f352d into directus:main Sep 3, 2025
2 checks passed
@rijkvanzanten
Copy link
Member

Thanks @joshstobbs! 🫶 Published this to npm under 0.7.0 👍🏻

@joshstobbs
Copy link
Contributor Author

Incredible! Thanks so much, appreciate all the help!

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