Skip to content

feat(dropdown): added safe triangle for submenu (#DS-2446) - #1906

Open
NikGurev wants to merge 6 commits into
mainfrom
feat/DS-2446
Open

feat(dropdown): added safe triangle for submenu (#DS-2446)#1906
NikGurev wants to merge 6 commits into
mainfrom
feat/DS-2446

Conversation

@NikGurev

Copy link
Copy Markdown
Contributor

No description provided.

@NikGurev NikGurev self-assigned this Aug 17, 2026
@github-actions github-actions Bot added the enhancement New feature or request label Aug 17, 2026
@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit b216363):

https://koobiq-next--prs-1906-7dle83mi.web.app

(expires Mon, 24 Aug 2026 16:36:21 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c9e37e518febda70d0317d07e8ceb35ac43c534c

@NikGurev
NikGurev marked this pull request as ready for review August 17, 2026 15:59
@lskramarov

Copy link
Copy Markdown
Contributor

@NikGurev странное поведение, по ховеру пункты открываются через одного:

Recording 2026-08-18 093023

@lskramarov
lskramarov requested a review from rmnturov August 18, 2026 08:34

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

Adds a “safe triangle” interaction to the dropdown’s nested submenus to prevent accidental submenu closure while the pointer moves diagonally from a trigger item into its submenu, by tracking pointer movement within a computed triangle region.

Changes:

  • Introduced safe-triangle geometry utilities in @koobiq/components/core and exported them from the core public API.
  • Added a new safeTriangle dropdown option/input and integrated pointer-tracking + cleanup in KbqDropdown / KbqDropdownTrigger.
  • Added docs, a docs-example, a dev-example, and Jest coverage for the safe-triangle behavior.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tools/public_api_guard/components/dropdown.api.md Public API snapshot updates for new dropdown methods/input and default option.
tools/public_api_guard/components/core.api.md Public API snapshot updates for new safe-triangle utility exports/types.
packages/docs-examples/components/dropdown/index.ts Registers the new safe-triangle docs example.
packages/docs-examples/components/dropdown/dropdown-safe-triangle/dropdown-safe-triangle-example.ts New example demonstrating safeTriangle behavior and toggling.
packages/components/dropdown/dropdown.types.ts Adds safeTriangle to default options + defaults it on in the factory.
packages/components/dropdown/dropdown.spec.ts Adds interaction tests for safe triangle and default override coverage.
packages/components/dropdown/dropdown.ru.md Documents safe-area behavior (RU).
packages/components/dropdown/dropdown.en.md Documents safe-area behavior (EN).
packages/components/dropdown/dropdown.component.ts Adds safeTriangle input + safe-triangle tracking lifecycle (activate/deactivate).
packages/components/dropdown/dropdown-trigger.directive.ts Arms safe-triangle tracking on trigger mouseleave and adjusts hover-close logic accordingly.
packages/components/core/public-api.ts Exports the new overlay/safe-triangle module.
packages/components/core/overlay/safe-triangle.ts New safe-triangle geometry helpers (point-in-rect/triangle + triangle construction).
packages/components/core/overlay/safe-triangle.spec.ts Unit tests for the new geometry helpers.
packages/components-dev/dropdown/module.ts Adds the safe-triangle example to the dev dropdown page.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/components/dropdown/dropdown.component.ts Outdated
Comment thread packages/components/dropdown/dropdown.ru.md Outdated
* pointer moves from a trigger toward its open submenu, sibling items it crosses over on the way
* don't prematurely close the submenu.
*/
readonly safeTriangle = input(this.defaultOptions.safeTriangle ?? false, { transform: booleanAttribute });

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.

@rmnturov по умолчанию это поведение должно быть включено?

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