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]: More functionalities #2472

Merged
merged 35 commits into from
Apr 4, 2024
Merged

[Mobile]: More functionalities #2472

merged 35 commits into from
Apr 4, 2024

Conversation

joel-jeremy
Copy link
Contributor

@joel-jeremy joel-jeremy commented Mar 17, 2024

Added for mobile:

  • Updated the balance tooltip to be a modal
  • Scheduled transaction action modals
    • Post transaction
    • Skip scheduled date
    • View schedule (not supported for now)
  • Budget summary action modals
    • Move to a category
    • Hold for next month
    • Reset hold buffer
  • Account action modals
    • Rename account
    • Close account
    • Reopen account

@trafico-bot trafico-bot bot added the 🚧 WIP label Mar 17, 2024
Copy link

netlify bot commented Mar 17, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 2ae6d8c
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/660f0e2ed5bc9a0008f76c10
😎 Deploy Preview https://deploy-preview-2472.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 17, 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
11 4.45 MB → 4.47 MB (+26.32 kB) +0.58%
Changeset
File Δ Size
src/components/modals/CloseAccountModal.tsx 🆕 +8.27 kB 0 B → 8.27 kB
src/components/modals/CategoryGroupMenuModal.tsx 🆕 +5.94 kB 0 B → 5.94 kB
src/components/modals/CategoryMenuModal.tsx 🆕 +4.97 kB 0 B → 4.97 kB
src/components/modals/AccountMenuModal.tsx 🆕 +4.96 kB 0 B → 4.96 kB
src/components/modals/TransferModal.tsx 🆕 +2.99 kB 0 B → 2.99 kB
src/components/modals/CoverModal.tsx 🆕 +2.4 kB 0 B → 2.4 kB
src/components/modals/SingleInputModal.tsx 🆕 +2.13 kB 0 B → 2.13 kB
src/components/modals/HoldBufferModal.tsx 🆕 +1.92 kB 0 B → 1.92 kB
src/components/modals/RolloverBudgetSummaryModal.tsx 🆕 +1.85 kB 0 B → 1.85 kB
src/components/modals/CategoryAutocompleteModal.tsx 🆕 +1.59 kB 0 B → 1.59 kB
src/components/modals/AccountAutocompleteModal.tsx 🆕 +1.56 kB 0 B → 1.56 kB
src/components/modals/ScheduledTransactionMenuModal.tsx 🆕 +1.31 kB 0 B → 1.31 kB
src/components/modals/PayeeAutocompleteModal.tsx 🆕 +1.22 kB 0 B → 1.22 kB
src/components/modals/ReportBudgetSummaryModal.tsx 🆕 +1.12 kB 0 B → 1.12 kB
src/components/modals/RolloverBalanceMenuModal.tsx 🆕 +743 B 0 B → 743 B
src/components/modals/RolloverToBudgetMenuModal.tsx 🆕 +737 B 0 B → 737 B
src/components/modals/ReportBalanceMenuModal.tsx 🆕 +689 B 0 B → 689 B
src/icons/v1/LockOpen.tsx 🆕 +466 B 0 B → 466 B
src/hooks/useInitialMount.ts 🆕 +166 B 0 B → 166 B
src/components/Modals.tsx 📈 +4 kB (+48.32%) 8.27 kB → 12.27 kB
src/components/mobile/accounts/AccountDetails.jsx 📈 +1.05 kB (+15.52%) 6.79 kB → 7.84 kB
src/components/mobile/accounts/Account.jsx 📈 +742 B (+12.18%) 5.95 kB → 6.67 kB
src/components/mobile/transactions/TransactionEdit.jsx 📈 +1.14 kB (+3.88%) 29.4 kB → 30.54 kB
src/components/budget/rollover/RolloverContext.tsx 📈 +24 B (+3.09%) 777 B → 801 B
src/components/mobile/budget/index.tsx 📈 +188 B (+2.25%) 8.14 kB → 8.33 kB
src/components/budget/index.tsx 📈 +134 B (+1.43%) 9.15 kB → 9.28 kB
src/components/budget/report/BalanceMenu.tsx 📈 +8 B (+1.38%) 579 B → 587 B
src/components/budget/rollover/budgetsummary/ToBudgetMenu.tsx 📈 +8 B (+1.03%) 778 B → 786 B
src/components/budget/rollover/BalanceMenu.tsx 📈 +8 B (+0.79%) 1011 B → 1019 B
node_modules/compute-scroll-into-view/dist/index.js 📈 +10 B (+0.37%) 2.63 kB → 2.64 kB
src/components/budget/rollover/BalanceTooltip.tsx 📈 +2 B (+0.11%) 1.71 kB → 1.71 kB
src/components/budget/report/ReportComponents.tsx 📈 +2 B (+0.02%) 11.17 kB → 11.17 kB
src/components/budget/rollover/RolloverComponents.tsx 📉 -2 B (-0.02%) 12.08 kB → 12.08 kB
src/components/budget/report/BalanceTooltip.tsx 📉 -2 B (-0.31%) 649 B → 647 B
src/components/budget/report/ReportContext.tsx 📉 -6 B (-1.20%) 499 B → 493 B
node_modules/react-is/index.js 📉 -2 B (-1.27%) 158 B → 156 B
src/components/mobile/budget/BudgetTable.jsx 📉 -575 B (-1.55%) 36.14 kB → 35.58 kB
node_modules/react-is/cjs/react-is.production.min.js 📉 -75 B (-2.68%) 2.73 kB → 2.66 kB
src/components/modals/EditField.jsx 📉 -3.1 kB (-27.46%) 11.3 kB → 8.2 kB
src/components/modals/CloseAccount.tsx 🔥 -6.74 kB (-100%) 6.74 kB → 0 B
src/components/modals/CategoryGroupMenu.tsx 🔥 -6.02 kB (-100%) 6.02 kB → 0 B
src/components/modals/CategoryMenu.tsx 🔥 -5.04 kB (-100%) 5.04 kB → 0 B
src/components/modals/SingleInput.tsx 🔥 -2.22 kB (-100%) 2.22 kB → 0 B
src/components/modals/ReportBudgetSummary.tsx 🔥 -1.11 kB (-100%) 1.11 kB → 0 B
src/components/modals/RolloverBudgetSummary.tsx 🔥 -1.08 kB (-100%) 1.08 kB → 0 B
View detailed bundle breakdown

