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

[Mobile] Fix budget list on mobile auto selecting a budget file under the Switch budget file menu #3574

Merged
merged 2 commits into from
Oct 5, 2024

Conversation

joel-jeremy
Copy link
Contributor

@joel-jeremy joel-jeremy commented Oct 5, 2024

Resolves #3564 #3563

Fix is to use Button instead of a View on the budget list

@actual-github-bot actual-github-bot bot changed the title [Mobile] Fix budget list on mobile [WIP] [Mobile] Fix budget list on mobile Oct 5, 2024
Copy link
Contributor

coderabbitai bot commented Oct 5, 2024

Walkthrough

The pull request introduces modifications to the BudgetList.tsx component, focusing on the FileMenu and FileItem components. The FileMenu has been simplified by removing conditional styling, while the FileItem now uses a Button instead of a View for user interaction. The onClick event has been updated to onPress, and the layout has been streamlined. These changes aim to enhance usability and maintainability by reducing complexity and improving interaction.

Changes

File Path Change Summary
packages/desktop-client/src/components/manager/BudgetList.tsx Simplified FileMenu by removing conditional styling; replaced View with Button in FileItem; updated event from onClick to onPress; adjusted layout for title and state display.

Possibly related PRs

  • fix modals on mobile BudgetTable #3487: Changes in BudgetTable.jsx involve modifications to the interaction behavior of components, which may relate to the user interaction improvements made in BudgetList.tsx.
  • Mobile VRTs #3506: Updates in budget.mobile.test.js include tests for interactive elements like the budget menu, relevant to the changes in BudgetList.tsx.

Suggested labels

sparkles: Merged

Suggested reviewers

  • MatissJanis

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

netlify bot commented Oct 5, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 358da2d
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/6700bbba11e3af00089458b9
😎 Deploy Preview https://deploy-preview-3574.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] [Mobile] Fix budget list on mobile [Mobile] Fix budget list on mobile auto selecting a budget file under the Switch budget file menu Oct 5, 2024
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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between a28fb93 and 6daa444.

📒 Files selected for processing (1)
  • packages/desktop-client/src/components/manager/BudgetList.tsx (2 hunks)
🔇 Additional comments (4)
packages/desktop-client/src/components/manager/BudgetList.tsx (4)

Line range hint 1-516: Summary of changes and follow-up points

The modifications to the BudgetList.tsx file primarily focus on improving the structure and accessibility of the FileItem component. The changes appear to enhance user interaction and align with best practices for cross-platform React components.

Key points for follow-up:

  1. Verify that the removal of isNarrowWidth conditional styling doesn't negatively impact mobile appearance.
  2. Ensure styling consistency across different devices and screen sizes, particularly for the new Button component in FileItem.
  3. Review the tooltip functionality for the file description, especially on mobile devices, and consider implementing a mobile-friendly alternative.
  4. Clarify the purpose and implications of quickSwitchMode, ensuring that essential functionality is not lost when it's active.

These changes generally improve the component, but thorough testing on various devices and in different modes (quick switch and normal) is recommended to ensure a consistent and accessible user experience across all platforms.


237-239: Clarify the implications of quickSwitchMode.

The FileMenuButton is now conditionally rendered based on quickSwitchMode. While this might simplify the interface in certain contexts, it's important to ensure that essential functionality is not lost.

Please provide clarification on the following:

  1. What is the purpose of quickSwitchMode and when is it activated?
  2. Are there any important actions in the FileMenuButton that users might need access to even in quick switch mode?
  3. Is there an alternative way for users to access these actions when in quick switch mode?

To help understand the usage of quickSwitchMode, run the following script:

#!/bin/bash
# Description: Check for quickSwitchMode usage across the codebase
rg 'quickSwitchMode' packages/desktop-client/src/

This will help identify other components or files that might be affected by this conditional rendering.


189-242: LGTM! Improved FileItem component structure and accessibility.

The changes to the FileItem component enhance accessibility and user interaction by:

  1. Replacing the View with a Button for the main clickable area.
  2. Changing onClick to onPress, which is more appropriate for cross-platform React components.
  3. Adjusting the layout to consolidate the title and state display.

