Skip to content

Feature/dropdown behavior fix#17

Open
blazezhenli-sys wants to merge 3 commits into508-dev:mainfrom
blazezhenli-sys:feature/dropdown-behavior-fix
Open

Feature/dropdown behavior fix#17
blazezhenli-sys wants to merge 3 commits into508-dev:mainfrom
blazezhenli-sys:feature/dropdown-behavior-fix

Conversation

@blazezhenli-sys
Copy link

@blazezhenli-sys blazezhenli-sys commented Feb 3, 2026

Fixes #15

Makes selecting something from the dropdown remove it from the displayed options without having to reselect the dropdown. Also makes the dropdown not appear if there are no more options to select.

Summary by CodeRabbit

  • New Features
    • Category selection now precomputes per-category availability for faster, more accurate feedback.
    • Input fields show "No more options" and become disabled when a category is exhausted.
    • Dropdowns only open when options are available, preventing empty option lists.
    • Option clicks reliably add selections based on the current availability state.

@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

MakerView.svelte now computes per-category available options from the current selections (passed into getAvailableOptions), updates template logic to disable inputs and change placeholders when a category is empty, and conditions dropdown visibility and option rendering on that availability.

Changes

Cohort / File(s) Summary
Reactive dropdown & selection logic
src/views/MakerView.svelte
Changed getAvailableOptions signature to accept (key, currentSelections) and use currentSelections[key]; precomputes available and isEmpty inside the render loop; input placeholder becomes "No more options" and input is disabled when empty; dropdown visibility now requires showOptions[key] && !isEmpty; option rendering and on:click call addSelectionFromOption(key, option); removed inline direct reads of module-scoped selections in availability checks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I hopped through lists and pruned each choice,
Passing selections into a wiser voice.
When options end, I tuck the input tight,
No stray clicks now — the dropdown’s light.
Hop, click, vanish — tidy and bright.

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Feature/dropdown behavior fix' is vague and generic, using 'behavior fix' without specifying what behavior is being fixed or what the improvement entails. Use a more descriptive title like 'Make dropdown options reactively update on selection' to clearly convey the specific improvement being made.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The code changes successfully implement the requirement from issue #15 by making getAvailableOptions receive current selections and precomputing availability per category, enabling reactive removal of selected items from dropdowns.
Out of Scope Changes check ✅ Passed All changes are focused on the MakerView dropdown behavior and directly support the objective of reactive option removal from issue #15; no out-of-scope modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@src/views/MakerView.svelte`:
- Around line 256-264: The option buttons only use on:mousedown|preventDefault
which breaks keyboard activation; keep the existing on:mousedown|preventDefault
on the .row__option to prevent blur but also add an on:click handler that calls
addSelectionFromOption(categoryItem.key, option) so keyboard-enter/space fires
the selection; update the .row__options/.row__option button markup to include
both handlers and ensure available, categoryItem.key and addSelectionFromOption
are used for the click invocation.
- Around line 235-236: The function getAvailableOptions currently declares a
single parameter (key: CategoryKey) but is called with two args (key and
selections); change its signature to accept selections (e.g.,
getAvailableOptions(key: CategoryKey, selections: SelectionsType)) and replace
any closure usage of selections with the new parameter, then update all call
sites that pass selections (the calls that use
getAvailableOptions(categoryItem.key, selections) and the other call in the same
file) so types align and TypeScript arity errors are resolved.

@blazezhenli-sys
Copy link
Author

CodeRabbit Suggestions implemented

@Jeccoman
Copy link
Contributor

Jeccoman commented Feb 4, 2026

Well, damn!
I already fix this

@blazezhenli-sys
Copy link
Author

Well, damn! I already fix this

Yeah, and your PR does more than mine overall.
That said, one difference between the fixes is that this one prevents the dropdown form appearing if there are no more entries.
I like what I'm seeing in your PR as well, I am currently working off of it to make the print process work correctly and add a print button to the main page. No PR in for that yet, though.

@Jeccoman
Copy link
Contributor

Jeccoman commented Feb 4, 2026

Well, damn! I already fix this

Yeah, and your PR does more than mine overall. That said, one difference between the fixes is that this one prevents the dropdown form appearing if there are no more entries. I like what I'm seeing in your PR as well, I am currently working off of it to make the print process work correctly and add a print button to the main page. No PR in for that yet, though.

Fascinating...
Keep pushing

@blazezhenli-sys
Copy link
Author

Well, damn! I already fix this

Yeah, and your PR does more than mine overall. That said, one difference between the fixes is that this one prevents the dropdown form appearing if there are no more entries. I like what I'm seeing in your PR as well, I am currently working off of it to make the print process work correctly and add a print button to the main page. No PR in for that yet, though.

Fascinating... Keep pushing

Will do...?
Anyway, I made a PR to merge into your PR, I think it could useful, so let me know when you have a chance to check it out :)

@komali2
Copy link
Member

komali2 commented Feb 5, 2026

Sorry I thought this was somehow a PR into the other branch that was open, now it has merge conflicts

@blazezhenli-sys
Copy link
Author

All good, that PR was open in the other Jeccoman's fork, ill open it here now since his changes are merged now.
Then I might come back to this.

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.

Items in dropdowns should reactively be removed from dropdown on-click

3 participants