Use post metadata in link previews #267

Merged
erik merged 3 commits from feat/task-026a9b5f-link-preview-metadata into main 2026-07-23 23:06:45 -05:00
Owner

Summary

Render link preview titles, descriptions, and site names from existing post and source metadata while omitting unavailable optional fields. Expand assigned source records in post API responses so the API contract matches the template data model.

Task

Task: #task-026a9b5f

Changes

  • Render post.title, post.excerpt, and post.source.name in link previews.
  • Preserve destination links and omit empty optional metadata.
  • Expand assigned sources in create, list, and detail post responses.
  • Update the post types and OpenAPI schemas to represent expanded nullable sources.
  • Cover complete and partially missing preview metadata plus API source expansion.

Testing

  • Unit tests added/updated
  • Manual API verification performed
  • Visual tests pass

Checklist

  • ./scripts/pre-pr.sh passes
  • Documentation updated (OpenAPI schema)
  • No unrelated changes included
## Summary Render link preview titles, descriptions, and site names from existing post and source metadata while omitting unavailable optional fields. Expand assigned source records in post API responses so the API contract matches the template data model. ## Task Task: #task-026a9b5f ## Changes - Render `post.title`, `post.excerpt`, and `post.source.name` in link previews. - Preserve destination links and omit empty optional metadata. - Expand assigned sources in create, list, and detail post responses. - Update the post types and OpenAPI schemas to represent expanded nullable sources. - Cover complete and partially missing preview metadata plus API source expansion. ## Testing - [x] Unit tests added/updated - [x] Manual API verification performed - [x] Visual tests pass ## Checklist - [x] `./scripts/pre-pr.sh` passes - [x] Documentation updated (OpenAPI schema) - [x] No unrelated changes included
feat: use post metadata in link previews
Some checks failed
CI / build-lint-test (pull_request) Failing after 2m19s
7cf78fa990
Task: #task-026a9b5f
test: align link preview visual fixture
All checks were successful
CI / build-lint-test (pull_request) Successful in 2m7s
98298970eb
Task: #task-026a9b5f
Author
Owner

Review summary

The link preview implementation is scoped to link posts, uses the requested post and source metadata, preserves destination navigation, and cleanly omits unavailable optional fields. Route and visual tests cover complete and partial metadata. Local pre-PR checks and Forgejo CI pass.

Acceptance criteria

  • Met: Link previews display post.title as their title.
  • Met: Link previews display post.excerpt as their description.
  • Met: Link previews display post.source.name when a source is assigned.
  • Met: Link previews continue to navigate to the destination URL.
  • Met: Missing optional metadata does not produce empty or broken UI.
  • Met: Template route and visual tests cover link-preview behavior.

Blocking issues

  • None.

Warnings

  • None.

Verdict

Approved.

### Review summary The link preview implementation is scoped to link posts, uses the requested post and source metadata, preserves destination navigation, and cleanly omits unavailable optional fields. Route and visual tests cover complete and partial metadata. Local pre-PR checks and Forgejo CI pass. ### Acceptance criteria - **Met:** Link previews display `post.title` as their title. - **Met:** Link previews display `post.excerpt` as their description. - **Met:** Link previews display `post.source.name` when a source is assigned. - **Met:** Link previews continue to navigate to the destination URL. - **Met:** Missing optional metadata does not produce empty or broken UI. - **Met:** Template route and visual tests cover link-preview behavior. ### Blocking issues - None. ### Warnings - None. ### Verdict **Approved.**
fix: expand sources in post responses
All checks were successful
CI / build-lint-test (pull_request) Successful in 2m2s
5b057f325b
Task: #task-026a9b5f
Author
Owner

Review summary

The updated PR now resolves the post/source contract mismatch in addition to rendering the requested preview metadata. Assigned sources are expanded consistently in post create, list, and detail responses; the OpenAPI schema and TypeScript model match that behavior. Preview rendering remains scoped to link posts and handles missing metadata cleanly. Local pre-PR checks, visual tests, manual API verification, and Forgejo CI pass.

Acceptance criteria

  • Met: Link previews display post.title as their title.
  • Met: Link previews display post.excerpt as their description.
  • Met: Link previews display the expanded post.source.name when a source is assigned.
  • Met: Link previews continue to navigate to the destination URL.
  • Met: Missing optional metadata does not produce empty or broken UI.
  • Met: Route, API, and visual tests cover complete and partial link-preview metadata.

Blocking issues

  • None.

Warnings

  • None.

Verdict

Approved.

### Review summary The updated PR now resolves the post/source contract mismatch in addition to rendering the requested preview metadata. Assigned sources are expanded consistently in post create, list, and detail responses; the OpenAPI schema and TypeScript model match that behavior. Preview rendering remains scoped to link posts and handles missing metadata cleanly. Local pre-PR checks, visual tests, manual API verification, and Forgejo CI pass. ### Acceptance criteria - **Met:** Link previews display `post.title` as their title. - **Met:** Link previews display `post.excerpt` as their description. - **Met:** Link previews display the expanded `post.source.name` when a source is assigned. - **Met:** Link previews continue to navigate to the destination URL. - **Met:** Missing optional metadata does not produce empty or broken UI. - **Met:** Route, API, and visual tests cover complete and partial link-preview metadata. ### Blocking issues - None. ### Warnings - None. ### Verdict **Approved.**
erik merged commit 067dac8465 into main 2026-07-23 23:06:45 -05:00
erik deleted branch feat/task-026a9b5f-link-preview-metadata 2026-07-23 23:06:45 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
erik/slugkit!267
No description provided.