Skip to content

fix(resources): pass Images caption, attribution, and licenseInfo - #435

Merged
mattrace-gloo merged 4 commits into
mainfrom
mrace/fix/273-image-metadata
Oct 21, 2026
Merged

mattrace-gloo merged 4 commits into
mainfrom
mrace/fix/273-image-metadata

Conversation

@mattrace-gloo

@mattrace-gloo mattrace-gloo commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Narrow follow-up to #273 / historical #274: Images & Maps items now optionally carry caption, attribution, and licenseInfo when Aquifer provides them (same grouping.licenseInfo path TN/TQ already use). thumbnailUrl / full url behavior unchanged. Mobile #594 already maps these fields. Does not close broad #273 (other criteria remain).

Details

Refs #273
Related: fluent-mobile#594

Overlap with open PRs

PR Relation
#433 Same service file (manifest fail-on-hydrate). No intentional interaction; rebase if both land.
#411 Aquifer Bible empty-passage — different domain.
#424 Broad service split — no image-metadata implementation.

Technical changes

  • src/domains/translation-resources/translation-resources.types.ts — optional caption, attribution, licenseInfo on TranslationImageItem
  • src/domains/translation-resources/translation-resources.service.ts — asset own-record pass-through + grouping.licenseInfo on image items
  • src/domains/translation-resources/translation-resources.license.test.ts — mock-labeled populated + absent metadata tests (not live payload proof)

Testing

  • Fail-before: focused mock test expecting caption/attribution/licenseInfo → 1 failed
  • Pass-after: domain translation-resources + aquifer client → 45 passed (domain) / related aquifer suite 60 passed earlier
  • npm run lint, format:check, typecheck, full npm test → 1358 passed, 9 skipped
  • knip@5.88.1 FA-C1 check → 0 added / 0 stale (stock npm run deadcode via bare npx knip pulled knip 6 and broke report shape in this worktree; pinned 5.88.1 matches package.json)
  • ./scripts/check-docs-structure.sh + npm run build → pass
  • Not run: test:db / test:live (no isolated DB / no Aquifer credentials per task)

How to verify

  1. OpenAPI → Translation Resources → Images item schema lists optional caption, attribution, licenseInfo, thumbnailUrl.
  2. Unit: npm test -- --run src/domains/translation-resources — expect pass including license/images metadata cases.
  3. After deploy (out of scope here): authenticated Images GET; confirm licenseInfo when Aquifer grouping has it; confirm caption/attribution only if Aquifer content includes those keys — do not assume content id 2788.

Follow-ups

Made with Cursor

Summary by CodeRabbit

  • New Features
    • Image translation resources now include available captions, attributions, and licensing information.
    • Image metadata such as thumbnails and dimensions continues to be preserved.
    • Optional metadata is omitted when unavailable, providing cleaner responses.

Images & Maps items omitted optional Aquifer metadata that mobile #594
already maps. Pass through content caption/attribution when present and
grouping.licenseInfo like TN/TQ; never fabricate missing fields.
@mattrace-gloo mattrace-gloo self-assigned this Oct 21, 2026
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 22 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 59baecfe-596a-45ae-9e5e-371663192e23
📥 Commits

Reviewing files that changed from the base of the PR and between 41c8459 and 9bdb70a.

📒 Files selected for processing: 3
  • src/domains/translation-resources/translation-resources.license.test.ts
  • src/domains/translation-resources/translation-resources.service.ts
  • src/domains/translation-resources/translation-resources.types.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 58ad6977-75c7-4836-94ec-07ca250d1d31
📥 Commits

Reviewing files that changed from the base of the PR and between c8d4cb6 and 41c8459.

📒 Files selected for processing: 3
  • src/domains/translation-resources/translation-resources.license.test.ts
  • src/domains/translation-resources/translation-resources.service.ts
  • src/domains/translation-resources/translation-resources.types.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

Image translation-resource responses now include available caption, attribution, and Aquifer license information. The response schema marks these fields as optional. Tests cover metadata preservation and omission when source fields are absent.

Changes: Image resource metadata

Layer / File(s) Summary
Image response contract
src/domains/translation-resources/translation-resources.types.ts
The image response schema adds optional caption, attribution, and Aquifer licenseInfo fields. It retains optional thumbnailUrl and nonnegative size.
Aquifer metadata extraction and response tests
src/domains/translation-resources/translation-resources.service.ts, src/domains/translation-resources/translation-resources.license.test.ts
The service extracts caption and attribution from each asset record and adds available metadata to image manifest items. Tests cover present and absent metadata. Service comments also clarify concurrency, manifest limits, chapter bounds, and catalog scope.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: jedward7777

