Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split payee on mobile #2989

Closed
wants to merge 3 commits into from
Closed

Split payee on mobile #2989

wants to merge 3 commits into from

Conversation

joel-jeremy
Copy link
Contributor

No description provided.

Copy link

netlify bot commented Jul 5, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit a5e429c
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/6688351fb9b7570008d5ec1e
😎 Deploy Preview https://deploy-preview-2989.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.

@github-actions github-actions bot changed the title Split payee on mobile [WIP] Split payee on mobile Jul 5, 2024
Copy link
Contributor

github-actions bot commented Jul 5, 2024

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
9 4.91 MB → 4.91 MB (+203 B) +0.00%
Changeset
File Δ Size
src/components/mobile/transactions/Transaction.jsx 📈 +137 B (+2.62%) 5.1 kB → 5.23 kB
src/components/mobile/transactions/TransactionEdit.jsx 📈 +66 B (+0.20%) 32.02 kB → 32.09 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 3.16 MB → 3.16 MB (+203 B) +0.01%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/usePreviewTransactions.js 790 B 0%
static/js/AppliedFilters.js 27.12 kB 0%
static/js/narrow.js 76.96 kB 0%
static/js/wide.js 273.66 kB 0%
static/js/ReportRouter.js 1.23 MB 0%

Copy link
Contributor

github-actions bot commented Jul 5, 2024

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 1.13 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 1.13 MB 0%

Copy link

netlify bot commented Jul 5, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit c6f8056
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/6688728b2311680008911694
😎 Deploy Preview https://deploy-preview-2989.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.

@joel-jeremy joel-jeremy changed the title [WIP] Split payee on mobile Split payee on mobile Jul 5, 2024
@Teprifer
Copy link

Teprifer commented Jul 6, 2024

Unfortunately this doesn't flow well in mobile as it turns splits in to mystery transactions.

Edge:
image

This PR:
image

In hindsight this is the same as the recent change desktop's collapsed split:
image

I don't think turning transactions in to mysteries is a good thing, is there some way to show the first payee(or payee with the largest share) of the split as a default?

Some mock ups - excuse my MS Paint skills.

image

My preference would be the last one, the count would only show if there were more than 1 unique payees as it'd be redundant to have a count where the payee is the same but the category differs. This would also be an enhancement over the current state. Similar could be done for desktop collapsed.

@joel-jeremy
Copy link
Contributor Author

I like that idea. We could possibly implement that in desktop too if a split transaction is collapsed.

@youngcw
Copy link
Member

youngcw commented Jul 12, 2024

I like @Teprifer 's first and last mockups.

@psybers
Copy link
Contributor

psybers commented Jul 13, 2024

Just curious, but if there is a 'Split' (and icon) right below, do we need to say 'split' twice?

@jfdoming
Copy link
Contributor

Just curious, but if there is a 'Split' (and icon) right below, do we need to say 'split' twice?

I agree, maybe one idea is moving the "split" icon up to the payee, as it is on desktop, instead, but removing the "Split" text so it's similar to what I proposed here?
image

Copy link
Contributor

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@matt-fidd
Copy link
Contributor

@joel-jeremy is this ready for review?

Copy link
Contributor

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Oct 19, 2024
Copy link
Contributor

coderabbitai bot commented Oct 19, 2024

Walkthrough

The pull request introduces modifications to two components: Transaction.jsx and TransactionEdit.jsx. In Transaction.jsx, changes include conditional styling for the ListItem and TextOneLine components based on the transaction state, such as updating the color and font style when prettyDescription is empty. The default text for empty descriptions has been changed from 'Empty' to 'No payee', and the color for the SvgCheckCircle1 icon has been updated. In TransactionEdit.jsx, the getDescriptionPretty function now accounts for a new is_parent property, allowing for more accurate descriptions based on transaction types. The handling of invalid dates in the deserializeTransaction function has been refined, and the Footer component's button rendering logic has been enhanced to reflect transaction states. Additionally, updates to the ChildTransactionEdit component improve the editing experience for child transactions. Overall, the changes enhance the visual representation and user interaction related to transaction details.

Possibly related PRs

Suggested labels

sparkles: Merged

Suggested reviewers

  • youngcw

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (2)
packages/desktop-client/src/components/mobile/transactions/Transaction.jsx (2)

121-127: LGTM! Consider destructuring for improved readability.

The addition of conditional styling for the View component is a good enhancement. It allows for dynamic coloring based on the transaction's state, which aligns with the PR's objective of improving the mobile interface for split payees.