These modifications align with best practices for interactive elements and may improve the overall visual structure.

To ensure styling consistency across different devices and screen sizes, please run the following script to check for any hardcoded pixel values that might affect responsiveness:

#!/bin/bash
# Description: Check for hardcoded pixel values in styling
rg '\d+px' packages/desktop-client/src/components/manager/BudgetList.tsx

Also, verify that the button styling is consistent with other buttons in the application, especially on mobile devices.


208-215: Verify tooltip functionality for mobile users.

The title attribute has been moved to the parent View component. While this change aligns with the new layout structure, it might affect the tooltip behavior, especially on mobile devices where tooltips are not as easily accessible.

Please verify the following:

  1. The tooltip functionality works as expected on desktop browsers.
  2. Consider implementing a mobile-friendly alternative for displaying the file description, such as a long-press action or an info icon that triggers a modal.

Run the following script to check for other uses of the title attribute in this file, which might need similar consideration:

#!/bin/bash
# Description: Check for title attribute usage
rg 'title=' packages/desktop-client/src/components/manager/BudgetList.tsx

items={items}
/>
);
return <Menu onMenuSelect={onMenuSelect} items={items} />;
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Issue Found: isNarrowWidth is still used in BudgetList.tsx and other parts of the codebase.

The isNarrowWidth variable remains in BudgetList.tsx and is extensively used across multiple components. This suggests that the intended removal was not fully implemented, which may affect the application's mobile usability and responsiveness.

🔗 Analysis chain

LGTM! Simplified FileMenu component.

The FileMenu component has been streamlined, improving readability and maintainability. The removal of conditional styling suggests that mobile-specific styling is handled elsewhere or no longer necessary.

Please verify that this change doesn't negatively impact the appearance or functionality on mobile devices. Run the following script to check for any remaining isNarrowWidth usage in this file:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for remaining isNarrowWidth usage
rg 'isNarrowWidth' packages/desktop-client/src/components/manager/BudgetList.tsx

Length of output: 1912


Script:

#!/bin/bash
# Description: Check for remaining isNarrowWidth usage in BudgetList.tsx
rg 'isNarrowWidth' packages/desktop-client/src/components/manager/BudgetList.tsx

Length of output: 167


Script:

#!/bin/bash
# Description: Check for any usage of isNarrowWidth across the entire codebase
rg 'isNarrowWidth' packages/desktop-client/src/

Length of output: 15348

Copy link
Contributor

github-actions bot commented Oct 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 5.3 MB → 5.3 MB (-860 B) -0.02%
Changeset
File Δ Size
src/components/transactions/TransactionsTable.jsx 📉 -500 B (-0.76%) 63.83 kB → 63.34 kB
src/components/manager/BudgetList.tsx 📉 -202 B (-1.86%) 10.62 kB → 10.43 kB
src/components/common/Button2.tsx 📉 -158 B (-3.01%) 5.12 kB → 4.97 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

Asset File Size % Changed
static/js/wide.js 225.75 kB → 225.26 kB (-500 B) -0.22%
static/js/index.js 3.32 MB → 3.32 MB (-360 B) -0.01%

Unchanged

Asset File Size % Changed
static/js/usePreviewTransactions.js 1.64 kB 0%
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/AppliedFilters.js 20.96 kB 0%
static/js/narrow.js 82.55 kB 0%
static/js/ReportRouter.js 1.5 MB 0%

Copy link
Contributor

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

@MatissJanis MatissJanis added this to the v24.10.1 milestone Oct 5, 2024
@joel-jeremy joel-jeremy merged commit 33a7524 into master Oct 5, 2024
19 checks passed
@joel-jeremy joel-jeremy deleted the mobile-fix-budget-list branch October 5, 2024 15:31
MatissJanis pushed a commit that referenced this pull request Oct 7, 2024
… the Switch budget file menu (#3574)

* Fix budget list on mobile

* Releast notes
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.

[Bug]: Mobile: Cant delete files because file gets selected
3 participants