Skip to content

fix: inline connector dot alignment for tooltip-above-target#47

Merged
aldefy merged 2 commits into
mainfrom
fix/inline-connector-dot-tooltip-above
Mar 16, 2026
Merged

fix: inline connector dot alignment for tooltip-above-target#47
aldefy merged 2 commits into
mainfrom
fix/inline-connector-dot-tooltip-above

Conversation

@aldefy

@aldefy aldefy commented Mar 16, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes inline connector dot misalignment when titleInlineWithConnector is enabled and the tooltip renders above the target. Previously, inline mode only activated for tooltip-below; now it supports both directions.

Before / After

Scenario Before After
Tooltip below target Dot renders at top of tooltip, inline with title. Connector draws from cutout → dot No change — same behavior
Tooltip above target Inline mode disabled. Dot drawn on canvas at targetCenter.x, misaligned with title Inline mode active. Composed dot renders at bottom of tooltip Column, aligned with content start. Connector draws from cutout → measured dot position

Key behavioral differences (tooltip-above):

Before:

  • isInlineTitleActive was false — fell back to canvas-drawn dot
  • Canvas dot at targetCenter.x didn't match title text position
  • Connector ended at a generic point below the tooltip

After:

  • isInlineTitleActive is true for all vertical connectors
  • Composed dot at bottom of tooltip, aligned with content left edge (connectorDotOffsetX = 0.dp)
  • Connector line draws from cutout edge directly to the measured dot center

Changes

Internal

  • CoachmarkTooltip.kt: Added isTooltipBelow parameter. When below → existing top Row (dot + title). When above → title renders normally, bottom Row with dot added after footer
  • CoachmarkScrim.kt: Removed && isTooltipBelow gate from isInlineTitleActive. Extracted isTooltipBelow to outer scope. Passed through TooltipContainerCoachmarkTooltip. Set connectorDotOffsetX = 0.dp for above case

Breaking Changes

None

Platform Support

  • Android
  • iOS
  • Desktop (JVM)
  • Web (Wasm)

Testing

  • ./gradlew :lumen:compileKotlinJvm (commonMain)
  • ./gradlew :sample:assembleDebug (sample app)
  • Manual testing on device/emulator — set titleInlineWithConnector = true on a target where tooltip appears above, verify dot at bottom aligns with connector

Release Notes

Features

  • Inline connector dot now aligns correctly when tooltip appears above the target

aldefy added 2 commits March 16, 2026 17:18
When titleInlineWithConnector is enabled and the tooltip appears above
the target, the connector dot now renders at the bottom of the tooltip
Column, aligning with the content start. The connector line draws from
the cutout edge to this measured dot position.
The connector dot offset should match the target center for both
tooltip-above and tooltip-below cases, avoiding a diagonal connector
line to the far-left edge.
@aldefy aldefy merged commit 10f5c11 into main Mar 16, 2026
4 of 5 checks passed
@aldefy aldefy deleted the fix/inline-connector-dot-tooltip-above branch March 16, 2026 12: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