Skip to content

PLASMA-7853: add staticOffset for arrow with alignment - #2996

Open
TitanKuzmich wants to merge 1 commit into
devfrom
PLASMA-7852
Open

PLASMA-7853: add staticOffset for arrow with alignment#2996
TitanKuzmich wants to merge 1 commit into
devfrom
PLASMA-7852

Conversation

@TitanKuzmich

@TitanKuzmich TitanKuzmich commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Core

Popover, Tooltip (beta)

  • добавлен отступ от края всплывающего окна при позиционировании с alignment

What/why changed

В FloatingArrow (node_modules/@floating-ui/react/dist/floating-ui.react.mjs:486) есть строка

let xOffsetProp = computedStaticOffset && alignment === 'end' ? 'right' : 'left';

computedStaticOffset берётся из пропа staticOffset, который ни Tooltip.tsx, ни Popover.tsx не передавали - поэтому условия для right/bottom не выполнялись, и хвостик всегда позиционировался от left/top, независимо от alignment

Before:
image

After:
image

📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @salutejs/plasma-asdk@0.385.0-canary.2996.30350408067.0
npm install @salutejs/plasma-b2c@1.627.0-canary.2996.30350408067.0
npm install @salutejs/plasma-core@1.234.0-canary.2996.30350408067.0
npm install @salutejs/plasma-giga@0.354.0-canary.2996.30350408067.0
npm install @salutejs/plasma-homeds@0.354.0-canary.2996.30350408067.0
npm install @salutejs/plasma-hope@1.381.0-canary.2996.30350408067.0
npm install @salutejs/plasma-icons@1.244.0-canary.2996.30350408067.0
npm install @salutejs/plasma-new-hope@0.371.0-canary.2996.30350408067.0
npm install @salutejs/plasma-tokens@1.146.0-canary.2996.30350408067.0
npm install @salutejs/plasma-tokens-b2b@1.60.0-canary.2996.30350408067.0
npm install @salutejs/plasma-tokens-b2c@0.71.0-canary.2996.30350408067.0
npm install @salutejs/plasma-tokens-web@1.75.0-canary.2996.30350408067.0
npm install @salutejs/plasma-typo@0.48.0-canary.2996.30350408067.0
npm install @salutejs/plasma-web@1.629.0-canary.2996.30350408067.0
npm install @salutejs/sdds-bizcom@0.359.0-canary.2996.30350408067.0
npm install @salutejs/sdds-cs@0.363.0-canary.2996.30350408067.0
npm install @salutejs/sdds-dfa@0.357.0-canary.2996.30350408067.0
npm install @salutejs/sdds-finai@0.350.0-canary.2996.30350408067.0
npm install @salutejs/sdds-insol@0.354.0-canary.2996.30350408067.0
npm install @salutejs/sdds-netology@0.358.0-canary.2996.30350408067.0
npm install @salutejs/sdds-os@0.29.0-canary.2996.30350408067.0
npm install @salutejs/sdds-platform-ai@0.358.0-canary.2996.30350408067.0
npm install @salutejs/sdds-sbcom@0.359.0-canary.2996.30350408067.0
npm install @salutejs/sdds-scan@0.357.0-canary.2996.30350408067.0
npm install @salutejs/sdds-serv@0.358.0-canary.2996.30350408067.0
npm install @salutejs/core-themes@0.36.0-canary.2996.30350408067.0
npm install @salutejs/plasma-themes@0.58.0-canary.2996.30350408067.0
npm install @salutejs/sdds-themes@0.72.0-canary.2996.30350408067.0
npm install @salutejs/sdds-api-tests@0.16.0-canary.2996.30350408067.0
npm install @salutejs/plasma-cy-utils@0.164.0-canary.2996.30350408067.0
npm install @salutejs/plasma-sb-utils@0.235.0-canary.2996.30350408067.0
npm install @salutejs/plasma-tokens-utils@0.56.0-canary.2996.30350408067.0
# or 
yarn add @salutejs/plasma-asdk@0.385.0-canary.2996.30350408067.0
yarn add @salutejs/plasma-b2c@1.627.0-canary.2996.30350408067.0
yarn add @salutejs/plasma-core@1.234.0-canary.2996.30350408067.0
yarn add @salutejs/plasma-giga@0.354.0-canary.2996.30350408067.0
yarn add @salutejs/plasma-homeds@0.354.0-canary.2996.30350408067.0
yarn add @salutejs/plasma-hope@1.381.0-canary.2996.30350408067.0
yarn add @salutejs/plasma-icons@1.244.0-canary.2996.30350408067.0
yarn add @salutejs/plasma-new-hope@0.371.0-canary.2996.30350408067.0
yarn add @salutejs/plasma-tokens@1.146.0-canary.2996.30350408067.0
yarn add @salutejs/plasma-tokens-b2b@1.60.0-canary.2996.30350408067.0
yarn add @salutejs/plasma-tokens-b2c@0.71.0-canary.2996.30350408067.0
yarn add @salutejs/plasma-tokens-web@1.75.0-canary.2996.30350408067.0
yarn add @salutejs/plasma-typo@0.48.0-canary.2996.30350408067.0
yarn add @salutejs/plasma-web@1.629.0-canary.2996.30350408067.0
yarn add @salutejs/sdds-bizcom@0.359.0-canary.2996.30350408067.0
yarn add @salutejs/sdds-cs@0.363.0-canary.2996.30350408067.0
yarn add @salutejs/sdds-dfa@0.357.0-canary.2996.30350408067.0
yarn add @salutejs/sdds-finai@0.350.0-canary.2996.30350408067.0
yarn add @salutejs/sdds-insol@0.354.0-canary.2996.30350408067.0
yarn add @salutejs/sdds-netology@0.358.0-canary.2996.30350408067.0
yarn add @salutejs/sdds-os@0.29.0-canary.2996.30350408067.0
yarn add @salutejs/sdds-platform-ai@0.358.0-canary.2996.30350408067.0
yarn add @salutejs/sdds-sbcom@0.359.0-canary.2996.30350408067.0
yarn add @salutejs/sdds-scan@0.357.0-canary.2996.30350408067.0
yarn add @salutejs/sdds-serv@0.358.0-canary.2996.30350408067.0
yarn add @salutejs/core-themes@0.36.0-canary.2996.30350408067.0
yarn add @salutejs/plasma-themes@0.58.0-canary.2996.30350408067.0
yarn add @salutejs/sdds-themes@0.72.0-canary.2996.30350408067.0
yarn add @salutejs/sdds-api-tests@0.16.0-canary.2996.30350408067.0
yarn add @salutejs/plasma-cy-utils@0.164.0-canary.2996.30350408067.0
yarn add @salutejs/plasma-sb-utils@0.235.0-canary.2996.30350408067.0
yarn add @salutejs/plasma-tokens-utils@0.56.0-canary.2996.30350408067.0

