Skip to content

fix(overlay): forward card positioning data to renderCard - #5

Merged
Gabriel-Pereira1788 merged 4 commits into
mainfrom
fix/render-card-positioning-data
Sep 8, 2026
Merged

Gabriel-Pereira1788 merged 4 commits into
mainfrom
fix/render-card-positioning-data

Conversation

@Gabriel-Pereira1788

Copy link
Copy Markdown
Member

What changed

renderCard's props now include layout, width, containerHeight and isExiting — the same positioning data TourCard itself uses — instead of only step/palette/labels/etc. Both call sites in CiceroneOverlay now share one cardProps object instead of the built-in card getting extra props the custom one never saw.

Why

Fixes #4. A custom renderCard rendered pinned to the top-left of the overlay, completely disconnected from the spotlighted target — not next to it, not following placement, no arrow. The positioning math (layout, cardWidth, screen.height, isExiting) was computed in useCiceroneOverlayViewModel but only ever forwarded to the internal TourCard, never to renderCard. This was also the only documented path to a fully custom card design, and it was silently non-functional for that exact purpose.

The fix is additive: fields are only added to cardProps, so any existing renderCard implementation that ignores them keeps working unchanged.

How it was verified

  • yarn lint — zero errors and zero warnings
  • yarn typecheck
  • yarn test
  • Ran the example on a device or simulator (iPhone 17 simulator, via yarn example ios)

If it touches the tour surface

If it touches the build

Not applicable — no build/alias changes.

🤖 Generated with Claude Code

https://claude.ai/code/session_014wCD2QPtx1V5YbA9YgT8c8

Gabriel-Pereira1788 and others added 3 commits September 7, 2026 20:32
renderCard only received step/palette/labels fields, never the
layout/width/containerHeight/isExiting that TourCard uses to place
itself next to the target — a custom card rendered pinned to the
top-left with no positioning at all. Folds those fields into the
single cardProps object shared by both call sites.

Fixes #4

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014wCD2QPtx1V5YbA9YgT8c8
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014wCD2QPtx1V5YbA9YgT8c8
The ICiceroneCardProps table and the renderCard example were both
incomplete in the same way as the bug: neither showed how to
position a custom card, so exposing the fields alone would not have
helped a consumer use them.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014wCD2QPtx1V5YbA9YgT8c8
CI's format:check caught table alignment and unwrapped destructuring
that yarn format wasn't run on before the previous commit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014wCD2QPtx1V5YbA9YgT8c8
@Gabriel-Pereira1788
Gabriel-Pereira1788 merged commit 2df9127 into main Sep 8, 2026
6 checks passed
@eumaninho54 eumaninho54 mentioned this pull request Sep 8, 2026
8 tasks
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.

renderCard doesn't receive positioning data — custom cards render unpositioned, not next to the target

2 participants