Added

Asset File Size % Changed
static/js/BalanceWithCarryover.js 0 B → 1.43 kB (+1.43 kB) -

Removed

Asset File Size % Changed
static/js/BalanceTooltip.js 7.31 kB → 0 B (-7.31 kB) -100%

Bigger

Asset File Size % Changed
static/js/index.js 2.54 MB → 2.55 MB (+19.81 kB) +0.76%
static/js/wide.js 250.13 kB → 261.12 kB (+10.99 kB) +4.40%
static/js/narrow.js 215.48 kB → 216.88 kB (+1.4 kB) +0.65%

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/ButtonLink.js 379 B 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/AppliedFilters.js 20.35 kB 0%
static/js/import.js 105.26 kB 0%
static/js/ReportRouter.js 1.18 MB 0%

Copy link
Contributor

github-actions bot commented Mar 17, 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.2 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.2 MB 0%

@joel-jeremy joel-jeremy changed the title [WIP] Mobile: Balance modals [WIP] Mobile: More functionalities Mar 18, 2024
@joel-jeremy joel-jeremy changed the title [WIP] Mobile: More functionalities [Mobile]: More functionalities Mar 21, 2024
@youngcw youngcw added this to the v24.4.0 milestone Mar 21, 2024
@MatissJanis
Copy link
Member

This is a massive amount of LOC. I started reviewing, but quickly got lost. Any chance you could break this out in smaller PRs?

@joel-jeremy
Copy link
Contributor Author

This is a massive amount of LOC. I started reviewing, but quickly got lost. Any chance you could break this out in smaller PRs?

Sorry for the big PR. I had some extra time so I tried doing as much as I can before I get a bit busy again. Any tips how to break this down into smaller chunks?

