Skip to content

Replace CategoryOptions VAutocomplete with KMultiSelect expanded mode - #6386

Open
AradhyaTiwari10 wants to merge 4 commits into
learningequality:unstablefrom
AradhyaTiwari10:category-options-kmultiselect-expanded-6346
Open

AradhyaTiwari10 wants to merge 4 commits into
learningequality:unstablefrom
AradhyaTiwari10:category-options-kmultiselect-expanded-6346

Conversation

@AradhyaTiwari10

@AradhyaTiwari10 AradhyaTiwari10 commented Nov 14, 2026 •

Copy link
Copy Markdown

Summary

CategoryOptions used a Vuetify VAutocomplete for the dropdown and, in the edit modal's expanded mode, a hand-rolled always-open list. Both are replaced with KDS 5.10.0 KMultiSelect; the modal uses its expanded prop: the option list renders inline under the search field with no menu toggle (listMaxHeight 250px), chips show the full category path in a tooltip and have a remove button, and clear-all is kept. Selection semantics are unchanged: adding a category applies it to every edited node, removing a chip also drops its stored descendants, categories applied to only some nodes stay partial, clear removes everything. No Vuetify left in the component.

References

Closes #6346

Reviewer guidance

  • Open the edit modal for one and for several resources and use the Category field: type to filter, pick options, remove chips, clear all. With several resources selected, a category applied to only some of them must keep that state when another category is added.
  • Tests: pnpm exec jest --config jest_config/jest.conf.js categoryOptions - 17 pass. The 9 dropdown-mode tests are untouched; the expanded-mode tests were rewritten for KMultiSelect (inline list, filtering, no-results text, selection applied to all nodes, partial kept, chip removal with descendants, last-chip removal keeping partials, clear-all).
  • The inline list renders without focusing the field; the tests read it with findByRole.
  • Behaviour change to confirm: the old expanded checkbox list showed a parent as checked when any child was selected, and clicking it removed both. KMultiSelect shows that parent as partially selected, and clicking it adds the parent and keeps the child. This matches dropdown mode but differs from the previous expanded list.
  • Clear-all vs removing the last chip: KMultiSelect emits [] for both. Chip removal is routed through onChipRemove, so only clear-all wipes partially applied categories (regression test added).
  • Pre-existing, not touched here: EditBooleanMapModal.vue:193 does not save removals or clear-all when categories are mixed across nodes. Happy to do that as a follow-up.

AI usage

Written with an AI coding agent (Claude Code). I directed the change, reviewed it against the KMultiSelect API and ran the tests and kolibri-format locally.

Replaces the Vuetify autocomplete and the hand-rolled always-open list with KMultiSelect's expanded prop (KDS 5.10.0). Closes learningequality#6346.
@AradhyaTiwari10
AradhyaTiwari10 requested review from a team and leq-bot and a balanced review from Copilot November 14, 2026 17:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@learning-equality-bot

Copy link
Copy Markdown
Contributor

👋 Hi @AradhyaTiwari10, thanks for contributing!

For the review process to begin, please verify that the following is satisfied:

  • Contribution is aligned with our contributing guidelines

  • Pull request description has correctly filled AI usage section & follows our AI guidance:

    AI guidance

    State explicitly whether you didn't use or used AI & how.

    If you used it, ensure that the PR is aligned with Using AI as well as our DEEP framework. DEEP asks you:

    • Disclose — Be open about when you've used AI for support.
    • Engage critically — Question what is generated. Review code for correctness and unnecessary complexity.
    • Edit — Review and refine AI output. Remove unnecessary code and verify it still works after your edits.
    • Process sharing — Explain how you used the AI so others can learn.

    Examples of good disclosures:

    "I used Claude Code to implement the component, prompting it to follow the pattern in ComponentX. I reviewed the generated code, removed unnecessary error handling, and verified the tests pass."

    "I brainstormed the approach with Gemini, then had it write failing tests for the feature. After reviewing the tests, I used Claude Code to generate the implementation. I refactored the output to reduce verbosity and ran the full test suite."

📢✨ Before we assign a reviewer:

  • @rtibblesbot will pre-review this pull request. Its comments are generated by an LLM, and should be evaluated accordingly.
  • We'll also invite community pre-review. See the community review guidance for both authors and reviewers.

Also check that issue requirements are satisfied & you ran pre-commit locally.

Pull requests that don't follow the guidelines will be closed.

Reviewer assignment can take up to 2 weeks.

@rtibblesbot

rtibblesbot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

