Skip to content

Feat/116 page metadata - #56

Merged
hendrikebbers merged 6 commits into
mainfrom
feat/116-page-metadata
Aug 27, 2026
Merged

Feat/116 page metadata#56
hendrikebbers merged 6 commits into
mainfrom
feat/116-page-metadata

Conversation

@hendrikebbers

@hendrikebbers hendrikebbers commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

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:

Metadata and SEO improvements:

Performance and reliability enhancements:

  • Introduced getCachedContact and getCachedCompany wrappers using React's cache to deduplicate backend fetches within a single request, reducing redundant API calls during server-side rendering. ([frontend/src/lib/cached-entities.tsR1-R19])
  • Added utility functions for fetching contact photos and company logos as data URIs for server-side image embedding, with graceful fallback on errors. ([frontend/src/lib/api.tsR194-R228])

Testing and documentation:

hendrikebbers and others added 6 commits August 27, 2026 20:36
… 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>
@hendrikebbers
hendrikebbers merged commit d777b92 into main Aug 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant