refactor(ui): replace custom file/folder controls with reusable SelectList#105
Open
RavenHogWarts wants to merge 2 commits into
Open
refactor(ui): replace custom file/folder controls with reusable SelectList#105RavenHogWarts wants to merge 2 commits into
RavenHogWarts wants to merge 2 commits into
Conversation
SelectList component and simplify file options logic
- Rename CSS selector for the select trigger to match SelectList usage
(button.form--SelectListTrigger).
- Remove complex popover, keyboard handling, open/active state and
extensive value-formatting logic from FileListControl.
- Introduce SelectList and SelectOption imports and provide a
getOptions(searchText) helper that returns up to 100 markdown file
options filtered by the search text.
- Replace manual mapping/formatting code with a concise mapper that
produces {id, value, label} entries for each file.
- Add a small formatValue helper to centralize internal-link handling
(preparing for simplified value formatting when integrating with the
SelectList).
- Remove unused imports and hooks (Popover, state refs, i18n local
instance, icons) to reduce complexity and shift behavior into the
reusable SelectList component.
The changes simplify FileListControl by delegating UI/interaction to the
SelectList component, reduce duplicate logic, and make file filtering
and option generation clearer and more testable.
Replace the folder path text-suggest control with a folder list selector and update related imports and styles. - Add FolderListControl component that provides a SelectList of vault folders (supports filtering and optional multiple selection). - Remove FolderPathControl implementation and switch usages to FolderListControl in CpsFormFieldControl. - Update SelectList CSS class names (rename FileListControl-specific selectors to generic SelectList selectors) and adjust styling for trigger arrow, placeholder, items and content input. - Update import in CpsFormFieldControl from FolderPathControl to FolderListControl and comment out the old FolderPathControl JSX. This change improves folder selection UX by offering a searchable list with multi-select support and consolidates select-list styling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What changed
Why