Repository navigation
feat: image optimisation, privacy-safe logging/analytics gating, README + architecture docs (#684, #692, #693, #694) - #822
Open
ogunrombimoyin1212-jpg wants to merge 1 commit into
Conversation
…ME and architecture docs - amina69#684: add shared ResponsiveImage (lazy/eager, explicit dimensions, srcset/sizes, placeholder, error fallback) and use it in cards and galleries - amina69#692: add logger, analytics (flag-gated, event allow-list) and PII scrubbing; replace console.* usages and remove payload/email logging - amina69#693: update README (features, real project tree) and add docs/features/*.md - amina69#694: add docs/architecture.md with Mermaid request, realtime, auth and cache-invalidation diagrams and the frontend/blockchain boundary Closes amina69#684 Closes amina69#692 Closes amina69#693 Closes amina69#694 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@ogunrombimoyin1212-jpg is attempting to deploy a commit to the sheriffamina1-9497's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@ogunrombimoyin1212-jpg Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Owner
|
@ogunrombimoyin1212-jpg kindly fix the conflict |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: image optimisation, privacy-safe logging/analytics gating, README + architecture docs
Closes #684
Closes #692
Closes #693
Closes #694
(Part of Phase 3 — Epics M, O, P.)
Summary
Four Phase 3 backlog items, delivered together because the docs (#693, #694)
describe the logger/analytics and image components added by #692 and #684.
#684 — Image optimisation and lazy loading (
performance)New:
src/components/shared/ResponsiveImage.tsx— one wrapper that applies the image rules everywhere:loading="lazy"by default;priority→loading="eager"+fetchPriority="high"+ sync decodewidth/height→ space reserved, no layout shiftsrcSet/sizespassthrough (for API-exposed variants)onError→ fallback image (neutral inline SVG by default,fallbackSrcoverride);srcsetdropped for the fallback; state is keyed bysrcso changing a gallery image resets cleanlyAdopted in:
PetCard(also gains an opt-inpriorityprop),ListingCard,InterestPetCard, the listing gallery (ListingInfoTab) and the pet-details gallery (PetlistingdetailsPage). First gallery image is eager, the rest lazy.#692 — Privacy-safe logging and analytics gating (
security,privacy)src/lib/analytics.tsVITE_ENABLE_ANALYTICS === 'true'(exact match): no listeners, no beacons, no fetches.EVENT_ALLOW_LIST): unknown events dropped; only listed property keys kept; values must be numbers, booleans or short enum-like tokens ([A-Za-z0-9_\-/.]{1,64}), so free text, emails, phones and document names cannot be sent even under an allowed key. Query strings/hashes stripped from route values.reportErrorsends only name / scrubbed message / scrubbed stack; sent withcredentials: 'omit'.VITE_ANALYTICS_ENDPOINT; without it nothing is sent.src/lib/logger.ts—debug/infono-op in production;warn/erroralways emit but are scrubbed.src/lib/scrub.ts— shared PII scrubbing: sensitive keys (password, token, authorization, cookie, email, phone, body, payload, message, …) redacted recursively; JWTs, Bearer tokens, emails, phone numbers and?token=-style query secrets removed from strings;Errors reduced to name + scrubbed message.console.*insrc/replaced withlogger. Removed leaks: rating payload logged inadoptionService.submitRating, approval payload inuseAdoptionApprovals, adoption-completion data in the demo page, and the user's email in the MSW password-reset handler. Nothing logs request bodies, headers or cookies.initAnalytics()called frommain.tsx;.env.exampledocuments both variables.#693 — README and feature documentation
docs/features/*.md(file map, routes, mocks, hook usage snippets per feature).src/(the old tree listedcommon/,forms/,features/pets, which don't exist). A note explains where documents/profile/auth live, since they are notfeatures/folders.#694 — Architecture and data-flow documentation
docs/architecture.md, Mermaid, each diagram written against cited files:request flow (component → hook → service → ApiClient → backend), realtime flow (socket → invalidate → refetch; optimistic merge only for the user's own actions), auth/session flow, a per-mutation cache-invalidation map (diagram + table), and an explicit frontend/blockchain boundary.
§6 "Known deviations" records where the code departs from the layering (e.g. direct
fetch/axios/XHR in a few hooks; two notification socket implementations of which only the context provider is mounted; duplicatefeatures/disputeandfeatures/disputes). These are documented, not changed here.Tests
analytics.test.tsundefined,"false","TRUE","1") → zero beacons/fetches/listeners; allow-list; PII stripped under allowed and disallowed keys; error scrubbinglogger.test.tsResponsiveImage.test.tsxe2e/analytics-gating.spec.tssendBeaconacross/home,/listingsVerification
Run on a branch cut from current
upstream/main:tsc -b: clean ·eslinton all changed/new files: cleanvitest run(all directories undersrc/): 122 files, 967 tests passed/listingsshows no image layout shift and "defer offscreen images" passes; the existinglighthouserc.jsbudget covers/listings.Notes for reviewers
ResponsiveImagehides the image (opacity-0) untilonLoad; images served from cache still fireload, so nothing stays hidden.EVENT_ALLOW_LISTare an initial vocabulary; call sites are not wired yet, since the issue asks for the gate and the allow-list, not specific instrumentation.🤖 Generated with Claude Code