🟡 Waiting for changes

Outcome: skipped — no new commits since 6be537c

Last updated: 2026-11-14 23:12 UTC

@rtibblesbot rtibblesbot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR #6386: no blocking issues. CI passing. Manual QA did not complete.

  • suggestion: removing the last full category wipes partial ones.
  • suggestion: expanded-mode parent state changed; note it in the PR body.
  • suggestion: two tests miss what they claim.
  • nitpick: docstring repeats the code.
  • pre-existing: with mixed categories, EditBooleanMapModal.vue:193 never saves removals or clear-all. Fix here, or in a follow-up?

Next step: Needs a full code review by a human engineer, then manual QA once that reviewer sets Needs QA.

  • The author is outside the team: confirm this should be built at all.
  • User-visible files changed: contentcuration/contentcuration/frontend/shared/views/contentNodeFields/CategoryOptions.vue.
  • Confirm that a parent with a selected child should show as partly selected in expanded mode, not checked as it was before.
  • Decide whether the EditBooleanMapModal mixed-categories save bug gets fixed here, since the clear-on-empty handling only stays safe while that bug exists.
  • In the Edit categories modal, check that the list is open without focus, and that chip removal and clear-all work with several nodes selected.

Written by rtibblesbot, an LLM-based coding agent.

itemValue="value"
itemText="text"
:label="translateMetadataString('category')"
:autoPromoteParent="false"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: In expanded mode, a parent with a selected child now shows as partly selected instead of checked.

  • On unstable, Arts showed checked when Dance was selected. Clicking Arts removed both.
  • Now Arts shows "Partially selected". Clicking it adds Arts and keeps Dance.
  • Gone too: a parent showed checked when its partly applied children together covered every node.

This matches dropdown mode, but the issue asked for unchanged expanded behaviour. List it in the PR body for a reviewer to confirm.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Documented in the PR body as a behaviour change for the reviewer to confirm. KMultiSelect has no mode that shows a parent as checked because a child is selected, so matching the old list exactly would mean re-implementing the list outside KMultiSelect, which is what this PR removes. Happy to add a parent-promotion rule if the team wants the old reading back.

Route chip removal through the component so an empty KMultiSelect value can be told apart from clear-all; only clear-all wipes partially applied categories. Tests no longer focus the field before reading the inline list, the duplicate tooltip test is dropped, and a regression test covers last-chip removal.

@rtibblesbot rtibblesbot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR #6386: removing a category can still wipe categories that only some selected nodes have (inline). Two of three prior suggestions are still open. The docstring nitpick is resolved. CI passes. Manual QA didn't run. Commits pushed after 1319e6a weren't reviewed.

  • The chip-click fix works. Its test fails without the fix.
  • Still open from the last round, with no change or reply. Please fix each or reply with why not:
    • A parent with a selected child shows as partly selected (CategoryOptions.vue:9).
    • findByText(DANCE_PATH) matches the path anywhere on the page (categoryOptions.spec.js:204).
Prior-finding status

UNADDRESSED — CategoryOptions.vue:137 — removing the last fully applied category clears partly applied ones (fixed for chip clicks only)
UNADDRESSED — CategoryOptions.vue:9 — parent with a selected child shows as partly selected instead of checked
RESOLVED — categoryOptions.spec.js — test clicks first, so it doesn't prove the list shows without focus
UNADDRESSED — categoryOptions.spec.js:204 — findByText(DANCE_PATH) matches the path anywhere on the page
RESOLVED — CategoryOptions.vue — docstring repeats the code

Next step: Needs a full code review by a human engineer, then manual QA once that reviewer sets Needs QA.

  • The author is outside the team: confirm this should be built at all.
  • User-visible files changed: contentcuration/contentcuration/frontend/shared/views/contentNodeFields/CategoryOptions.vue.
  • Decide whether clear-all should keep wiping partly applied categories, which needs a KDS event, or remove only the visible chips.
  • In the multi-node edit modal, check that Backspace, unchecking an item and the chip × each keep categories that only some nodes have.

Written by rtibblesbot, an LLM-based coding agent.

@AradhyaTiwari10

Copy link
Copy Markdown
Author

Thanks. Pushed 1319e6a and 80eb8f8: chip removal now goes through onChipRemove so an empty value can be told apart from clear-all (the previous.length > 1 heuristic broke clear-all with a single chip plus partials, so the chip slot is used instead), with a regression test; the three tests read the inline list with findByRole without focusing the field; the duplicate tooltip test is dropped; docstring trimmed. The parent-state change and the EditBooleanMapModal save bug are listed in the PR body; I can take the modal fix as a follow-up if the reviewer prefers it separate.

@rtibblesbot rtibblesbot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR #6386: 3 of 6 prior findings are resolved. 3 suggestions are still open and unchanged since the last round:

  • CategoryOptions.vue:9: in expanded mode, a parent with a selected child shows as partly selected, not checked. Fix it, or reply on its thread.
  • CategoryOptions.vue:137: Backspace, or unchecking the last category, still clears partly applied categories. Fix it, or reply on its thread.
  • categoryOptions.spec.js:204: findByText(DANCE_PATH) passes if the path renders anywhere on the page. Fix it, or reply on its thread.

CI passing. Manual QA did not run.

Prior-finding status

RESOLVED — CategoryOptions.vue — removing the last fully applied category clears every partly applied one
RESOLVED — categoryOptions.spec.js — test clicks first, so it doesn't prove the list shows without focus
RESOLVED — CategoryOptions.vue — docstring's second sentence repeats the code
UNADDRESSED — CategoryOptions.vue:9 — parent with a selected child shows as partly selected
UNADDRESSED — CategoryOptions.vue:137 — Backspace and unchecking the last category wipe partly applied categories
UNADDRESSED — categoryOptions.spec.js:204 — findByText(DANCE_PATH) passes if the path renders anywhere

Next step: Needs a full code review by a human engineer, then manual QA once that reviewer sets Needs QA.

  • The author is outside the team: confirm this should be built at all.
  • User-visible files changed: contentcuration/contentcuration/frontend/shared/views/contentNodeFields/CategoryOptions.vue.
  • Decide whether a parent with a selected child should show as checked or partly selected in the expanded list.
  • Decide whether Backspace or unchecking the last category should keep categories that only some of the edited nodes have.
  • In the multi-node edit modal, check that the expanded category list, the chip tooltips and chip removal behave correctly.

Written by rtibblesbot, an LLM-based coding agent.

KMultiSelect emits an empty value for clear-all, chip removal, Backspace in an empty search field and unchecking the last option alike. The clear button's click is now noted in the capture phase and only that path clears everything; every other empty value is treated as an ordinary removal, so categories applied to some of the edited nodes survive, as on unstable. Tests cover the uncheck and Backspace paths; the expanded-mode tooltip test duplicated the dropdown one and is removed.

@rtibblesbot rtibblesbot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR #6386: 5 of 6 prior findings resolved; 1 contested.

  • CategoryOptions.vue:9 — a parent with a selected child shows as partly selected instead of checked. The author says KMultiSelect can't show it as checked. The PR body lists it as a behaviour change. A maintainer needs to accept it or ask for a parent-promotion rule.

CI passing. Manual QA did not run.

Prior-finding status

RESOLVED — CategoryOptions.vue — Removing the last fully applied category also clears every partly applied one
RESOLVED — categoryOptions.spec.js — Test clicks first, so it doesn't prove the list shows without focus
RESOLVED — CategoryOptions.vue — Docstring's second sentence repeats the code
RESOLVED — CategoryOptions.vue — Backspace and unchecking the last category still wipe partly applied categories
RESOLVED — categoryOptions.spec.js — findByText(DANCE_PATH) passes if the path renders anywhere on the page
CONTESTED — CategoryOptions.vue:9 — Parent with a selected child shows as partly selected instead of checked

Next step: Needs a full code review by a human engineer, then manual QA once that reviewer sets Needs QA.

  • The author is outside the team: confirm this should be built at all.
  • User-visible files changed: contentcuration/contentcuration/frontend/shared/views/contentNodeFields/CategoryOptions.vue.
  • Decide whether a parent with a selected child showing as partly selected, not checked, is acceptable.
  • In the edit modal, check that the clear button, chip close, uncheck and Backspace each keep or drop partly applied categories as intended.

Written by rtibblesbot, an LLM-based coding agent.

@AradhyaTiwari10

Copy link
Copy Markdown
Author

@LianaHarris360 this is ready for a human review: KMultiSelect expanded mode for CategoryOptions, 18 tests green, and the pre-reviewer's points about partially applied categories are addressed (only the clear button wipes them now). One behaviour change is listed in the description for you to confirm: a parent with a selected child shows as partially selected rather than checked, which matches dropdown mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Remove Vuetify from Studio] Replace CategoryOptions VAutocomplete with KMultiSelect expanded mode

3 participants