mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
* feat(ui): pick an existing folder when installing into a folder The "Into folder" field in the install dialog was free text, so users mistyped paths or could not see which folders already exist. Replace it with a picker listing the source root, every existing folder, and a "New folder..." entry that reveals an input validated like validate.IntoPath. The `into` value sent to the API is unchanged, so no backend change is needed. Existing folders are derived client-side from the resource list and exclude tracked repos, followed source links, folders that are skills and names the server would reject. FolderPicker takes a disabledFolder prop so a later move dialog can reuse it. Refs #510 * fix(ui): block install while the picked folder is not a usable path Two paths let an unusable `into` through: - Choosing "New folder..." cleared the value but still counted as valid, so install silently went to the source root. The picker now reports validity with each change and an empty new folder is invalid. - Validity was ignored once Advanced was collapsed, and the server does not run IntoPath on install, so a bad path could still be installed. The dialog now keeps the picker's validity regardless of the panel. * feat(ui): make new folder a step in the folder picker Typing a new folder path inline gave no sense of where it would land or what the skill's link would be called. Align the picker with the approved design: - Picker rows show a folder icon, the path in monospace, and how many skills are under it; "New folder..." sits below a separator. - "New folder..." opens a step in the dialog with a parent folder, a name, and a result box with the folder path and the link name (path with / as __ in front of the skill name). Using it returns to the picker with the new path selected and tagged as new. - A caption under the picker says where the skill installs and what its link is called, using the skill name from the source when known. - Escape and the back arrow in the step return to the picker instead of closing the install dialog. The `into` sent to the API is still a plain path. FolderPicker takes disabledPaths (a folder and everything below it) for the move dialog. Refs #510
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel (or oxc when used in rolldown-vite) for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])