Feat/116 page metadata - #56
Merged
Merged
Conversation
… robots - src/lib/metadata: site (SITE_NAME/title template), text (normalizeDescription with control-char stripping, whitespace collapse, 160-char word-boundary truncation), entity (display names, initials, secondary lines, build*Metadata, *ImageModel) - Root layout: title template 'Open CRM: %s', metadataBase from AUTH_URL, robots noindex - Unit tests for text and entity helpers Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…URI fetchers - getCachedContact/getCachedCompany wrap the api fetchers in React.cache so generateMetadata and the page share one backend request per render pass. Kept in a separate server-only module because getContact is also called client-side. - api.ts: getContactPhotoDataUri/getCompanyLogoDataUri fetch photo/logo bytes with the session token and return a data: URI (or null on failure/non-image) for next/og. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…pany routes - Both detail pages export generateMetadata (never throws; failed fetch -> root metadata) and switch to the cached entity wrappers - opengraph-image.tsx on both routes renders a shared 1200x630 OgImageFrame (next/og): brand frame, centre-cropped photo/logo, initials fallback, name + secondary line, wordmark - Route tests for generateMetadata (success + fetch-failure) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ether) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
This pull request implements per-page HTML metadata and Open Graph (OG) preview images for contact and company detail pages, ensuring consistent branding and efficient server-side rendering. It introduces new server-side image generation routes, robust metadata generation, and request-scoped entity caching to optimize backend calls. Additionally, it updates documentation and marks the relevant specification as complete.
Open Graph image generation and branding:
opengraph-image.tsx) for contacts and companies, generating consistent 1200×630 preview images using a sharedOgImageFramecomponent and embedding images or initials as needed. ([frontend/src/app/(app)/contacts/[id]/opengraph-image.tsxR1-R25], [frontend/src/app/(app)/companies/[id]/opengraph-image.tsxR1-R25], [frontend/src/components/og/og-image-frame.tsxR1-R91])Metadata and SEO improvements:
generateMetadatafunctions for contact and company pages, building titles and descriptions from entity data and ensuring empty metadata (not errors) on fetch failures. ([frontend/src/app/(app)/contacts/[id]/page.tsxR1-R25], [frontend/src/app/(app)/companies/[id]/page.tsxR1-R25])Performance and reliability enhancements:
getCachedContactandgetCachedCompanywrappers using React'scacheto deduplicate backend fetches within a single request, reducing redundant API calls during server-side rendering. ([frontend/src/lib/cached-entities.tsR1-R19])Testing and documentation: