Skip to content

Add a project library with named projects stored in IndexedDB - #2

Merged
pythonicode merged 1 commit into
mainfrom
feat/project-library
Oct 14, 2026
Merged

pythonicode merged 1 commit into
mainfrom
feat/project-library

Conversation

@pythonicode

@pythonicode pythonicode commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds a project library so several projects can be kept in the browser, each with a name.

This PR is stacked on #1 (fix/audit-bugs-and-code-health). Its base is that branch, so the diff shows only the library work. It replaces the confirm-before-open dialog from #1: opening a file or the sample now adds a project to the library instead of replacing the current one, so there is nothing to confirm.

What changes for users

  • Projects dialog (Projects button, or the overflow menu on touch and compact layouts): lists saved projects with a thumbnail, map name and last-updated time. Click one to open it, rename it, or delete it (two-step confirm). Also starts a new project.
  • New creates a new project in the library rather than clearing the current one.
  • Project name is editable in the title bar and is saved in .anal files. Files saved before this change still open; their name defaults to the map name.
  • Open and drag-and-drop of .anal files, and the sample project, add a new project to the library.
  • The open project is remembered across reloads.

How it is stored

  • Each project has its own IndexedDB records: project JSON (map image as a placeholder), map-image Blob, thumbnail, and a library entry (name, timestamps).
  • Autosave writes only the open project. A new empty project is not listed until it gets content.
  • A project saved by the single-project build moves into the library on first load.

Code layout

  • src/persistence/library.ts: IndexedDB records and legacy migration
  • src/persistence/projectStorage.ts: zustand autosave adapter, now per project
  • src/projectLibrary.ts: create, open, import, rename and delete actions
  • src/components/ProjectLibraryModal.tsx: the dialog

Testing

  • bun run test, bun run lint, bun run build pass.
  • Verified in the browser: the legacy project migrated on first load (legacy keys removed, thumbnail created); new project starts empty and is not listed until it has content; opening the sample adds an entry and renaming updates the title and the library; switching in both directions restores each project's image and name; reload reopens the last project; two-step delete removes only the chosen entry; deleting the only project falls back to a new empty project; dropping a named .anal file adds it to the library.
  • Not verified: behaviour with several large maps (storage quota), and the touch layout of the library dialog.

Notes for review

  • Deleting a project is permanent. There is no undo or trash.
  • Project names do not need to be unique. Each project is identified by its own ID.

🤖 Generated with Claude Code

Each project now has its own record, map-image blob, thumbnail and library
entry, and the open project is remembered across reloads. A Projects dialog
lists saved projects with thumbnails and switches between them, supports
rename and two-step delete, and starts new projects. Projects have a name
that is edited in the title bar and saved in .anal files. Opening a file or
the sample adds it to the library instead of replacing the current work, so
the confirmation dialog from the previous change is removed. A project saved
by the single-project build moves into the library on first load.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
analysis Ready Ready Preview Oct 14, 2026 8:53am UTC

@pythonicode
pythonicode changed the base branch from fix/audit-bugs-and-code-health to main October 14, 2026 08:53
@pythonicode
pythonicode merged commit a325bf7 into main Oct 14, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 8e716b68 Deployed Oct 14, 2026 by vercel[bot]
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.

1 participant