Skip to content

Conversation

joel-jeremy
Copy link
Contributor

@joel-jeremy joel-jeremy commented Mar 6, 2025

Update mobile forms TapField to replace the usage of the deprecated Button with the Button from the component library

@actual-github-bot actual-github-bot bot changed the title Update mobile forms TapField to use the new Button component [WIP] Update mobile forms TapField to use the new Button component Mar 6, 2025
Copy link

netlify bot commented Mar 6, 2025

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit a8c7b71
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/67ca6f5800a030000835b95c
😎 Deploy Preview https://deploy-preview-4559.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

github-actions bot commented Mar 6, 2025

Bundle Stats — desktop-client

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
18 8.11 MB → 8.11 MB (+87 B) +0.00%
Changeset
File Δ Size
src/components/mobile/MobileForms.tsx 📈 +104 B (+4.10%) 2.48 kB → 2.58 kB
src/components/mobile/transactions/TransactionEdit.jsx 📈 +10 B (+0.03%) 34.69 kB → 34.7 kB
src/components/modals/TransferModal.tsx 📉 -27 B (-0.64%) 4.12 kB → 4.1 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 5.37 MB → 5.37 MB (+87 B) +0.00%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/de.js 118.58 kB 0%
static/js/en.js 106.5 kB 0%
static/js/es.js 59.63 kB 0%
static/js/nl.js 103.3 kB 0%
static/js/fr.js 116.49 kB 0%
static/js/en-GB.js 96.66 kB 0%
static/js/AppliedFilters.js 10.87 kB 0%
static/js/useAccountPreviewTransactions.js 1.69 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/workbox-window.prod.es5.js 5.69 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/wide.js 100.38 kB 0%
static/js/uk.js 111.06 kB 0%
static/js/narrow.js 88.44 kB 0%
static/js/pt-BR.js 110.52 kB 0%
static/js/ReportRouter.js 1.59 MB 0%

Copy link
Contributor

github-actions bot commented Mar 6, 2025

Bundle Stats — loot-core

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
1 2.57 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.js 2.57 MB 0%

@joel-jeremy joel-jeremy changed the title [WIP] Update mobile forms TapField to use the new Button component Remove usage of deprecated Button component in MobileForms Mar 6, 2025
Copy link
Contributor

coderabbitai bot commented Mar 6, 2025

"""

Walkthrough

The changes update the handling and styling of the TapField component across multiple files. In MobileForms.tsx, the code now imports Button and theme, introduces a new defaultTapFieldStyle constant, and extends the TapFieldProps with an optional textStyle property. The component's text rendering is adjusted with a fixed textAlign value, and event handling is simplified by directly using props. In TransactionEdit.jsx, the TapField properties are standardized by renaming disabled to isDisabled and replacing onClick with onPress for several fields. Similarly, both CoverModal.tsx and TransferModal.tsx have been updated to adopt the onPress event handler, with TransferModal.tsx also removing the tabIndex property. These modifications ensure consistency in the interaction patterns used across the application.

Possibly related PRs

  • [Mobile] Allow updating existing transaction's account #3549: The changes in the main PR regarding the TapField component's properties and event handling are directly related to the modifications made in the TransactionEdit.jsx file of the retrieved PR, which also involves changes to the TapField component's properties, specifically renaming disabled to isDisabled and changing onClick to onPress.
  • Use a toggle on mobile transaction's Cleared flag #3622: The changes in the main PR regarding the TapField component's properties and event handling are related to the modifications in the retrieved PR, which also involves updates to the TapField component's properties and event handlers, specifically renaming disabled to isDisabled and changing onClick to onPress.
  • Convert Mobile Transaction component to TransactionListItem + cleanup #3761: The changes in the main PR regarding the TapField component's properties and event handling are related to the modifications in the TransactionEdit.jsx and TransferModal.tsx files, which also involve updates to the TapField component's properties and event handlers.

Suggested labels

:sparkles: Merged

Suggested reviewers

  • MikesGlitch
  • matt-fidd
    """

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44f818d and b1b0d21.

📒 Files selected for processing (1)
  • packages/desktop-client/src/components/mobile/MobileForms.tsx (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Functional
  • GitHub Check: Visual regression
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: build (windows-latest)
🔇 Additional comments (7)
packages/desktop-client/src/components/mobile/MobileForms.tsx (7)

9-9: Imports updated to use current component library.

The implementation now correctly imports Button and theme from the @actual-app/components package, aligning with the PR objective to replace deprecated components with current ones.

Also applies to: 12-12


79-79: Enhanced component flexibility with textStyle prop.

Adding the optional textStyle property to TapFieldProps provides more granular control over text styling, which is a good improvement for component customization.


82-103: Good practice: Centralized styling logic.

Extracting the button styling logic into the defaultTapFieldStyle constant improves code organization and maintainability. This approach properly handles different states (disabled, pressed, hovered) while maintaining styling consistency.


106-106: Updated props destructuring to include new textStyle prop.

The component parameters now correctly include the new textStyle prop, ensuring it can be passed through to the Text component.


111-114: Improved style composition.

The style prop now properly composes styles by:

  1. Using the centralized defaultTapFieldStyle
  2. Correctly handling both function-based and object-based style props
  3. Maintaining proper style precedence

This approach ensures consistency while preserving customization capabilities.


120-127: Enhanced text styling and layout.

The Text component styling has been improved with explicit textAlign: 'left' and proper integration of the custom textStyle prop. This ensures consistent text alignment while allowing for customization.


131-131: Updated condition for rightContent rendering.

Changed from !disabled to !props.isDisabled to align with the component library's naming conventions. This ensures consistency with the Button component's expected props.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@joel-jeremy
Copy link
Contributor Author

/update-vrt

@joel-jeremy joel-jeremy changed the title Remove usage of deprecated Button component in MobileForms Replace usage of deprecated Button component in MobileForms with new Button component Mar 6, 2025
Copy link
Contributor Author

@joel-jeremy joel-jeremy Mar 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bug in latest version/edge where account field is not suppressed. It's properly suppressed in this PR.

@joel-jeremy joel-jeremy merged commit 63657a8 into master Mar 7, 2025
21 checks passed
@joel-jeremy joel-jeremy deleted the mofile-forms-rac-button branch March 7, 2025 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants