Skip to content

fix: make tooltips to not appear off screen#269

Draft
timothygachengo wants to merge 5 commits into
mainfrom
fix/make-tooltips-centered
Draft

fix: make tooltips to not appear off screen#269
timothygachengo wants to merge 5 commits into
mainfrom
fix/make-tooltips-centered

Conversation

@timothygachengo

Copy link
Copy Markdown
Contributor

Description

Type of change

  • Bug fix (fix:)
  • New feature (feat:)
  • Breaking change (BREAKING CHANGE:)
  • Refactor / chore (refactor: / chore:)
  • Documentation update (docs:)

Affected package(s)

  • @devgateway/dvz-ui-react
  • @devgateway/wp-react-lib
  • example only (no changeset needed)

Checklist

  • PR title follows Conventional Commits format
  • A changeset has been added (pnpm changeset) for any change to a published package
  • pnpm build passes locally
  • pnpm --filter @devgateway/* typecheck passes
  • No hardcoded credentials, internal URLs, client names, or PII introduced
  • Any new dependency has an Apache-2.0-compatible license

@pkg-pr-new

pkg-pr-new Bot commented Jul 20, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@devgateway/dvz-ui-react@a4cd716
pnpm add https://pkg.pr.new/@devgateway/wp-react-lib@a4cd716

commit: a4cd716

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 aims to prevent chart tooltips from rendering off-screen by clamping tooltip positioning to the viewport, covering both React-rendered tooltips and a manual d3 tooltip path.

Changes:

  • Added viewport-clamping logic for the main embeddable chart tooltip component via a new clamp helper + hook.
  • Updated ChartTooltip.jsx to use the same clamping hook for charts that use that tooltip component.
  • Updated the d3 tooltip positioning in LineLayer.jsx to clamp top/left within the viewport bounds.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/dvz-ui/src/embeddable/chart/Tooltip.jsx Introduces clampTooltipToViewport + useClampTooltipToViewport and applies the ref to tooltip markup.
packages/dvz-ui/src/embeddable/common/ChartTooltip.jsx Uses the shared clamping hook to keep these tooltips within viewport.
packages/dvz-ui/src/embeddable/chart/LineLayer.jsx Clamps the manually-positioned d3 tooltip within the viewport.
packages/dvz-ui/package.json Adds react-tooltip dependency (currently appears unused).
pnpm-lock.yaml Lockfile updates for the new dependency/version graph.
.changeset/open-rocks-move.md Declares a patch release describing the tooltip clamping behavior change.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread packages/dvz-ui/src/embeddable/chart/Tooltip.jsx
Comment thread packages/dvz-ui/src/embeddable/chart/Tooltip.jsx Outdated
Comment thread packages/dvz-ui/package.json
Comment thread packages/dvz-ui/src/embeddable/chart/LineLayer.jsx
@pkg-pr-new

pkg-pr-new Bot commented Jul 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@devgateway/dvz-ui-react@0a706ff
pnpm add https://pkg.pr.new/@devgateway/wp-react-lib@0a706ff

commit: 0a706ff

@pkg-pr-new

pkg-pr-new Bot commented Jul 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@devgateway/dvz-ui-react@939be3d
pnpm add https://pkg.pr.new/@devgateway/wp-react-lib@939be3d

commit: 939be3d

@pkg-pr-new

pkg-pr-new Bot commented Jul 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@devgateway/dvz-ui-react@939be3d
pnpm add https://pkg.pr.new/@devgateway/wp-react-lib@939be3d

commit: 939be3d

@timothygachengo
timothygachengo marked this pull request as draft July 21, 2026 13:15
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.

3 participants