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

add buttons for combined-account transaction pages on mobile #3734

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

gabeklavans
Copy link

@gabeklavans gabeklavans commented Oct 25, 2024

I quickly threw together the actual styling of these buttons. I'm very much open to changing it up, but just wanted to start the functionality here.

I was pleasantly surprised to see that the combined accounts pages that work on desktop also seem to work fine on mobile. This just adds a way to navigate to those URLs on mobile.

resolves #2333

@actual-github-bot actual-github-bot bot changed the title add buttons for combined-account transaction pages [WIP] add buttons for combined-account transaction pages Oct 25, 2024
Copy link

netlify bot commented Oct 25, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 1498ae9
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/6728405b706b9c00089b6232
😎 Deploy Preview https://deploy-preview-3734.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 Oct 25, 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
10 5.34 MB → 5.34 MB (+649 B) +0.01%
Changeset
File Δ Size
src/components/mobile/accounts/Accounts.jsx 📈 +649 B (+8.87%) 7.15 kB → 7.78 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/narrow.js 82.57 kB → 83.2 kB (+649 B) +0.77%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/workbox-window.prod.es5.js 5.69 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/AppliedFilters.js 21.3 kB 0%
static/js/usePreviewTransactions.js 1.64 kB 0%
static/js/wide.js 238.83 kB 0%
static/js/ReportRouter.js 1.5 MB 0%
static/js/index.js 3.34 MB 0%

Copy link
Contributor

github-actions bot commented Oct 25, 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.27 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.27 MB 0%

gabeklavans added a commit to gabeklavans/actual that referenced this pull request Oct 25, 2024
gabeklavans added a commit to gabeklavans/actual that referenced this pull request Oct 25, 2024
@gabeklavans

This comment was marked as resolved.

@gabeklavans gabeklavans changed the title [WIP] add buttons for combined-account transaction pages [WIP] add buttons for combined-account transaction pages on mobile Oct 25, 2024
gabeklavans added a commit to gabeklavans/actual that referenced this pull request Oct 27, 2024
@gabeklavans gabeklavans changed the title [WIP] add buttons for combined-account transaction pages on mobile add buttons for combined-account transaction pages on mobile Oct 27, 2024
Copy link
Contributor

coderabbitai bot commented Oct 27, 2024

Walkthrough

The pull request introduces several modifications to the Accounts.jsx component in the mobile application. Key changes include an update to the AccountHeader function, which now accepts an id parameter to facilitate navigation to specific account details. The component has transitioned from using a View to a Button for improved interactivity, allowing users to trigger navigation through button presses. Additionally, the styling of the AccountHeader has been refined, with adjustments made to align items and update text styles. The AccountList function has been modified to utilize the new id parameter for both budgeted and off-budget accounts. A new divider has been added between these account types to enhance visual separation, and the margin for the off-budget AccountHeader has been adjusted from 30 to 20. Overall, these changes focus on enhancing user interaction and improving the visual organization of account listings.

Assessment against linked issues

