fix: guard DOM geometry calls with isBrowser (#DS-5266)#1695
Merged
Conversation
|
Visit the preview URL for this PR (updated for commit 67d1501): https://koobiq-next--prs-1695-39vmad79.web.app (expires Sun, 12 Jul 2026 13:57:58 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: c9e37e518febda70d0317d07e8ceb35ac43c534c |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces SSR-safe DOM rectangle utility functions in @koobiq/components/core and replaces direct getClientRects() / getBoundingClientRect() usage in several components to avoid SSR runtime failures.
Changes:
- Added new SSR-safe wrappers
kbqGetClientRectsandkbqGetBoundingClientRectto core (including unit tests) and exported them via core public APIs. - Updated tree/list option height calculations and other layout logic to use the new wrappers instead of inline SSR guards.
- Updated the public API guard snapshot to include the new exported functions.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/public_api_guard/components/core.api.md | Adds the new SSR utility functions to the public API snapshot. |
| packages/components/core/ssr/ssr.ts | Introduces SSR-safe wrappers for DOMRect access. |
| packages/components/core/ssr/ssr.spec.ts | Adds unit tests for the new SSR-safe wrappers. |
| packages/components/core/ssr/public-api.ts | Re-exports SSR utilities for package consumers. |
| packages/components/core/ssr/index.ts | Barrel export for the SSR subpackage. |
| packages/components/core/public-api.ts | Exposes the SSR utilities through the core public API. |
| packages/components/core/option/option.ts | Uses kbqGetClientRects for SSR-safe option height measurement. |
| packages/components/tree/tree-selection.component.ts | Uses kbqGetClientRects for SSR-safe height measurement. |
| packages/components/tree/tree-option.component.ts | Uses kbqGetClientRects for SSR-safe height measurement. |
| packages/components/list/list-selection.component.ts | Uses kbqGetClientRects for SSR-safe height measurement (list + option). |
| packages/components/navbar/navbar.component.ts | Uses kbqGetBoundingClientRect for SSR-safe width measurement. |
| packages/components/overflow-items/overflow-items.ts | Uses kbqGetBoundingClientRect for SSR-safe size computations. |
| packages/components/timezone/timezone-option.directive.ts | Uses kbqGetClientRects for SSR-safe tooltip row measurement. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
artembelik
reviewed
Jul 6, 2026
artembelik
reviewed
Jul 6, 2026
artembelik
approved these changes
Jul 6, 2026
lskramarov
requested changes
Jul 6, 2026
lskramarov
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.