Skip to content

Conversation

@guitavano
Copy link
Contributor

@guitavano guitavano commented Dec 10, 2025

Summary by CodeRabbit

  • Refactor
    • Improved image URL handling for certain external image hosts when automatic optimization is turned off, ensuring images load correctly and respect sizing parameters.
    • Internal adjustments made to better preserve compatibility with third-party image sources without changing any public APIs.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions
Copy link
Contributor

Tagging Options

Should a new tag be published when this PR is merged?

  • 👍 for Patch 0.133.20 update
  • 🎉 for Minor 0.134.0 update
  • 🚀 for Major 1.0.0 update

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 10, 2025

Walkthrough

Adds an internal helper optimizeWake(opts) that appends w and h query parameters to the original image URL; when optimization is disabled and the source contains fbitsstatic.net/img/, getOptimizedMediaUrl returns the optimizeWake URL instead of other paths. (No public API changes.)

Changes

Cohort / File(s) Summary
Image optimization for fbitsstatic.net
website/components/Image.tsx
Added internal optimizeWake(opts) helper to build a URL with w and h query parameters. Updated getOptimizedMediaUrl to return optimizeWake(opts) when optimization is disabled and originalSrc includes fbitsstatic.net/img/. Existing optimization branches unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Single-file change with low logic density.
  • Review focus: host detection string, query-parameter encoding, and behavior when optimization is disabled.

Possibly related PRs

  • improve image #1452: Modifies getOptimizedMediaUrl in website/components/Image.tsx and introduces alternate host-specific URL construction (related code paths and host handling).

Poem

🐰 I nibble bytes and tweak a link,
I add a width, a height in sync,
For fbitsstatic's cozy nest,
Small hops make images look their best —
A cheerful hop, a tiny wink ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is missing entirely. The description template requires sections for 'What is this Contribution About', 'Issue Link', 'Loom Video', and 'Demonstration Link', but none were provided. Add a complete pull request description following the template, including a brief explanation of changes, the related issue link, and ideally a loom video and demonstration link.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'add wake optimization for images' clearly reflects the main change, which is adding a new optimization helper for images hosted on a specific domain.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch tavano/add-wake-optimization

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e7f1c9d and be464e0.

📒 Files selected for processing (1)
  • website/components/Image.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • website/components/Image.tsx

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
website/components/Image.tsx (1)

107-115: LGTM! Minor naming inconsistency noted.

The implementation correctly follows the same pattern as other platform-specific optimizers. The use of w and h query parameters appears appropriate for the Wake platform.

Minor note: This function uses optimizeWake (with 'i') while existing functions use optmize without 'i' (optmizeVNDA, optmizeShopify). Consider standardizing the naming for consistency, though this is purely cosmetic.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2b0d583 and e7f1c9d.

📒 Files selected for processing (1)
  • website/components/Image.tsx (2 hunks)
🧰 Additional context used
🪛 GitHub Actions: ci
website/components/Image.tsx

[error] 128-128: Deno fmt --check failed. Found 1 not formatted file (website/components/Image.tsx) at line 128. Apply formatting to fix the issue.

@guitavano guitavano merged commit 46f346d into main Dec 10, 2025
3 checks passed
@guitavano guitavano deleted the tavano/add-wake-optimization branch December 10, 2025 19:41
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.

3 participants