Skip to content

fix: Prevent getWorldPosition error in promo shader#2857

Open
HarshMN2345 wants to merge 1 commit intomainfrom
fix-threlte-viewport-crash
Open

fix: Prevent getWorldPosition error in promo shader#2857
HarshMN2345 wants to merge 1 commit intomainfrom
fix-threlte-viewport-crash

Conversation

@HarshMN2345
Copy link
Member

@HarshMN2345 HarshMN2345 commented Feb 15, 2026

What does this PR do?

before:
image
after:
image

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

Summary by CodeRabbit

  • Refactor
    • Updated shader component's internal sizing mechanism for improved framework compatibility.

@appwrite
Copy link

appwrite bot commented Feb 15, 2026

Console (appwrite/console)

Project ID: 688b7bf400350cbd60e9

Sites (1)
Site Status Logs Preview QR
 console-stage
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code

Tip

Git integration provides automatic deployments with optional PR comments

@HarshMN2345 HarshMN2345 requested a review from Meldiron February 15, 2026 20:21
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 15, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

This pull request refactors src/lib/components/promos/shader.svelte to replace the viewport object with a size object sourced from useThrelte(). All references to viewport dimensions ($viewport.width and $viewport.height) are updated to use the corresponding size properties ($size.width and $size.height) with default fallbacks of 1. Shader initialization, aspect ratio calculation, viewport size assignment, and mesh scaling are adjusted to use the new size data source.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'fix: Prevent getWorldPosition error in promo shader' directly addresses the main issue described in the PR objectives - a runtime error about getWorldPosition being undefined in the promo shader component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-threlte-viewport-crash

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.

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