feat: AR Viewer - WebAR with model-viewer, 5 environment presets, placement modes

- Add Google model-viewer 3.5.0 CDN script to client/index.html for WebXR/QuickLook AR
- Create ARViewer.tsx modal component with 5 Japanese environment presets (tatami, modern-japanese, wooden-table, stone-surface, neutral), floor/shelf/wall placement mode selector, WebXR support detection, and small-item scale reference badge
- Replace external AR link in ProductDetail.tsx with in-browser ARViewer modal; auto-detect placement mode from craft_category (textiles=wall, others=floor) and isSmallItem from product dimensions
- Patch GET /api/products/:id to null out ar_model_url when ar_eligible is false, preventing URL exposure for ineligible products

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-21 22:04:44 +00:00
parent 4859999340
commit cc695c6f28
4 changed files with 175 additions and 5 deletions

View File

@@ -103,6 +103,11 @@ router.get('/:id', async (req, res) => {
const product = rows[0];
// Security: do not expose ar_model_url if product is not ar_eligible
if (product.ar_eligible === false) {
product.ar_model_url = null;
}
// Get reviews
const reviews = await pool.query(
`SELECT r.*, u.display_name FROM reviews r