Skip to content

fix: guard DOM geometry calls with isBrowser (#DS-5266)#1695

Merged
NikGurev merged 7 commits into
mainfrom
bugfix/DS-5266
Jul 7, 2026
Merged

fix: guard DOM geometry calls with isBrowser (#DS-5266)#1695
NikGurev merged 7 commits into
mainfrom
bugfix/DS-5266

Conversation

@NikGurev

@NikGurev NikGurev commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@NikGurev NikGurev self-assigned this Jul 3, 2026
@NikGurev NikGurev added the enhancement New feature or request label Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

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

Copilot AI 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.

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 kbqGetClientRects and kbqGetBoundingClientRect to 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.

Comment thread packages/components/core/ssr/ssr.ts Outdated
Comment thread packages/components/core/ssr/ssr.ts Outdated
Comment thread packages/components/core/ssr/ssr.ts Outdated
@NikGurev NikGurev changed the title fix: added and used SSR-safe DOM rect utilities (#DS-5266) fix: added and used SSR-safe DOM rect service (#DS-5266) Jul 6, 2026
@NikGurev
NikGurev requested a review from artembelik July 6, 2026 09:25
Comment thread packages/components/core/services/geometry.service.ts Outdated
Comment thread packages/components/core/services/geometry.service.ts Outdated
@NikGurev NikGurev changed the title fix: added and used SSR-safe DOM rect service (#DS-5266) fix: guard DOM geometry calls with Platform.isBrowser (#DS-5266) Jul 7, 2026
@NikGurev
NikGurev requested a review from lskramarov July 7, 2026 09:48
@NikGurev NikGurev changed the title fix: guard DOM geometry calls with Platform.isBrowser (#DS-5266) fix: guard DOM geometry calls with isBrowser (#DS-5266) Jul 7, 2026
Comment thread packages/components/app-switcher/app-switcher.ts
@NikGurev
NikGurev merged commit e702d55 into main Jul 7, 2026
8 checks passed
@NikGurev
NikGurev deleted the bugfix/DS-5266 branch July 7, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants