feat(pos-app): add BigAmountInput with per-character animations#400
feat(pos-app): add BigAmountInput with per-character animations#400ignaciosantise merged 6 commits intomainfrom
Conversation
- Add animated currency display with enter/exit animations per character - Support locale-aware formatting and thousand separators - Include blinking cursor with position tracking - Auto-scale font size for large amounts - Limit decimal input to 2 places Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Resolve conflict in amount.tsx: - Keep BigAmountInput with dynamic currency symbol - Preserve decimal limit logic - Keep platform-specific styling from main Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…mation # Conflicts: # dapps/pos-app/app/amount.tsx
Replace static amount display with animated BigAmountInput component featuring per-character enter/exit animations, dynamic font scaling for large amounts, and currency symbol position support (left/right). - Add AnimatedCharacter with fade+slide enter/exit transitions - Add AnimatedCursor with blinking and position tracking - Support locale-aware number formatting with thousand separators - Handle symbolPosition for currencies like EUR (right-side symbol) - Limit decimal input to 2 places - Tune animation duration to 200ms for responsive feel Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @ignaciosantise's task in 2m 31s —— View job Code Review
No breaking changes detected (all new props are optional with backward-compatible defaults). Found 4 issue(s)Issue 1:
|
There was a problem hiding this comment.
Pull request overview
This PR introduces a new BigAmountInput component that replaces the static amount text display with an animated component featuring per-character enter/exit animations. The component supports currency symbol positioning (left/right), auto-scaling for large amounts, decimal input limiting, and customizable animation timing.
Changes:
- Added new
BigAmountInputcomponent with per-character fade + slide animations - Implemented support for
symbolPositionprop to handle currencies like EUR where the symbol appears on the right - Added utility functions for amount formatting, character parsing, and layout calculations
- Integrated the component into the amount screen, replacing the previous static text display
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 19 comments.
Show a summary per file
| File | Description |
|---|---|
dapps/pos-app/components/big-amount-input/utils/getCharactersArray.ts |
Parses formatted amounts into character arrays with stable keys for animations |
dapps/pos-app/components/big-amount-input/utils/formatAmount.ts |
Handles amount formatting, decimal separator detection, and input cleaning |
dapps/pos-app/components/big-amount-input/index.ts |
Main export file for the BigAmountInput component and types |
dapps/pos-app/components/big-amount-input/hooks/useAnimatedNumberValue.ts |
Hook for managing formatted values and character data for animations |
dapps/pos-app/components/big-amount-input/hooks/useAnimatedNumberLayout.ts |
Hook for calculating character positions, widths, and scaling for layout |
dapps/pos-app/components/big-amount-input/components/AnimatedNumberCharacters.tsx |
Renders the collection of animated characters with separators |
dapps/pos-app/components/big-amount-input/components/AnimatedNumber.tsx |
Main animated number display component that orchestrates character and cursor rendering |
dapps/pos-app/components/big-amount-input/components/AnimatedCursor.tsx |
Animated blinking cursor component with position tracking |
dapps/pos-app/components/big-amount-input/components/AnimatedCharacter.tsx |
Individual character component with enter/exit animations |
dapps/pos-app/components/big-amount-input/BigAmountInput.types.ts |
TypeScript type definitions for component props |
dapps/pos-app/components/big-amount-input/BigAmountInput.tsx |
Main component wrapper that integrates AnimatedNumber |
dapps/pos-app/components/animated-amount-input.tsx |
Appears to be an older version of animated input (potentially unused) |
dapps/pos-app/app/amount.tsx |
Integration point replacing static text with BigAmountInput component |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dapps/pos-app/components/big-amount-input/hooks/useAnimatedNumberValue.ts
Show resolved
Hide resolved
dapps/pos-app/components/big-amount-input/utils/formatAmount.ts
Outdated
Show resolved
Hide resolved
dapps/pos-app/components/big-amount-input/components/AnimatedCharacter.tsx
Show resolved
Hide resolved
dapps/pos-app/components/big-amount-input/components/AnimatedCharacter.tsx
Outdated
Show resolved
Hide resolved
dapps/pos-app/components/big-amount-input/hooks/useAnimatedNumberLayout.ts
Show resolved
Hide resolved
dapps/pos-app/components/big-amount-input/components/AnimatedCharacter.tsx
Show resolved
Hide resolved
- Remove unsupported transformOrigin, compensate with translateX offset - Add cancelAnimation cleanup in cursor useEffect to prevent memory leak - Delete unused animated-amount-input.tsx - Rename getDeviceLocale to getDefaultLocale (hardcoded stub) - Remove unused normalizeRawValue export - Import SymbolPosition from @/utils/currency instead of redefining Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
BigAmountInputcomponent featuring per-character enter/exit animations (fade + slide from bottom)symbolPositionprop for currencies like EUR where the symbol goes on the right (10.00€vs$10.00)Test plan
🤖 Generated with Claude Code