mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 11:12:35 +02:00
Follow-up to #2680: the calendar toggle only put dates on the file pane, so the folder tree had no way to show the timestamp it was already sorting on. FolderTreeItem now takes showModified and renders latest_activity_at under the folder name, threaded through the recursive call so nested folders get it too. No backend change - the field was already on the wire from the sort fix. Folders are labelled "last activity", not "last modified", and get their own i18n key. The value is the newest timestamp among the folder, its files and everything below it, so a folder can read as newer than its own directory mtime - calling that "modified" would look like a fresh instance of the ls -lt mismatch the issue was originally about. Folders with no activity render nothing rather than an Invalid Date placeholder. The name span moved into a flex column so the second line does not disturb the row's link badge, file count or kebab menu. That broke a folder-delete test that reached the row via parentElement, now fixed to use closest(). Separately, the #996 collapse describe left an implementation on the module-global localStorage.getItem mock, which silently collapsed the folder tree for every describe after it. It resets in afterEach now; without that, any later test asserting on nested folders fails for reasons unrelated to what it is testing.
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...
},
},
])