* refactor: move folder management from sidebar into model selector * Fix folder management: restore LoRA picker sync, error handling, caching - Restore onFoldersChange callback to keep LoRA adapter picker in sync when scan folders are added/removed (fixes regression from sidebar move) - Thread onFoldersChange through ModelSelector -> HubModelPicker prop chain - Add module-level _scanFoldersCache to prevent folder list flash on re-open - Surface error toast on folder removal failure instead of silently ignoring - Guard handleAddFolder against concurrent double-submit via folderLoading - Clear folderInput on Escape key dismiss to prevent stale input on re-open - Add refreshLocalModelsList and refreshScanFolders to useEffect dep array * Fix compare-mode folder sync, Escape key propagation, cancel toggle state - Wire onFoldersChange through CompareContent/GeneralCompareContent so compare-mode selectors also refresh local models after folder changes - Add e.stopPropagation() on Escape key in folder input to prevent Radix Popover from closing the entire model selector dropdown - Add e.preventDefault() on Enter key to prevent form submission - Clear folderInput and folderError when cancel toggle hides the input, matching the Escape key behavior for consistency * Fix folder mutation state ordering and touch accessibility - Use optimistic updates for add/remove so the folder list reflects changes immediately instead of waiting on a second listScanFolders round-trip that could silently fail. - Move refreshScanFolders out of the finally block in handleRemoveFolder so it runs after the cache update, not after onFoldersChange. - Make the remove button visible on touch/mobile devices and reachable via keyboard focus (opacity-100 on small screens, focus-visible). - Add aria-label to the remove button for screen readers. * Deduplicate optimistic folder add to match backend behavior The backend returns the existing ScanFolderInfo row when adding a path that is already registered. The optimistic update was blindly appending the returned row, producing duplicate entries and React key warnings. Now checks by id before appending. * Add aria-label to folder toggle button and strengthen dedup check - Add aria-label to the +/cancel icon button for screen readers. - Extend optimistic dedup check to also compare by path, not just id, to handle edge cases where the cache is stale. --------- Co-authored-by: Daniel Han <danielhanchen@users.noreply.github.com> Co-authored-by: Daniel Han <danielhanchen@gmail.com> |
||
|---|---|---|
| .. | ||
| public | ||
| src | ||
| .gitignore | ||
| .gitkeep | ||
| biome.json | ||
| components.json | ||
| data-designer.openapi (1).yaml | ||
| eslint.config.js | ||
| index.html | ||
| package.json | ||
| tsconfig.app.json | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vite.config.ts | ||