Repository navigation
fix(Card): Card.Content finds a cover or a title before it by their real names - #28
Closed
joelmsanto wants to merge 1 commit into
Closed
joelmsanto wants to merge 1 commit into
joelmsanto wants to merge 1 commit into
Conversation
…eal names Card lists its children by `child.type.displayName`. The exported Card.Cover and Card.Title are wrapped by withInternalTheme, whose withTheme (@callstack/react-theme-provider) names them `withTheme(Card.Cover)` and `withTheme(Card.Title)`. Card.Content compared them with the literals 'withInternalTheme(CardCover)' and 'withInternalTheme(CardTitle)', which never matched (as in upstream 5.0.0 to 5.12.5), so a Card.Content after a cover or a title, when neither first nor last child, got no top spacing and its text sat on the image. It now reads the exported components' own displayName, so the names cannot drift apart again. Card.test.js: a Card.Content after a Card.Cover, and after a Card.Title, takes the card's top spacing (spacing.x4). Upstream replaced this sibling lookup with context in callstack#5076 (2026-10-12); this is the minimal fix on the 5.12 line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Closed at the owner's request: the change is reverted. The card composition in CustomerApp follows the app's existing card with media (VendorListItem: Card.Cover, Card.Title, Card.Content) instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Cardlists its children bychild.type.displayName. The exportedCard.CoverandCard.Titleare wrapped bywithInternalTheme, whosewithTheme(@callstack/react-theme-provider3.0.9,createWithTheme.js) names themwithTheme(Card.Cover)andwithTheme(Card.Title).Card.Contentcompared them with the literals'withInternalTheme(CardCover)'and'withInternalTheme(CardTitle)', which never matched (the same code is in upstream 5.0.0 to 5.12.5). So aCard.Contentafter a cover or a title, when it is neither the first nor the last child, got no top spacing, and its text sat on the image. Seen in CustomerApp's welcome (auth):Card.Cover→Card.Content→Card.Actions.Fix
Card.Contentreads the exported components' owndisplayName, so the names cannot drift apart again. It is typed byReact.ComponentType, with no cast and no import cycle.Upstream replaced this sibling lookup with context in callstack#5076 (2026-10-12); this is the minimal fix on the 5.12 line.
Tests
src/components/__tests__/Card/Card.test.js: aCard.Contentafter aCard.Cover, and after aCard.Title, takes the card's top spacing (spacing.x4).Not run: this checkout has no
node_modules, and installing needs the private registry, which answers 403 from the author's machine.Release
Publishing 5.12.14 and pinning it in CustomerApp are the owner's steps.
🤖 Generated with Claude Code