Objective Addressed Explanation
Combined list of transactions across accounts on mobile (#2333) The PR does not implement the feature to view transactions across all accounts.

Possibly related PRs

Suggested labels

:sparkles: Merged

Suggested reviewers

  • joel-jeremy
  • youngcw

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between f6a5fc5 and 1498ae9.

⛔ Files ignored due to path filters (4)
  • packages/desktop-client/e2e/accounts.mobile.test.js-snapshots/Mobile-Accounts-opens-the-accounts-page-and-asserts-on-balances-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.mobile.test.js-snapshots/Mobile-Accounts-opens-the-accounts-page-and-asserts-on-balances-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/accounts.mobile.test.js-snapshots/Mobile-Accounts-opens-the-accounts-page-and-asserts-on-balances-3-chromium-linux.png is excluded by !**/*.png
  • upcoming-release-notes/3734.md is excluded by !**/*.md
📒 Files selected for processing (1)
  • packages/desktop-client/src/components/mobile/accounts/Accounts.jsx (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/desktop-client/src/components/mobile/accounts/Accounts.jsx

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/accounts/Accounts.jsx (2)

Line range hint 23-53: LGTM! Consider adding accessibility labels.

The transformation from View to Button with navigation functionality aligns well with the PR objectives. The styling is consistent with mobile patterns.

Consider adding an accessibilityLabel prop to the Button for better screen reader support:

 <Button
   onPress={() => navigate(`/accounts/${id}`)}
+  accessibilityLabel={`View transactions for ${name}`}
   style={{
     flex: 1,

209-220: Consider using View component instead of div for consistency.

While the divider implementation is good, using a div element seems inconsistent with the rest of the codebase which uses the View component.

Consider this change for better consistency:

-            <div
+            <View
               style={{
                 width: '100%',
                 height: 2,
                 background: theme.pageText,
                 paddingLeft: 10,
                 paddingRight: 10,
                 marginTop: 20,
               }}
-            />
+            />
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between f265dd9 and 34c8971.

⛔ Files ignored due to path filters (1)
  • upcoming-release-notes/3734.md is excluded by !**/*.md
📒 Files selected for processing (1)
  • packages/desktop-client/src/components/mobile/accounts/Accounts.jsx (4 hunks)
🧰 Additional context used
📓 Learnings (1)
packages/desktop-client/src/components/mobile/accounts/Accounts.jsx (1)
Learnt from: joel-jeremy
PR: actualbudget/actual#3685
File: packages/desktop-client/src/components/accounts/Account.tsx:655-665
Timestamp: 2024-10-24T17:05:41.415Z
Learning: The Account component in 'packages/desktop-client/src/components/accounts/Account.tsx' is being rewritten in a separate PR.
🔇 Additional comments (3)
packages/desktop-client/src/components/mobile/accounts/Accounts.jsx (3)

190-194: LGTM! Clear implementation of combined budgeted accounts view.

The implementation provides a clear entry point to view all budgeted account transactions, which directly addresses the feature request from issue #2333.


224-227: LGTM! Consistent implementation for off-budget accounts view.

The implementation maintains consistency with the budgeted accounts section while providing clear navigation to combined off-budget transactions.


Line range hint 23-227: Verify navigation paths for combined account views.

The implementation looks solid overall and addresses the requirements from issue #2333. Let's verify the navigation paths to ensure consistency.

✅ Verification successful

Navigation implementation for combined account views is consistent

The verification shows that:

  • The navigation pattern in Accounts.jsx aligns with existing account navigation patterns in other components
  • Route handling for budgeted/offbudget accounts is properly defined in the sidebar component
  • The AccountHeader component is consistently used across both mobile and desktop account views
  • The implementation maintains compatibility with existing account-related components and test files

The changes successfully implement the combined account view navigation without introducing inconsistencies or regressions in the navigation paths.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify navigation paths and route handlers for combined account views

# Test: Check for any other components that might need similar navigation updates
rg -l "navigate\(\'/accounts/" --type jsx

# Test: Verify consistent route handling across the application
rg -l "\/accounts\/(budgeted|offbudget)" --type jsx

Length of output: 298


Script:

#!/bin/bash
# Let's fix the regex syntax and try again

# Check for navigation patterns to accounts
rg -l "navigate\('/accounts" --type jsx

# Check for route handlers with combined account paths
rg -l "/accounts/(budgeted|offbudget)" --type jsx

# Look for other potential route definitions
rg -l "path.*accounts" --type jsx

# Check for any AccountHeader usage
rg -l "AccountHeader" --type jsx

Length of output: 277


Script:

#!/bin/bash
# Search without file type restriction since jsx type isn't recognized

# Check for navigation patterns to accounts
rg -l "navigate\\('/accounts"

# Check for route handlers with combined account paths
rg -l "/accounts/(budgeted|offbudget)"

# Look for other potential route definitions
rg -l "path.*accounts"

# Check for any AccountHeader usage
rg -l "AccountHeader"

# Find all potential account-related components
fd -e jsx -e js | grep -i "account"

Length of output: 1595

@gabeklavans
Copy link
Author

Assessment against linked issues

Objective Addressed Explanation
Combined list of transactions across accounts on mobile (#2333) ❌ The PR does not implement the feature to view transactions across all accounts.

Fair. I can try adding another button on top of all the current ones for All Accounts, using the same header component for consistency.

@joel-jeremy
Copy link
Contributor

Thanks for this! I can verify that the functionality if good but the UI definitely needs some work. How about making the For Budget and Off Budget buttons more like headers and just put a cheveron to indicate that they are clickable?

gabeklavans added a commit to gabeklavans/actual that referenced this pull request Oct 29, 2024
@gabeklavans
Copy link
Author

gabeklavans commented Oct 29, 2024

How about making the For Budget and Off Budget buttons more like headers and just put a cheveron to indicate that they are clickable?

Yup, I like the sound of that. How's this next iteration I just pushed look?

Also, I may forgo adding the "All Accounts" view for this PR. It seems to be quite a bit more work to get right compared to the small change I'm making here, but this PR already solves the issue like 90% of the way for me, if that makes sense.

gabeklavans added a commit to gabeklavans/actual that referenced this pull request Oct 29, 2024
@youngcw
Copy link
Member

youngcw commented Oct 29, 2024

I think this style with the chevrons looks really good.

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/accounts/Accounts.jsx (2)

23-62: Good implementation of interactive headers with visual indicators.

The conversion to Button component and addition of chevron icon successfully implements the reviewer's suggestions and improves mobile UX.

However, here are some suggested improvements:

  1. Add ARIA label for better accessibility:
 <Button
   variant="bare"
+  aria-label={`View ${name} transactions`}
   onPress={() => navigate(`/accounts/${id}`)}
   style={{
  1. Consider adding hover/active states for better interaction feedback:
 <Button
   variant="bare"
   onPress={() => navigate(`/accounts/${id}`)}
   style={{
     flex: 1,
     flexDirection: 'row',
     marginTop: 10,
     padding: 0,
     color: theme.pageTextLight,
     width: '100%',
+    ':hover': {
+      backgroundColor: theme.hover
+    },
+    ':active': {
+      backgroundColor: theme.buttonBackgroundActive
+    },
     ...style,
   }}
 >

199-203: Current implementation provides a good foundation for mobile account navigation.

The addition of combined views for budgeted and off-budget accounts improves mobile navigation. However, to fully address issue #2333, consider these future enhancements:

  1. Add an "All Accounts" view as discussed in the PR comments
  2. Consider adding a loading state for the navigation transitions

For the "All Accounts" view, you could add it as:

<AccountHeader
  id="all"
  name="All Accounts"
  amount={getOnBudgetBalance() + getOffBudgetBalance()}
  style={{ marginBottom: 20 }}
/>

Also applies to: 220-224

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 34c8971 and 6869ef0.

⛔ Files ignored due to path filters (1)
  • upcoming-release-notes/3734.md is excluded by !**/*.md
📒 Files selected for processing (1)
  • packages/desktop-client/src/components/mobile/accounts/Accounts.jsx (4 hunks)
🧰 Additional context used
📓 Learnings (1)
packages/desktop-client/src/components/mobile/accounts/Accounts.jsx (1)
Learnt from: joel-jeremy
PR: actualbudget/actual#3685
File: packages/desktop-client/src/components/accounts/Account.tsx:655-665
Timestamp: 2024-10-24T17:05:41.415Z
Learning: The Account component in 'packages/desktop-client/src/components/accounts/Account.tsx' is being rewritten in a separate PR.
🔇 Additional comments (2)
packages/desktop-client/src/components/mobile/accounts/Accounts.jsx (2)

11-11: LGTM: Import addition aligns with UI requirements.

The addition of SvgCheveronRight import supports the reviewer's suggestion to add visual indicators for clickable headers.


27-57: Investigate visual regression test failures.

The Button component and chevron icon additions could affect layout in ways that trigger visual regression tests. Let's verify the impact:

@Teprifer
Copy link

I agree, looks good.

@joel-jeremy
Copy link
Contributor

joel-jeremy commented Oct 29, 2024

Looking better! Just one more thing, I think the new buttons could use some padding so that the touch target is larger.

Also you need to update the VRT screenshots. Please see https://github.com/actualbudget/actual/tree/master/packages/desktop-client#visual-regression

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 (1)
packages/desktop-client/src/components/mobile/accounts/Accounts.jsx (1)

27-42: Consider increasing touch target size for better mobile accessibility.

The current padding (7px top/bottom) might be insufficient for comfortable touch interaction on mobile devices. Apple's Human Interface Guidelines recommend a minimum touch target size of 44x44 points.

 <Button
   variant="bare"
   aria-label={`View ${name} transactions`}
   onPress={() => navigate(`/accounts/${id}`)}
   style={{
     flex: 1,
     flexDirection: 'row',
-    paddingTop: 7,
-    paddingBottom: 7,
+    paddingTop: 12,
+    paddingBottom: 12,
     paddingLeft: 0,
     paddingRight: 0,
     color: theme.pageTextLight,
     width: '100%',
     ...style,
   }}
 >
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 6869ef0 and 0741271.

📒 Files selected for processing (1)
  • packages/desktop-client/src/components/mobile/accounts/Accounts.jsx (4 hunks)
🧰 Additional context used
📓 Learnings (1)
packages/desktop-client/src/components/mobile/accounts/Accounts.jsx (1)
Learnt from: joel-jeremy
PR: actualbudget/actual#3685
File: packages/desktop-client/src/components/accounts/Account.tsx:655-665
Timestamp: 2024-10-24T17:05:41.415Z
Learning: The Account component in 'packages/desktop-client/src/components/accounts/Account.tsx' is being rewritten in a separate PR.
🔇 Additional comments (2)
packages/desktop-client/src/components/mobile/accounts/Accounts.jsx (2)

23-65: Update visual regression test screenshots.

The UI changes (new chevron icon, button styling, and section margins) will require updates to the visual regression test screenshots. This aligns with the VRT discrepancies mentioned in the PR comments.

#!/bin/bash
# Description: Check for existing visual regression tests

# Test: Look for VRT screenshot references
rg -l "accounts.*\.(png|jpg|jpeg)" --glob '!{node_modules,build,dist}/**'

202-206: Consider adding "All Accounts" view as discussed.

Based on the PR objectives and issue #2333, an "All Accounts" view was considered to show combined transactions. While the current implementation adds navigation for budgeted and off-budget accounts, it might be worth implementing the "All Accounts" view in a follow-up PR.

Let's verify the route handling for these new navigation targets:

Also applies to: 223-226

gabeklavans added a commit to gabeklavans/actual that referenced this pull request Oct 29, 2024
@gabeklavans
Copy link
Author

The current padding (7px top/bottom) might be insufficient for comfortable touch interaction on mobile devices. Apple's Human Interface Guidelines recommend a minimum touch target size of 44x44 points.

 <Button
   variant="bare"
   aria-label={`View ${name} transactions`}
   onPress={() => navigate(`/accounts/${id}`)}
   style={{
     flex: 1,
     flexDirection: 'row',
-    paddingTop: 7,
-    paddingBottom: 7,
+    paddingTop: 12,
+    paddingBottom: 12,
     paddingLeft: 0,
     paddingRight: 0,
     color: theme.pageTextLight,
     width: '100%',
     ...style,
   }}
 >

I tried it with larger padding and it just looks kinda weird with so much space.

@joel-jeremy
Copy link
Contributor

The current padding (7px top/bottom) might be insufficient for comfortable touch interaction on mobile devices. Apple's Human Interface Guidelines recommend a minimum touch target size of 44x44 points.

 <Button
   variant="bare"
   aria-label={`View ${name} transactions`}
   onPress={() => navigate(`/accounts/${id}`)}
   style={{
     flex: 1,
     flexDirection: 'row',
-    paddingTop: 7,
-    paddingBottom: 7,
+    paddingTop: 12,
+    paddingBottom: 12,
     paddingLeft: 0,
     paddingRight: 0,
     color: theme.pageTextLight,
     width: '100%',
     ...style,
   }}
 >

I tried it with larger padding and it just looks kinda weird with so much space.

I find it still a bit too small. Can we make it similar size and padding as the other account buttons, but keeping the current background?

gabeklavans added a commit to gabeklavans/actual that referenced this pull request Nov 4, 2024
@gabeklavans
Copy link
Author

I find it still a bit too small. Can we make it similar size and padding as the other account buttons, but keeping the current background?

How's this iteration look? Also just to note, even before this iteration, these buttons I think were still larger than the ones on the budget mobile page for tapping on each category to open their notes/options.

@joel-jeremy
Copy link
Contributor

I find it still a bit too small. Can we make it similar size and padding as the other account buttons, but keeping the current background?

How's this iteration look? Also just to note, even before this iteration, these buttons I think were still larger than the ones on the budget mobile page for tapping on each category to open their notes/options.

Looking good! One last comment: can we change the header buttons to a normal variant so that it also has the bounce effect when clicked (similar to the other account buttons) but remove the press highlight?

@gabeklavans
Copy link
Author

gabeklavans commented Nov 24, 2024

Looking good! One last comment: can we change the header buttons to a normal variant so that it also has the bounce effect when clicked (similar to the other account buttons) but remove the press highlight?

Sorry for the delay, just getting back to this.

So, if we're making it a normal variant again (how it was when I first opened the PR), is there a need for the chevron anymore? Since it will be pretty clear that this is a button and is clickable.

If there isn't a need, how do you think we should differentiate this button from the rest? A different colored border, perhaps? A different text color? Different height for the button?

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.

Combined list of transactions across accounts on mobile
4 participants