[meta] Composify credit card editor
Categories
(Firefox for Android :: Autofill, enhancement)
Tracking
()
People
(Reporter: segun, Assigned: segun)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
(Keywords: meta, Whiteboard: [fxdroid] [group1])
Attachments
(3 obsolete files)
| Assignee | ||
Updated•2 months ago
|
Updated•2 months ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 1•1 month ago
|
||
This patch introduces the Jetpack Compose UI for the "Add/Edit Credit Card" screen, which was previously a native Android view.
The following new files have been added:
CreditCardEditorScreen.kt: The main composable for the screen, which handles both adding a new card and editing an existing one. It includes the top app bar, text input fields for card number and name, dropdowns for expiration date, and action buttons.CreditCardEditorState.kt: A newStatedata class that defines the model for the editor screen, holding properties like card details, expiry date options, and UI state flags (inEditMode,showDeleteDialog).DeleteCreditCardDialog.kt: A reusable composable for the confirmation dialog shown when deleting a credit card.
A new string resource (credit_cards_navigate_back_button_content_description) was also added for the back button's content description.
| Assignee | ||
Comment 2•1 month ago
|
||
This patch adds the state management logic for the credit card editor
The key changes include:
CreditCardEditorStore: A newUiStoreto manage the state of the editor.CreditCardEditorState: Now includes a default state and is managed by the store.CreditCardEditorAction: A new sealed interface that defines all possible user interactions and events, such as field changes, save/delete actions, and initialization.creditCardEditorReducer: A new pure function that handles state transitions based on dispatched actions.CreditCardEditorMiddleware: A new middleware to handle side effects like database operations (saving, updating, deleting cards), navigation, and validation logic.CreditCardEditorEnvironment: A new data class to provide external dependencies like navigation callbacks to the middleware.CalendarDataProvider: A new interface and its default implementation to supply month and year data for the expiry date fields, decoupling the logic from the UI.CreditCardEditorScreen.kt: The composable is updated to connect to theCreditCardEditorStore, observe state changes, and dispatch actions based on user interactions.
| Assignee | ||
Comment 3•1 month ago
|
||
This patch introduces unit tests for the CreditCardEditorStore.
The new tests cover:
- Reducer logic for state updates in
CreditCardEditorReducerTest. - Middleware logic for handling side effects like saving, deleting, and initialization in
CreditCardEditorStoreTest.
To support these tests, the following test fakes and helpers have been added:
FakeCreditCardsStorage: A fake implementation ofCreditCardsAddressesStorage.FakeCalendarDataProvider: A fake for providing month and year data.CreditCardEditorStateTestHelper: A helper function to create instances ofCreditCardEditorStatefor testing.
| Assignee | ||
Updated•29 days ago
|
Comment 4•29 days ago
|
||
Comment on attachment 9524187 [details]
WIP: Bug 1991718 - Add compose UI for credit card editor screen
Revision D271087 was moved to bug 1998194. Setting attachment 9524187 [details] to obsolete.
Comment 5•29 days ago
|
||
Comment on attachment 9524188 [details]
WIP: Bug 1991718 - Implement state management for the Credit Card Editor
Revision D271088 was moved to bug 1998196. Setting attachment 9524188 [details] to obsolete.
Comment 6•29 days ago
|
||
Comment on attachment 9524189 [details]
WIP: Bug 1991718 - Add tests for the state management logic for the Credit Card Editor
Revision D271089 was moved to bug 1998196. Setting attachment 9524189 [details] to obsolete.
| Assignee | ||
Comment 7•29 days ago
|
||
I reorganized the bug by breaking down the steps into smaller bits that could be landed separately, because we learnt that we need to specifically address the biometric authentication part of this separately to make it work with compose.
So, instead of holding up all of the work, I decided to split it up into smaller units, since we can no longer solve it in one big swoop.
| Assignee | ||
Updated•6 days ago
|
Description
•