docs: expand agent best practices

This commit is contained in:
2026-06-07 20:44:32 +02:00
parent a0a6c8e254
commit 4de12db213

View File

@@ -47,6 +47,23 @@ This repository is a browser-first photo mapping prototype.
- Verify the result with `git diff --check` when possible. - Verify the result with `git diff --check` when possible.
- Update the README only when the user-facing setup or features change. - Update the README only when the user-facing setup or features change.
## Practical Best Practices
- Prefer incremental changes over large rewrites.
- Keep naming consistent within a feature, especially for UI state and DOM references.
- Separate data handling, rendering, and network access where practical.
- Treat share loading, image parsing, and metadata extraction as failure-prone paths.
- Handle missing EXIF data, empty shares, and partial import results gracefully.
- Keep browser work lightweight; avoid unnecessary re-renders or duplicate downloads.
- Reuse existing helpers and structures before introducing new abstractions.
- Prefer plain, readable TypeScript over clever patterns.
- Add comments only where the code would otherwise be hard to follow.
- Preserve backward compatibility for the public import flow when possible.
- If a change affects user-visible text, keep the tone short, clear, and professional.
- If a change affects the UI, check the result at both desktop and mobile widths.
- If a change affects performance, prefer streaming or progressive rendering over waiting for all items.
- If a change affects deployment, keep the container build simple and reproducible.
## Deployment Notes ## Deployment Notes
- The app is designed to run in a container. - The app is designed to run in a container.