From 7673fc63ea1e2c81c3368a0697ca114695a02336 Mon Sep 17 00:00:00 2001 From: kaushik Date: Thu, 23 Jul 2026 07:34:20 +0530 Subject: [PATCH] feat: enhance styling and layout for toolbar, map components, and editor - Updated toolbar styles for improved layout and appearance, including padding and margin adjustments. - Introduced new styles for scale menu and compact dropdowns. - Enhanced map pin tooltips with better positioning and hover effects. - Added new styles for map sheet filters, including search and date range controls. - Improved editor styles for a more cohesive look and feel, including transport controls for video editing. - Expanded GeoLocation interface to include additional address fields and formatted address. - Updated MediaItem interface to include storage reference and uploadedBy fields. - Enhanced MediaComment interface with author details for better user identification. - Introduced GalleryUser interface to represent signed-in users in the host app. --- .claude/memory/MEMORY.md | 5 + .claude/memory/requirements.md | 66 +- .claude/memory/status.md | 55 +- .env.example | 8 + CLAUDE.md | 12 +- README.md | 41 +- docs/ARCHITECTURE.md | 85 ++- docs/ROADMAP.md | 42 +- docs/SETUP.md | 2 +- packages/photo-sdk/README.md | 263 +++++++ packages/photo-sdk/src/adapters/types.ts | 55 +- .../photo-sdk/src/components/AppShell.tsx | 34 +- packages/photo-sdk/src/components/Camera.tsx | 2 + .../photo-sdk/src/components/ContextMenu.tsx | 5 + .../photo-sdk/src/components/InfoPanel.tsx | 431 ++++++++--- packages/photo-sdk/src/components/Modal.tsx | 6 + .../photo-sdk/src/components/PhotoGallery.tsx | 181 ++++- packages/photo-sdk/src/components/Sidebar.tsx | 92 ++- .../photo-sdk/src/components/TopToolbar.tsx | 94 ++- .../src/components/editor/VideoEditor.tsx | 51 +- packages/photo-sdk/src/components/modals.tsx | 48 +- .../src/components/views/CollectionsView.tsx | 87 --- .../src/components/views/LibraryView.tsx | 13 +- .../src/components/views/MapView.tsx | 453 +++++++++++- .../src/components/views/PeopleView.tsx | 4 +- .../components/views/RecentlyDeletedView.tsx | 35 +- .../src/components/views/VersionsView.tsx | 1 + .../src/hooks/useKeyboardShortcuts.ts | 26 +- packages/photo-sdk/src/icons/index.tsx | 29 +- packages/photo-sdk/src/index.ts | 17 +- packages/photo-sdk/src/lib/media.ts | 23 +- packages/photo-sdk/src/store/selectors.ts | 4 + packages/photo-sdk/src/store/store.ts | 515 ++++++++++++- packages/photo-sdk/src/styles/sdk.css | 687 +++++++++++++++++- packages/photo-sdk/src/types.ts | 52 +- 35 files changed, 3130 insertions(+), 394 deletions(-) diff --git a/.claude/memory/MEMORY.md b/.claude/memory/MEMORY.md index dd19696..68f58aa 100644 --- a/.claude/memory/MEMORY.md +++ b/.claude/memory/MEMORY.md @@ -8,6 +8,11 @@ these files for full context. Keep them updated as work proceeds. - [requirements.md](requirements.md) — the COMPLETE requirements backlog (every request, tracked). - Human-facing docs live in [`/docs`](../../docs/) (ROADMAP / SETUP / ARCHITECTURE) and [`/CLAUDE.md`](../../CLAUDE.md). +> **Current focus (2026-07-23):** the SDK now **embeds into a host app** (LynkedUp CRM), not only the standalone demo — +> `embedded` layout, `chrome` suppression, host identity (`currentUser`) + theming (`ThemeTokens`), server-backed +> Recently-Deleted lock, and an **incremental** `StorageAdapter` (`applyChanges` + `putMedia`). See the latest +> `status.md` session entry and `docs/ROADMAP.md` §11. + ## Hard rules (do not violate) - **Never `git commit` / `git push`** — the user does that. Never commit secrets. - API keys live only in `apps/web/.env.local` (gitignored), read **server-side** only. diff --git a/.claude/memory/requirements.md b/.claude/memory/requirements.md index 8be8f00..d8bb9f9 100644 --- a/.claude/memory/requirements.md +++ b/.claude/memory/requirements.md @@ -12,34 +12,50 @@ Status: ✅ done · 🚧 in progress · ⬜ planned · 🔑 needs key/creds. Cro - ✅ Info panel (full metadata + **mini-map**). Themes menu + `accentColor`/`borderRadius` props. - ✅ Gemini generative editor (Remove BG/Restore/Colorize/Replace Sky/prompt) — 🔑 needs billed key (free=429). -## Now / next (in user's priority order) -1. 🚧 **Custom camera** (#1): getUserMedia preview; capture photo; record video; switch front/back; grid; +## Now / next (in user's priority order) — all ✅ done +1. ✅ **Custom camera** (#1): getUserMedia preview; capture photo; record video; switch front/back; grid; **live annotation + measurement**; geolocation on capture (permission); auto object-detect after capture. -2. ⬜ **Supabase backend + storage** (#last, 🔑): Postgres data + Supabase Storage. **No localStorage reliance** — - backend is the source of truth. Ask user for creds (URL, anon key, service-role key, bucket) with steps. -3. ⬜ Face clustering → People; OCR (tesseract.js) → document search; semantic "show me beach photos" - (transformers.js / Hugging Face CLIP) — all free, in-browser. -4. ⬜ Video editor + annotations; macOS-parity player polish. +2. ✅ **Supabase backend + storage** (🔑): Postgres data + Supabase Storage adapter (run `docs/supabase-setup.sql` + once). Backend is the source of truth on load. The CRM host supplies its own **incremental** data-door adapter + (`applyChanges` + `putMedia`); localStorage remains the zero-config dev default. +3. ✅ Face clustering → People; OCR (tesseract.js) → Documents + searchable text; semantic search + (transformers.js / CLIP) — all free, in-browser. +4. ✅ Full video editor + annotations (timeline engine, no ffmpeg); ✅ macOS-parity **custom video player**. -## New requests (this session — must add) -- ⬜ **Editor: straighten / tilt** (angle slider) — rotate by arbitrary degrees. -- ⬜ **Crop: free-form AND fixed-ratio** — when a ratio (e.g. 1:1 square) is selected, dragging/stretching the - crop box keeps that aspect ratio; also free crop. -- ⬜ **Import sync of existing metadata**: if an imported/mobile image already has tags (IPTC/XMP keywords) + - location + details, read and apply them (exifr supports XMP/IPTC). Keep object detection + object albums. -- 🚧 **Web-meaningful UI** (deep pass): "All Projects" → **"All Albums"** (this is a web gallery, not iOS); - remove "Open App Store" (meaningless on web); review sidebar tabs, **corner radius**, touch-ups so everything - is meaningful for a web gallery and matches macOS more closely. -- ⬜ **Search dropdown defaults**: show quick filters **Recently Viewed**, **Recently Edited** (+ Recently Shared) - when the search field is focused. -- ⬜ **Info → map click opens full Map** centered on that photo's location. -- ⬜ **Map parity w/ macOS**: locations + images + tags; latest image shown for a tag; **click a tag → open - that tag's images grouped by date** (date-wise). Tag = album-like view, date-grouped. -- ⬜ **Local-model fallback**: if Gemini key missing/invalid, use a local model. Concretely wire - `@imgly/background-removal` (free, in-browser) for Remove Background so it always works without a key. -- ⬜ **Everything free**; build our own if no free option. +## New requests (early sessions — now all done) +- ✅ **Editor: straighten / tilt** (angle slider) — rotate by arbitrary degrees. +- ✅ **Crop: free-form AND fixed-ratio** — a selected ratio (e.g. 1:1) is kept while dragging; also free crop. +- ✅ **Import sync of existing metadata**: IPTC/XMP keywords + location read on import (exifr) alongside object detection. +- ✅ **Web-meaningful UI** (deep pass): "All Projects" → **"All Albums"**; removed "App Store"; sidebar tabs / corner + radius / touch-ups reviewed for a web gallery matching macOS. +- ✅ **Search dropdown defaults**: Recently Viewed / Recently Edited / Recently Added when the search field is focused. +- ✅ **Info → map click opens full Map** centered on that photo's location. +- ✅ **Map parity w/ macOS**: click a tag → that tag's images grouped by date; thumbnail pins; location sheets. +- ✅ **Local-model fallback**: `@imgly/background-removal` (free, in-browser) wired for Remove Background — no key needed. +- ✅ **Everything free**; build our own where no free option (analysis/OCR/faces/semantic/bg-remove all run in-browser). - ✅ **Memory in project `.claude/` folder** (this folder) — done. -- ⬜ More **advanced features** (open-ended; user will add more later). +- ✅ More **advanced features** — versioning + audit log, comments, advanced video editor, sharing, password lock, + glass design polish, custom video player (open-ended; new requests continue below). + +## Host-app embedding & CRM integration (2026-07-23) — done +> The SDK now embeds into a host product (LynkedUp CRM), not only the standalone demo. All of it is opt-in. +- ✅ **Embedded layout** (`embedded`) + **chrome suppression** (`chrome`, `DEFAULT_CHROME`) + **`hiddenViews`** + + **`keyboardShortcuts`** flag; live `setConfig` re-applies theme/tokens/identity/chrome without remount. +- ✅ **Host identity** (`currentUser: GalleryUser`) → identity-stamped **comments** (`authorId/author/authorAvatar`, + delete only own), **uploads** (`MediaItem.uploadedBy`, never overwritten), **versions** (author on each). Info panel + shows "Uploaded by" + per-version author. `be-crm` still owns `owner_principal_id` (display-only here). +- ✅ **`shareBaseUrl`** (host owns share-link base) + **full-screen** (`defaultFullscreen`, `.apg--fullscreen`, + `setFullscreen`/`toggleFullscreen`). +- ✅ **Full `ThemeTokens` map (52 keys)** → CSS vars (sanitized); floating glass toolbar + `.apg-scalemenu` dropdown. +- ✅ **Incremental adapter**: `applyChanges(StateChanges)` (diff-based, serialized, rollback-on-reject) + + `putMedia(id, blob, meta) → StoredBlob {ref,url}`; `MediaItem.storageRef`. Types `StateChanges`/`StoredBlob` exported. +- ✅ **Server-backed Recently-Deleted lock** (`lockProvider { status, set, verify }`) replaces the device-local hash; + `lockConfigured` = UI truth; `lockError` = wrong-password vs unavailable. +- ✅ **Editable caption + multi-line `note`** in Info (searchable); **full-address reverse geocoding** (Nominatim, + persisted); **map** fly-to / count badge / hover mini-slider / date-range location filter. +- ✅ **UI fixes**: Info-panel inline `