For improved readability, consider destructuring textStyle at the beginning of the component:

const { color: textStyleColor } = textStyle;

Then use it in the style object:

color: textStyleColor || theme.tableText,

This would make the code slightly more concise and easier to read.


143-151: LGTM! Consider optimizing the conditional styling.

The additional styling for empty or 'Split' descriptions enhances the visual clarity of the transaction list, addressing the concerns raised in the PR comments about the clarity of split transactions.

To optimize the code and reduce repetition, consider combining the conditions:

...(!isPreview && (prettyDescription === '' || prettyDescription === 'Split') && {
  color: theme.tableTextSubdued,
  fontStyle: 'italic',
}),

This change would make the code more concise and easier to maintain.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 803289e and c6f8056.

⛔ Files ignored due to path filters (4)
  • packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-individual-account-page-and-checks-that-filtering-is-working-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-individual-account-page-and-checks-that-filtering-is-working-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-individual-account-page-and-checks-that-filtering-is-working-3-chromium-linux.png is excluded by !**/*.png
  • upcoming-release-notes/2989.md is excluded by !**/*.md
📒 Files selected for processing (2)
  • packages/desktop-client/src/components/mobile/transactions/Transaction.jsx (3 hunks)
  • packages/desktop-client/src/components/mobile/transactions/TransactionEdit.jsx (1 hunks)
🧰 Additional context used
🔇 Additional comments (5)
packages/desktop-client/src/components/mobile/transactions/Transaction.jsx (3)

154-154: LGTM! Improved clarity for transactions without payees.

Changing the default text from 'Empty' to 'No payee' enhances the user's understanding of the transaction state. This modification aligns well with the PR's objective of improving the mobile interface.


Line range hint 1-233: Overall, the changes improve the mobile interface for transactions.

The modifications in this file enhance the visual representation of transactions, particularly for split transactions and those without payees. The changes address the concerns raised in the PR comments and contribute to a more intuitive and consistent user experience on mobile devices. The code quality is good, with only minor suggestions for optimization and verification.

Key improvements:

  1. Better visual distinction for empty and split transactions
  2. Clearer labeling for transactions without payees
  3. Improved color consistency with the overall theme

These changes align well with the PR objectives of enhancing the mobile interface for split payees.


183-183: LGTM! Verify color consistency across the app.

Changing the uncleared transaction icon color to theme.tableTextSubdued improves consistency within the table context. This subtle change enhances the overall visual cohesion of the interface.

To ensure consistency, let's verify the usage of theme.tableTextSubdued across the app:

This script will help us verify that the color change is consistent with other uses of theme.tableTextSubdued and that there are no remaining instances of pageTextSubdued in this file that should also be updated.

✅ Verification successful

Verification Successful: Color Consistency Maintained

The color change to theme.tableTextSubdued in Transaction.jsx has been correctly applied, and no instances of theme.pageTextSubdued remain in this file. The usage of theme.tableTextSubdued is consistent with its application throughout the app, ensuring visual cohesion.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check the usage of theme.tableTextSubdued across the app

# Search for theme.tableTextSubdued in all JavaScript and TypeScript files
echo "Occurrences of theme.tableTextSubdued:"
rg --type js --type ts 'theme\.tableTextSubdued' -C 2

# Compare with occurrences of theme.pageTextSubdued
echo "\nOccurrences of theme.pageTextSubdued:"
rg --type js --type ts 'theme\.pageTextSubdued' -C 2

# Check if there are any remaining occurrences of pageTextSubdued in this file
echo "\nRemaining occurrences of pageTextSubdued in Transaction.jsx:"
rg --type js 'pageTextSubdued' packages/desktop-client/src/components/mobile/transactions/Transaction.jsx

Length of output: 25479

packages/desktop-client/src/components/mobile/transactions/TransactionEdit.jsx (2)

72-76: LGTM!

The getDescriptionPretty function now correctly handles parent transactions by checking the is_parent property and returning 'Split' when applicable. This ensures split transactions are properly labeled in the UI.


Line range hint 228-245: LGTM!

The added conditional rendering in the Footer component displays a 'Select account' button when a transaction lacks an associated account. This improvement enhances user experience by prompting users to select an account before proceeding.

@github-actions github-actions bot removed the Stale label Oct 20, 2024
Copy link
Contributor

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Nov 20, 2024
Copy link
Contributor

This PR was closed because it has been stalled for 5 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants