Repository navigation
fix(web): make raw memory type non-removable in multi-select - #17119
Conversation
Mark the raw memory type option as disabled in MemoryOptions so the MultiSelect no longer renders a remove button for it and preserves it across clear/backspace interactions, matching the form validation that requires raw to always be selected.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe memory options configuration marks ChangesMemory option availability
Estimated code review effort: 1 (Trivial) | ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
wangq8
left a comment
There was a problem hiding this comment.
Review: PR #17119 — Make raw memory type non-removable in multi-select
What it does
Adds disabled: true to the raw option in MemoryOptions so the existing MultiSelect component:
- Hides the remove (x) button on the raw badge
- Prevents toggling it off in the dropdown
- Preserves it on clear-all / Backspace
Analysis
- Single-line change in the source of truth (
web/src/pages/memories/constants/index.tsx). Both the creation dialog and the settings form reuseMemoryOptions, so the fix covers both without duplication. - The
disabledproperty is already handled by the MultiSelect component (preserveDisabledValues), so this is a clean, minimal fix — no new logic needed. - Correctly addresses the UX bug:
rawis a required memory type that form validation enforces, so the UI should not allow deselecting it.
Verdict
✅ LGTM — minimal, correct, well-covered.
Summary
In the memory configuration dialogs, the
rawmemory type is required (form validation rejects submissions that don't include it), but theMultiSelectstill rendered a remove ("x") button on the raw badge, allowing users to deselect it via the badge, the dropdown, clear-all, or Backspace.This PR marks the
rawoption asdisabledinMemoryOptions(web/src/pages/memories/constants/index.tsx). The existing option-leveldisabledhandling inMultiSelectthen:preserveDisabledValues).Both the memory creation dialog (
createMemoryFields) and the memory settings form (memory-model-form.tsx) reuseMemoryOptions, so the fix applies to both.