Skip to content

Add delete functionality for maps and tilesets, enhance PWA support#4

Merged
wernerbihl merged 4 commits intomainfrom
feature/2026-04-21
Apr 20, 2026
Merged

Add delete functionality for maps and tilesets, enhance PWA support#4
wernerbihl merged 4 commits intomainfrom
feature/2026-04-21

Conversation

@wernerbihl
Copy link
Copy Markdown
Collaborator

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.

- 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
Copilot AI review requested due to automatic review settings April 20, 2026 20:06
@wernerbihl wernerbihl merged commit aea4ec4 into main Apr 20, 2026
3 of 4 checks passed
@wernerbihl wernerbihl deleted the feature/2026-04-21 branch April 20, 2026 20:07
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread vite.config.ts
Comment on lines +28 to +39
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;
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(...)`.

Suggested change
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;

Copilot uses AI. Check for mistakes.
Comment thread package.json
"typescript": "~5.9.3",
"typescript-eslint": "^8.46.4",
"vite": "^7.2.4",
"vite": "^8.0.9",
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"vite": "^8.0.9",
"vite": "^7.0.0",

Copilot uses AI. Check for mistakes.
<a
href="https://github.com/2dtiler/app"
target="_blank"
rel="noreferrer"
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Links opened with target="_blank" should include "noopener" to prevent reverse-tabnabbing. Update rel to include noopener (typically rel="noopener noreferrer").

Suggested change
rel="noreferrer"
rel="noopener noreferrer"

Copilot uses AI. Check for mistakes.
@2dtiler 2dtiler deleted a comment from Copilot AI Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants