📌 Description
ImageWithFallback (src/app/components/figma/ImageWithFallback.tsx) renders an inline base64 broken-image SVG on error with a generic alt, no default alt when alt is undefined, no retry, no onLoad signal, and no lazy loading.
💡 Why it matters: Images without alt text and without lazy loading hurt accessibility and performance.
🧩 Requirements and context
- Provide a sensible default
alt and an aria-label on the fallback.
- Add
loading="lazy" (where appropriate) and an onLoad callback.
- Add an optional one-time retry before showing the fallback.
- Extract the base64 SVG into a named constant.
Non-functional requirements
- Must be secure, tested, and documented.
- Should be efficient and easy to review.
🛠️ Suggested execution
1. Fork the repo and create a branch
git checkout -b feat/imagewithfallback
2. Implement changes
- Write/modify the relevant source:
src/app/components/figma/ImageWithFallback.tsx
- Write comprehensive tests:
src/app/components/figma/ImageWithFallback.test.tsx
- Add documentation: TSDoc
- Include TSDoc doc comments
- Validate security assumptions: do not echo untrusted
src into visible text
3. Test and commit
- Cover edge cases: load error, missing alt, retry then success
- Include test output and security notes in the PR description.
Example commit message
feat(image): alt fallback, retry, and lazy loading
✅ Acceptance criteria
🔒 Security notes
Avoid rendering untrusted src as user-visible text.
📋 Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
📌 Description
ImageWithFallback(src/app/components/figma/ImageWithFallback.tsx) renders an inline base64 broken-image SVG on error with a generic alt, no default alt whenaltis undefined, no retry, noonLoadsignal, and no lazy loading.🧩 Requirements and context
altand anaria-labelon the fallback.loading="lazy"(where appropriate) and anonLoadcallback.Non-functional requirements
🛠️ Suggested execution
1. Fork the repo and create a branch
2. Implement changes
src/app/components/figma/ImageWithFallback.tsxsrc/app/components/figma/ImageWithFallback.test.tsxsrcinto visible text3. Test and commit
npm run testExample commit message
✅ Acceptance criteria
🔒 Security notes
Avoid rendering untrusted
srcas user-visible text.📋 Guidelines