Skip to content

NumberForm foundation 3: BigNumberPad primitive and layout composition #98171

Closed

Description

@mountiny

Sub-issue of #97970.
Migration plan: jmgraa comment.

Last foundation issue. It adds the number pad primitive, composes every primitive through NumberForm across all four layout combinations, and rewires NumberWithSymbolForm to delegate to that composition.

Scope

  • Step: 3 of the migration plan
  • Scope: 1 new primitive, layout composition, NumberWithSymbolForm becomes an adapter

Target API

<NumberForm value={amount} onInputChange={handleAmount}>
    <NumberForm.Input symbol="$" position="prefix" />
    <NumberForm.FlipButton />
    <NumberForm.CurrencyButton currency="USD" onPress={handleCurrency} />
    <NumberForm.BigNumberPad onNumberPressed={handleNumber} />
</NumberForm>

NumberForm.BigNumberPad wraps the existing src/components/BigNumberPad.tsx rather than reimplementing it.

Layouts to cover

Four combinations, currently spread across three early return paths in src/components/NumberWithSymbolForm.tsx:

  • portrait, touch
  • portrait, non touch
  • landscape, touch
  • landscape, non touch

Duplication being collapsed:

  • BigNumberPad is rendered twice, at lines 686 (landscape) and 785 (portrait), with identical props. The landscape branch also has a redundant double shouldShowBigNumberPad ? check at lines 680 and 685.
  • The ref fanout closure is duplicated verbatim at lines 551-559 and 587-595.
  • Lines 581 to 635 build a shared textInputComponent with roughly 35 props, used by the landscape and portrait paths but not by displayAsTextInput.

Correction to step 3 of the migration plan

The plan says step 3 should "Remove the remaining duplicated layout/button paths from the old component". Do not do that literally. NumberWithSymbolForm stays in use until the cleanup issue #98178, and roughly 30 files depend on it transitively through AmountForm, MoneyRequestAmountInput and MoneyRequestAmountForm. Gutting its layout paths here breaks all of them.

Instead: rewrite NumberWithSymbolForm as a thin adapter that renders the NumberForm composition internally. Its public props and its ref keep working unchanged, the duplicated layout and button code disappears, and no call site has to move yet. Deletion happens in #98178, after every consumer migrates.

Out of scope

  • Marking anything @deprecated, and the migration guide — #98172
  • Any call site change
  • Deleting NumberWithSymbolForm, its props types or its story — #98178

Acceptance criteria

  • NumberForm.BigNumberPad wraps src/components/BigNumberPad.tsx
  • NumberForm composes correctly in portrait and landscape, touch and non touch
  • NumberWithSymbolForm renders the NumberForm composition internally and keeps its current public props and ref
  • No duplicated pad, button, FormHelpMessage or ref fanout code remains in NumberWithSymbolForm
  • Pad and layout tests ship with this PR
  • The tests from #98168 still pass with no edits, which is the proof the adapter is behaviour preserving
  • Spot check the three heaviest screens by hand: the IOU amount page, the manual distance page and the confirmation list amount field, in both orientations
  • Verify that no errors appear in the JS console

Dependencies

Issue OwnerCurrent Issue Owner: @bernhardoj

Activity

  1. added
    Weekly
    Skip Payment
    on Aug 10, 2026
  2. added and removed
    Weekly
    on Sep 2, 2026
  3. melvin-bot commented on Sep 2, 2026

    @melvin-bot

    This issue has not been updated in over 15 days. @mountiny, @bernhardoj, @jmgraa eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  4. added
    Reviewing
    Weekly
    and removed on Sep 25, 2026
  5. removed
    Reviewing
    Weekly
    on Oct 15, 2026
  6. 25 remaining items

  7. added
    Reviewing
    Weekly
    Daily
    and removed
    Daily
    Reviewing
    Weekly
    on Nov 3, 2026
  8. melvin-bot commented on Nov 4, 2026

    @melvin-bot

    @bernhardoj

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.31-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

  9. added
    Reviewing
    Weekly
    Daily
    and removed
    Daily
    Reviewing
    Weekly
    on Nov 4, 2026
  10. melvin-bot commented on Nov 9, 2026

    @melvin-bot

    @bernhardoj

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.34-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

  11. jmgraa commented on Nov 13, 2026

    @jmgraa
    Contributor

    Implementation Note & Architecture Delta

    Key deviations from the original issue description:

    1. Direct Adapter on main abandoned: We did not convert legacy NumberWithSymbolForm into an internal production adapter backed by the new primitives, as doing so would have forced ~15 disparate screens to switch simultaneously, creating an unmanageable QA regression risk.
    2. Layout Architecture: Implemented KeypadAmountEditor with full two-column phone landscape layout, detached minus-sign handling, dynamic font sizing, and BigNumberPad integration.
    3. Upstream Fix: Resolved a react-native-web touch pad issue in PR terminate responder on 'select' when text is actually selected #103460.

    Note

    Suggested Title Update:
    NumberWithSymbolForm foundation 3: KeypadAmountEditor layout and BigNumberPad integration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

DailySkip PaymentTask

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions