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 maxItems option to scope prompt #104

Merged
merged 3 commits into from
May 8, 2024
Merged

Conversation

exdeniz
Copy link
Contributor

@exdeniz exdeniz commented May 8, 2024

Fixed glitch on small height screen for long scopes list. Base on @clack/[email protected] via bombshell-dev/clack#174

@Everduin94
Copy link
Owner

Everduin94 commented May 8, 2024

Hey thanks for the contribution! @exdeniz

Does this happen on commit_type as well? Or was there a specific reason it was only happening on scope?

@@ -107,6 +107,7 @@ export async function main(config: Output<typeof Config>) {
let commit_scope = await p.select({
message: "Select a commit scope",
initialValue: config.commit_scope.initial_value,
maxItems: config.commit_scope.max_items,
Copy link
Owner

Choose a reason for hiding this comment

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

On most PRs I would say this is exactly what we want to do (thanks for taking the time to understand the repo!). - I think in this case we could just bump the version and put maxItems: Infinity (Or just a relatively high number lol) here and on commit_type.

IIRC (maybe it has changed) clack doesn't support filter / search on select. As an example, if we had 10 scopes but a max_items of 5, we don't have a way to filter where it would show any of the 5 hidden items.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added max_items for commit_type. Yes, we have the ability to specify what will be displayed, but if we specify initialValue then p.select will correctly move through the list:

image

Copy link
Owner

Choose a reason for hiding this comment

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

👀 I misunderstood how max-items works. - I'll merge :), thanks again!

@Everduin94 Everduin94 merged commit 2cb2088 into Everduin94:main May 8, 2024
github-actions bot pushed a commit that referenced this pull request May 8, 2024
## [1.15.6](v1.15.5...v1.15.6) (2024-05-08)

### Bug Fixes

* **build:** update clack deps ([#106](#106)) ([36c9eee](36c9eee))
* **main:** add maxItems option to scope prompt ([#104](#104)) ([2cb2088](2cb2088))
Copy link

github-actions bot commented May 8, 2024

🎉 This PR is included in version 1.15.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants