Skip to content

spec(Avatar): React Native platform record - #12828

Draft
imdreamrunner wants to merge 3 commits into
chore/knowledge-react-native-platform-recordsfrom
spec/avatar-react-native-record
Draft

imdreamrunner wants to merge 3 commits into
chore/knowledge-react-native-platform-recordsfrom
spec/avatar-react-native-record

Conversation

@imdreamrunner

@imdreamrunner imdreamrunner commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #12592 (it lets check:knowledge accept react-native platform records); the base is that branch. This PR's change is one file: docs/specs/components/Avatar/Avatar.react-native.spec.md.

Exact decision needed

How React Native renders Avatar: which web props it takes, what it adds, how its fallback paints, and how its link, button and tooltip behave under a finger. The record is the React Native platform record of component:Avatar (component:react-native/Avatar, platform_of: component:Avatar). It states only what React Native adds or does differently.

Existing authority searched

  • Records: component:Avatar (FR1–FR9, AR1–AR7) and its Swift record; component:AvatarStatusDot; component:AvatarGroup; component:Tooltip; family:navigation-destinations; architecture:knowledge-contracts (platform records beside the core record); spec:AST-082 FR3, FR5, FR7, FR11 and spec:AST-093 FR1–FR5; the other React Native platform records (spec(TabBar): React Native platform record #12686, spec(Button): React Native platform record #12817).
  • Code: packages/core/src/Avatar/ (props, the fallback chain, the initials rule, status placement).
  • Overlap: no other record owns Avatar on React Native. The status dot, the group and the tooltip surface stay with their own records.

Decision

  • React Native takes web's src, fallbackSrc, name, alt, size (the named sizes the generated native contract projects), shape, status, tooltip, href and onClick, plus initials, and no other props; it does not offer as, target and rel (FR1). initials takes letters a data source already has (FR2).
  • The fallback chain and initials rule are web's (FR3). The avatar grows with the text size up to 1.6 times, as the Swift record states, and its fallback is the theme's gray pairing inside a hairline ring (FR4, DEC-2).
  • The status sits outside the clip at web's places, and its label joins the name: an AvatarStatusDot's reported label, else a string label on the passed element (FR5).
  • An accepted href makes a link that opens through the app's link opener; onClick makes a button; interactive avatars take a full platform touch target through their hit area (FR6).
  • An omitted tooltip shows the name, except inside an Item or List row (DEC-1). Under a finger the tooltip follows component:Tooltip FR5 with touchTrigger auto: a tap opens it on an avatar with no tap action (FR7). In a group, the size, shape, ring and overlap are web's; React Native adds that the initials of a covered avatar centre in its uncovered part (FR8).
  • Eight gap lines record where @astryxdesign/react-native differs: numeric sizes, onPress and a per-call-site color (FR1), emoji initials on an engine without grapheme segmentation (FR3), size at large text (FR4), the dot's angle and a passed element's label (FR5), and a hold-to-show tooltip (FR7).

Rejected alternatives

None recorded.

Claim scope and non-goals

The claims are FR1–FR8, AR1–AR4, ORD1–ORD5, PR1–PR2 and DEC-1–DEC-2. The record's "Does not own" list names the owner of each adjacent responsibility.

Open questions: none.

Evidence and implementation relationship

No React Native implementation exists in this repository. The record states the target behavior, and its verification map names the evidence for each requirement: unit tests of the package, Simulator and emulator captures, touch checks, and VoiceOver and TalkBack checks. Where the behavior does not meet the target, the record lists a requirement gap line (FR1, FR3–FR5, FR7).

Writing rubric results

  • R1 narration: none; every requirement is in the present tense about the system.
  • R2 research in the record: none; the conclusions sit inside DEC-1 and DEC-2.
  • R3 evidence naming a change: none; basis cells cite records and clauses.
  • R4 rejected alternatives over one line or outside a decision: none; the record has no rejected alternatives.
  • R5 pull request or issue references remaining: none.
  • R6 ruled open questions still listing options: none; the record has no open questions.
  • R7 project status: none in prose; eight shortfalls are requirement gap lines under FR1, FR3, FR4, FR5 and FR7. The only lifecycle field is the template's Released default preserved.

Scope

Components: Avatar

  • This PR contains specification records only.
  • It records observable behavior and preserves equivalent internal implementations.
  • Any named internal mechanism is intentionally public, names its dependent caller/system, and explains why an equivalent implementation would not satisfy the contract.
  • Verification states the evidence layer and failure signal without prescribing CI job/workflow topology.
  • It records one intentional durable decision, not a rescue for a separable tagalong.
  • The canonical knowledge owner, affected current claims, and overlapping open work are named; any ownership collision is resolved or called out for human decision.
  • Adjacent API, visual, accessibility, composition, and implementation facts remain outside scope unless this exact decision depends on them.
  • Public text and artifacts contain no internal Meta context.

Validation

  • node scripts/check-knowledge.mjs: passes ("Knowledge templates and records are aligned.")
  • Prettier: passes
  • git diff --check: clean

@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 19, 2026 7:17am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 19, 2026, 7:22 AM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 19, 2026

@astracat-bot astracat-bot Bot 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.

Approval waits on an engineering owner's decision on this draft record, and six fixes are needed whatever that decision is.

An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. What needs settling: DEC-1's row default, which departs from the rule in spec:AST-082 FR3 that a core prop keeps its defaults on every platform; the React Native-only initials prop; DEC-2's fallback paint and the 1.6x text-size cap; FR6's link opener; FR8's rule that initials centre in an avatar's uncovered part; and PR1–PR2.

Required fixes:

  • FR7's hold-to-show tooltip contradicts spec:AST-082 FR3 and component:Tooltip FR5, which open a touch tooltip on a completed tap under touchTrigger and close it on a second tap or a tap outside, so follow that rule as the Swift record does and update AR4 to match.
  • FR1's numeric sizes fall outside the generated native Avatar contract that spec:AST-093 FR5 requires, which offers only xsm to xl (asserted in packages/native/src/contract/contracts.test.ts), so keep the named sizes and verify against that contract, or change the contract first.
  • FR8 states both stacking orders, "slides under the one before it" and "an avatar the next one covers", so state the web's order, where each avatar overlaps the one before it.
  • The description says "Group adaptations are web's (FR8)", but FR8 also centres initials in an avatar's uncovered part, which the web does not do, so name it in the description as a React Native addition.
  • FR5 composes the name only from an AvatarStatusDot, dropping the passed element's string label that component:Avatar FR5 reads and that the record's own FR5 gap line treats as a gap, so require it in FR5.
  • The onPress and color gap lines cite FR2, which does not forbid them, and every gap line describes a package the record never names, so close the prop set in FR1, anchor those gaps there, and name the package.
Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: the change is one added record, stacked on #12592: verified (one file, 246 added lines).
  • Claim: the core Avatar record holds FR1–FR9 and AR1–AR7: verified.
  • Claim: the record's id and core component link: verified in its frontmatter.
  • Claim: the avatar grows up to 1.6 times as the Swift record states: verified, though the Swift record is itself a draft.
  • Claim: the status sits outside the clip at web's places: verified against the core placement clause.
  • Claim: group adaptations are web's: false, FR8 adds the uncovered-part rule.
  • Claim: six gap lines, and the listed requirement, ordering, performance and decision ids: verified.
  • Claim: no React Native implementation exists in this repository: verified.
  • Claim: no other record or open pull request owns Avatar on React Native: verified.
  • Claim: the knowledge check and Prettier pass: verified at the head.
  • File: docs/specs/components/Avatar/Avatar.react-native.spec.md: the findings above.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot 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.

Approval waits on an engineering owner's decision on this draft record, and one fix is needed whatever that decision is. The six fixes from the last review are in: the tap tooltip, named sizes, status label, group order, the description's group claim, and the gap lines anchored to a closed prop set.

An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. What needs settling: DEC-1's empty default tooltip inside an Item or List row, which departs from the rule in spec:AST-082 FR3 that a core prop keeps its defaults on every platform (an explicit tooltip there also makes the avatar a tap target inside a pressable row, which component:Tooltip leaves open); the React Native-only initials prop; DEC-2's fallback paint and the 1.6x text-size cap; FR6's link opener; FR8's rule that initials centre in an avatar's visible part; and PR1–PR2.

Required fix:

  • The Contract at a glance rows are out of date after this push: Compatibility/readiness says the gap lines sit under FR2, FR3, FR4 and FR5 while they now sit under FR1, FR3, FR4, FR5 and FR7, and Builder impact says web code ports unchanged unless it passes as, target or rel, although FR1 now refuses numeric sizes.
Claims and files checked

Review mode: full; reason: spec-record

  • Claim: the change is one added record stacked on its base pull request: verified (one file, 253 added lines).
  • Claim: the record is the React Native platform record of the core Avatar and states only what React Native adds or does differently: id and core link verified; it also restates parts of the core record.
  • Claim: the props are web's without as, target and rel, with the named sizes the generated native contract projects, plus initials, and no others: verified against the generated contract and its test.
  • Claim: the fallback chain and initials rule are web's: verified.
  • Claim: growth to 1.6 times the text size, as the Swift record states: verified, though the Swift record is a draft.
  • Claim: the status sits at web's places and its label comes from a status dot, else the passed element's label: verified.
  • Claim: links open through the app's link opener, onClick makes a button, and interactive avatars take a full touch target: verified.
  • Claim: an omitted tooltip shows the name except in an Item or List row, and a tap opens it on an avatar with no tap action: verified against the record and the core Tooltip touch rule.
  • Claim: in a group the size, shape, ring and overlap are web's, and React Native adds the uncovered-part initials: verified.
  • Claim: eight gap lines name where the package differs: verified.
  • Claim: no React Native implementation exists in this repository, and no other record or open pull request owns Avatar on React Native: verified.
  • Claim: the knowledge check, Prettier and the whitespace check pass: verified at this head.
  • File: docs/specs/components/Avatar/Avatar.react-native.spec.md: the findings above.

Automated review (maintainer link)

activation.
- **AR3 — The tooltip is a hint.** Tooltip words other than the name are read
as the hint after the name; the name is never read twice.
- **AR4 — Touch target.** A link or button avatar, and a static avatar with a

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.

Non-blocking: AR4 now gives a static avatar with a tooltip the platform touch target and cites FR6, but FR6 states the target for link and button avatars only, and the FR6, AR2, AR4 verification row has no static-tooltip state. Name that avatar in FR6 and add the state.

@astracat-bot astracat-bot Bot 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.

Approval waits on an engineering owner's decision on this draft record; the at-a-glance rows from the last review now match the requirements, and no other fix is required.

An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. What needs settling: DEC-1's empty default tooltip inside an Item or List row, which departs from the rule in spec:AST-082 FR3 that a core prop keeps its defaults on every platform (an explicit tooltip there also makes the avatar a tap target inside a pressable row, which component:Tooltip leaves open); the React Native-only initials prop; DEC-2's fallback paint and the 1.6x text-size cap; FR6's link opener; ORD3's rule that a rejected href with onClick makes a button, where component:Avatar keeps href first; FR8's rule that initials centre in an avatar's visible part; and PR1–PR2.

The inline comments carry the non-blocking notes, among them the touch target FR6 leaves out for a static avatar with a tooltip and the same-layer limit FR8 drops from the core group rule.

Claims and files checked

Review mode: full; reason: spec-record

  • Claim: the change is one added record, stacked on the pull request that lets the knowledge check accept React Native records: verified (one file, 253 added lines, on that branch).
  • Claim: the record is the React Native platform record of the core Avatar and states only what React Native adds or does differently: id and core link verified; it also restates parts of the core record.
  • Claim: the existing authority listed was searched, and no other record or open pull request owns Avatar on React Native: verified; the Swift record it leans on is a draft.
  • Claim: the props are web's without as, target and rel, with the named sizes the generated native contract projects, plus initials, and no others: verified against the generated contract and its test; initials is not in that contract.
  • Claim: the fallback chain and initials rule are web's: verified.
  • Claim: growth to 1.6 times the text size as the Swift record states, and a gray fallback in a hairline ring: verified as the record's text; the Swift record is a draft.
  • Claim: the status sits at web's places and its label comes from a status dot, else the passed element's label: verified.
  • Claim: an accepted href opens through the app's link opener, onClick makes a button, and interactive avatars take a full touch target: verified; a rejected href with onClick also becomes a button, unlike the core order.
  • Claim: an omitted tooltip shows the name except in an Item or List row, and a tap opens it on an avatar with no tap action: verified against the record and the core Tooltip touch rule.
  • Claim: in a group the size, shape, ring and overlap are web's, and React Native adds the uncovered-part initials: verified, except that the same-layer limit is not restated.
  • Claim: eight gap lines name where the package differs: verified, under FR1, FR3, FR4, FR5 and FR7.
  • Claim: the claim scope and an empty open-questions list: verified.
  • Claim: no React Native implementation exists in this repository, and the verification map names the evidence for each requirement: verified.
  • Claim: the writing rubric finds no narration, research, status, pull request references or rejected alternatives in the record: verified.
  • Claim: the record and the public text carry no internal context: verified.
  • Claim: the knowledge check, Prettier and the whitespace check pass: verified at this head.
  • File: docs/specs/components/Avatar/Avatar.react-native.spec.md: no required fix; the owner decision above and the inline non-blocking notes.

Automated review (maintainer link)

- **ORD1 — Visual.** `src` → `fallbackSrc` → `initials` as given → initials of
`name` → silhouette.
- **ORD2 — Name.** `alt` → `name`, then joined with a reported status label.
- **ORD3 — Root.** An accepted `href` → `onClick` → static.

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.

A rejected href changes the root order. component:Avatar ORD3 is href → onClick → static, and on the web a rejected destination still takes the link root: an anchor with no destination and no role, so onClick does not make it a button (useLinkComponent.ts, Avatar.tsx). Here a rejected href with onClick becomes a button. It needs the owner's decision with the record's other departures; if it should match the web, say that a rejected href leaves a root with no role that opens nothing.

| FR5 | A `status` MUST draw in a slot outside the avatar's clip that takes no touches: on a circle centred on the circle's edge at the bottom trailing 45° point, on a rounded or square avatar at the bottom trailing corner, overhanging it by a quarter of its size; placement is logical, so it mirrors in right-to-left. The status label, the one an `AvatarStatusDot` in the slot reports at any wrapper depth, which wins, else a string `label` on the passed element, read on every render, joins the avatar's name as the catalog's "{name}, {status}", and a status label alone names the avatar. | `component:Avatar` FR4, FR5; `component:AvatarStatusDot` | verify |
| FR6 | An `href` that `family:navigation-destinations` accepts MUST make the avatar a link: a press runs `onClick` and then opens the destination through the app's link opener, the `LinkProvider` above it, else the system's URL opener. A rejected destination reaches no opener and leaves no link role. Otherwise `onClick` makes a button, and with neither the avatar is static. A link or button avatar draws the platform's press feedback in its shape, a ripple on Android, shows the theme's focus outline when it has focus, and reaches the platform's minimum touch target (44 pt on iOS, 48 dp on Android) through its hit area without changing its size. An interactive avatar with neither `name` nor `alt` warns once in development. | `component:Avatar` FR6, AR7; `family:navigation-destinations`; `spec:AST-082` FR11 | verify |
| FR7 | `tooltip` MUST resolve as web's does: omitted or `true` is the name, a string is those words, and `false` or blank words are none; an omitted `tooltip` inside an Item or List row is none (DEC-1). Words other than the name are the avatar's accessibility hint. Under a finger the tooltip follows `component:Tooltip` FR5 with `touchTrigger` `auto`: on an avatar with no tap action a completed tap opens it, and a second tap on the avatar or a tap outside closes it; on a link or button avatar a tap performs its action and opens nothing. | `component:Avatar` FR7; `component:Tooltip` FR5; `spec:AST-082` FR3; DEC-1 | verify |
| FR8 | Inside an AvatarGroup, the group's size and shape MUST win over the avatar's own. Each avatar overlaps the one before it by a quarter of its size, as on the web, and draws a 2 dp ring in `color.backgroundSurface` outside its box. The initials of an avatar the next one covers centre in its uncovered part, so every visible avatar's letters stay whole. | `component:Avatar` FR8 | verify |

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.

Non-blocking: component:Avatar FR8 and ORD4 apply the group's size, shape, ring and overlap only to members in the same layer; an avatar in a popover or hover card opened from a group keeps its own. This FR and ORD5 drop that limit. Suggest: "Inside an AvatarGroup in the same layer, …", or cite core FR8 and keep only the uncovered-part rule.

| Public contract | Web's `Avatar` props `src`, `fallbackSrc`, `name`, `alt`, `size` (the named sizes), `shape`, `status`, `tooltip`, `href` and `onClick`, without `as`, `target` and `rel`. React Native adds `initials`. |
| Behavior | The photo, then the fallback photo, then initials, then a drawn silhouette, in the theme's gray pairing inside a ring. The status sits outside the clip. A static avatar is a named image; `href` makes a link that opens through the app's link opener, and `onClick` a button. An omitted tooltip shows the name, except in an Item or List row; under a finger a tap opens it on an avatar with no tap action. |
| End-user impact | A person sees the same face, initials or silhouette as on the web, on any surface in light and dark; VoiceOver and TalkBack read who the avatar is and its status in one name; a small interactive avatar still takes a full-size touch. |
| Builder impact | Web code that renders an `Avatar` ports unchanged unless it passes `as`, `target`, `rel` or a numeric `size`. A data source that already has a person's initials passes them as `initials`. |

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.

Non-blocking: DEC-1 adds a caller choice this row does not name: a row avatar that relied on the default name tooltip passes tooltip explicitly on React Native. Suggest adding: "Inside an Item or List row, pass tooltip to keep the name tooltip."

This branch was successfully deployed

1 active deployment
Preview — 0aff3c66 Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant