Add delete functionality for maps and tilesets, enhance PWA support#4
Add delete functionality for maps and tilesets, enhance PWA support#4wernerbihl merged 4 commits intomainfrom
Conversation
- Updated @tailwindcss/vite from ^4.1.18 to ^4.2.2 - Updated @vitejs/plugin-react from ^5.1.1 to ^6.0.1 - Updated vite from ^7.2.4 to ^8.0.9 - Refactored manual chunking logic in vite.config.ts to use a function for better maintainability
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds delete actions for maps/tilesets via context menus, improves PWA update behavior, and updates build tooling/docs for a Vite 8 upgrade.
Changes:
- Add “Delete” items to map and tileset context menus (reusing existing delete target plumbing).
- Add explicit service worker registration/update polling and configure Workbox for faster activation.
- Upgrade to Vite 8 + related dependencies, and refresh README/TODO.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| vite.config.ts | Updates PWA Workbox settings and refactors Rollup chunk splitting into a function. |
| tsconfig.app.json | Adds PWA client types for virtual:pwa-register usage. |
| src/pwa.ts | Implements service worker registration + periodic update checks + reload on controller change. |
| src/main.tsx | Lazy-loads PWA registration only in production builds. |
| src/components/layout/Toolbar.tsx | Adds a top-right repository link button. |
| src/components/editor/TilesetPanel.tsx | Adds “Delete” context menu item and centralizes delete target setup. |
| src/components/editor/MapPanel/MapPanelTabs.tsx | Adds “Delete” context menu item and centralizes delete target setup. |
| package.json | Upgrades Vite/plugin versions and adjusts deploy command. |
| bun.lock | Lockfile updates for the dependency upgrades (Vite 8 and related tree changes). |
| TODO.txt | Updates TODO items to reflect work done / upcoming. |
| README.md | Replaces template README with project-focused documentation and setup steps. |
| for (const [chunkName, packages] of manualChunkPackages) { | ||
| for (const packageName of packages) { | ||
| if ( | ||
| id.includes(`/node_modules/${packageName}/`) || | ||
| id.endsWith(`/node_modules/${packageName}`) | ||
| ) { | ||
| return chunkName; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| return null; |
There was a problem hiding this comment.
manualChunkscallbacks are expected to return a chunk name (string) or nothing; returningnullis not a “no match” value for Rollup/Vite and can cause type/runtime issues. Returnundefined(or no return statement) instead. Also, matching on hard-coded POSIX/node_modules/paths can fail on Windows (backslashes); normalizeidto forward slashes (or use a path-separator-agnostic check) beforeincludes(...)/endsWith(...)`.
| for (const [chunkName, packages] of manualChunkPackages) { | |
| for (const packageName of packages) { | |
| if ( | |
| id.includes(`/node_modules/${packageName}/`) || | |
| id.endsWith(`/node_modules/${packageName}`) | |
| ) { | |
| return chunkName; | |
| } | |
| } | |
| } | |
| return null; | |
| const normalizedId = id.replace(/\\/g, "/"); | |
| for (const [chunkName, packages] of manualChunkPackages) { | |
| for (const packageName of packages) { | |
| if ( | |
| normalizedId.includes(`/node_modules/${packageName}/`) || | |
| normalizedId.endsWith(`/node_modules/${packageName}`) | |
| ) { | |
| return chunkName; | |
| } | |
| } | |
| } | |
| return undefined; |
| "typescript": "~5.9.3", | ||
| "typescript-eslint": "^8.46.4", | ||
| "vite": "^7.2.4", | ||
| "vite": "^8.0.9", |
There was a problem hiding this comment.
vite-plugin-pwa@^1.2.0declares a Vite peer dependency up to^7(as reflected in the updated lockfile metadata), so upgrading to Vite 8 is likely to produce an unmet peer dependency and/or break PWA integration at build time. Upgradevite-plugin-pwa` to a release that explicitly supports Vite 8 (or keep Vite on 7.x until the plugin supports 8) to avoid CI/build failures.
| "vite": "^8.0.9", | |
| "vite": "^7.0.0", |
| <a | ||
| href="https://github.com/2dtiler/app" | ||
| target="_blank" | ||
| rel="noreferrer" |
There was a problem hiding this comment.
Links opened with target="_blank" should include "noopener" to prevent reverse-tabnabbing. Update rel to include noopener (typically rel="noopener noreferrer").
| rel="noreferrer" | |
| rel="noopener noreferrer" |
Implement delete options for maps and tilesets in their respective context menus. Improve PWA capabilities with service worker registration and update handling. Update dependencies and documentation for Vite 8 upgrade.