Merge Risk: ⚪ Minimal · up to 41c84

The optional image metadata change has no identified merge-blocking issue; normal checks remain appropriate.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: propagating image caption, attribution, and licenseInfo metadata.
Linked Issues check Passed For the scoped Images & Maps work in [#273], the change adds optional caption, attribution, and typed licenseInfo fields to TranslationImageItem. The image builder reads caption and `attribu…
Out of Scope Changes check Passed The diff changes only the image metadata schema, the image asset mapping, related comments, and focused tests. The tests verify the requested [#273] behavior. The diff does not add manifest behavior, …
Full details: Linked Issues check

Explanation

For the scoped Images & Maps work in [#273], the change adds optional caption, attribution, and typed licenseInfo fields to TranslationImageItem. The image builder reads caption and attribution from the asset record and reads licenseInfo from details.grouping. It omits absent fields and preserves URL, thumbnail, and size behavior. OpenAPI schemas and focused tests cover populated and absent metadata. The remaining #273 work is broader than this follow-up and is not required for this scoped assessment.

Full details: Out of Scope Changes check

Explanation

The diff changes only the image metadata schema, the image asset mapping, related comments, and focused tests. The tests verify the requested [#273] behavior. The diff does not add manifest behavior, passage semantics, service modularization, concurrency policy changes, or mobile implementation.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kaseywright kaseywright left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, well-scoped slice. licenseInfo on image items is justified — same grouping.licenseInfo wire TN/TQ/manifest already carry, and mobile's mapper (imagesMaps.ts) prefers explicit attribution then falls back to formatImageLicenseAttribution(licenseInfo), so this feeds both paths. Fixtures are schema-validated, ok/absent paths covered, conditional-spread idiom matches the file. Two nits inline plus one noted risk.

Non-blocking risk (already half-acknowledged in the PR body): caption/attribution are read own-record only — from whichever record wins extractAquiferAsset's first-url DFS (readAssetFromRecord, service.ts:124–156). If production Aquifer puts caption on a parent or sibling record rather than beside url, it's dropped silently and this ships vacuous. Since no live call verified the shape, suggest recording a real image payload (e.g. content id 2788) as a fixture, or a post-deploy check, before mobile #594's API AC is checked off.

Verified independently: lint/typecheck clean, focused license tests 11/11 pass, OpenAPI picks up the fields via the route's response schema, and the "mobile already maps these fields" claim holds — ApiTranslationImageItem already declares all three.

Review drafted with Devin; verified against a local worktree of the PR head.

Comment thread src/domains/translation-resources/translation-resources.types.ts Outdated
Comment thread src/domains/translation-resources/translation-resources.service.ts Outdated
Comment thread src/domains/translation-resources/translation-resources.license.test.ts Outdated
Align thumbnailUrl OpenAPI with emit behavior, restore the mobile
prepareOfflineResourceManifest pointer, and reuse imageSearchHit in
license tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mattrace-gloo
mattrace-gloo merged commit 4bccdc1 into main Oct 21, 2026
6 checks passed
@github-actions
github-actions Bot deleted the mrace/fix/273-image-metadata branch October 21, 2026 22:36
mattrace-gloo added a commit that referenced this pull request Oct 22, 2026
Resolve conflicts with #432 fail-closed manifest hydrate and #435 image
metadata. Address #437 review: soften truncated OpenAPI copy, warn on
incomplete Aquifer searches (manifest + range), and drop the local
MAX_SEARCH_PAGES alias / redundant empty-page check.
mattrace-gloo added a commit that referenced this pull request Oct 22, 2026
* fix(resources): complete offline manifests beyond 100 search hits

Stop re-slicing bounded Aquifer search results at 100 and report truncated
only when provider pagination metadata cannot prove enumeration finished.

* Merge origin/main into mrace/fix/431-complete-resource-manifest-clean

Resolve conflicts with #432 fail-closed manifest hydrate and #435 image
metadata. Address #437 review: soften truncated OpenAPI copy, warn on
incomplete Aquifer searches (manifest + range), and drop the local
MAX_SEARCH_PAGES alias / redundant empty-page check.

* test(resources): assert images-range warn on incomplete Aquifer search

Mirror the notes-range coverage for the images verse-range page-ceiling warn.
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.

Expose Aquifer-backed Translation Resources API for mobile (TN / TQ / Images & Maps)

2 participants