Summary by CodeRabbit

  • Bug Fixes
    • Improved popover and tooltip arrow positioning across different placement options.
    • Ensured arrow spacing is applied only when an alignment is available.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 87bcd9f3-ea34-4a71-9a77-41e43c7790ec

📥 Commits

Reviewing files that changed from the base of the PR and between 5e6dacb and d9c0116.

📒 Files selected for processing (2)
  • packages/plasma-new-hope/src/components/_beta/Popover/Popover.tsx
  • packages/plasma-new-hope/src/components/_beta/Tooltip/Tooltip.tsx

📝 Walkthrough

Walkthrough

Popover and Tooltip now derive alignment from placement and conditionally apply ARROW_PADDING as the FloatingArrow static offset.

Changes

Placement-aware arrow offsets

Layer / File(s) Summary
Conditional arrow offset handling
packages/plasma-new-hope/src/components/_beta/Popover/Popover.tsx, packages/plasma-new-hope/src/components/_beta/Tooltip/Tooltip.tsx
Popover and Tooltip split placement to derive alignment, then set FloatingArrow’s staticOffset to ARROW_PADDING only when alignment is present.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: angirb, shuga2704, yakutoc

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding staticOffset for aligned arrows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch PLASMA-7852

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


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.

@github-actions

Copy link
Copy Markdown
Contributor

Theme Builder app deployed!

https://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-2996/

@github-actions

Copy link
Copy Markdown
Contributor

@TitanKuzmich
TitanKuzmich marked this pull request as ready for review July 28, 2026 11:23
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