For some of the changes, I have:

  • Extracted some Menu components used in desktop e.g. BalanceMenu, ToBudgetMenu to their own files so that they can be reused in mobile.
  • Made some changes to the Autocomplete component to fix the typecheck errors that I was encountering.
  • Extracted category/payee/account autocomplete modals from EditField to their own files/components

@@ -281,17 +335,22 @@ export function Modals() {

case 'rollover-budget-summary':
return (
<RolloverBudgetSummary
<NamespaceContext.Provider
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to think about how to remove the need to wrap modal components with this in order for useSheetValue to work. By default, there is no namespace context for any of our modals.

@MatissJanis
Copy link
Member

This is a massive amount of LOC. I started reviewing, but quickly got lost. Any chance you could break this out in smaller PRs?

Sorry for the big PR. I had some extra time so I tried doing as much as I can before I get a bit busy again. Any tips how to break this down into smaller chunks?

For some of the changes, I have:

  • Extracted some Menu components used in desktop e.g. BalanceMenu, ToBudgetMenu to their own files so that they can be reused in mobile.
  • Made some changes to the Autocomplete component to fix the typecheck errors that I was encountering.
  • Extracted category/payee/account autocomplete modals from EditField to their own files/components

This list is a great starting point for the breaking-up into smaller chunks. Especially the bigger changes such as file/component moves (with no logic changes) could be extracted to separate PRs for a big drop in LOC here.

@joel-jeremy
Copy link
Contributor Author

@MatissJanis I've split the autocomplete changes here: #2500

@@ -0,0 +1,44 @@
import React, { type ComponentPropsWithoutRef } from 'react';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was extracted from the BalanceTooltip component

@@ -0,0 +1,67 @@
import React, { type ComponentPropsWithoutRef } from 'react';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was extracted from the BalanceTooltip component

function CreatePayeeIcon(props) {
return <SvgAdd {...props} width={14} height={14} />;
}
import { AccountAutocompleteModal } from './AccountAutocompleteModal';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved the autocomplete components here to their own files sot they can be reused.

@@ -0,0 +1,53 @@
import React, { type ComponentPropsWithoutRef } from 'react';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was extracted from the ToBudget component

@@ -0,0 +1,92 @@
import React, { type ComponentPropsWithoutRef } from 'react';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was extracted from the ToBudget component

@joel-jeremy
Copy link
Contributor Author

Split menu components here: #2511

@joel-jeremy
Copy link
Contributor Author

@MatissJanis This should now be ready for review :) Most related refactors have been merged to master.

Copy link
Member

@MatissJanis MatissJanis left a comment

Choose a reason for hiding this comment

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

Overall LGTM. Left a few comments. Let me know what you think.

@@ -166,6 +166,7 @@ type AccountItemProps = {
embedded?: boolean;
};

// eslint-disable-next-line import/no-unused-modules
Copy link
Member

Choose a reason for hiding this comment

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

❓ question: ‏what's the plan with this? Do you plan on using it in the near future? If not - we can remove the export statement (which should solve the eslint issue).

Same question for the other files.

Comment on lines 444 to 445
return db.insertPayee({ name });
const id = await db.insertPayee({ name });
return id;
Copy link
Member

Choose a reason for hiding this comment

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

🥜 nitpick: ‏unnecessary change

authors: [joel-jeremy]
---

Mobile menu modals.
Copy link
Member

Choose a reason for hiding this comment

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

💬 suggestion: ‏a longer description would be better. There are folks that actually read the changelog :)

@@ -0,0 +1,220 @@
// @ts-strict-ignore
Copy link
Member

Choose a reason for hiding this comment

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

💬 suggestion: ‏anything we could do here? Ideally new files should be strict-mode compliant from the get-go.


const category = categories.find(c => c.id === categoryId);

if (category == null) {
Copy link
Member

Choose a reason for hiding this comment

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

🥜 nitpick:

Suggested change
if (category == null) {
if (category === null) {

@joel-jeremy joel-jeremy merged commit 6f251e6 into master Apr 4, 2024
19 checks passed
@joel-jeremy joel-jeremy deleted the mobile-menu-modal branch April 4, 2024 20:53
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved labels Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants