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

:electron: Move file settings to the file management area #3584

Merged

Conversation

MikesGlitch
Copy link
Contributor

This is step 1 to resolving this issue: #3371

  • Added settings modal into file management page and moved the Change data dir functionality in
  • Provided an option to automatically move budget files as a part of changing data dir
  • Silently restart electron server when Actuals data dir is changed and refreshes data, preventing the need for a hard restart.
  • Adding info about Electrons backups (telling users that it exists or how often it runs)

Step 2 is to allow configuration before creating a budget (will tackle that in a follow up PR).

Changing the data directory

test3

Settings page (if electron):

image

Tested on:

  • Windows
  • Linux
  • Mac

@MikesGlitch MikesGlitch changed the title Electron/file management settings :electron: Move file settings to the file management area Oct 6, 2024
Copy link

netlify bot commented Oct 6, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 39e68c7
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/6704138de192ba0008197f76
😎 Deploy Preview https://deploy-preview-3584.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.

@MikesGlitch MikesGlitch marked this pull request as ready for review October 6, 2024 13:06
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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 82113f7 and eb80512.

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

15-18: Imports are correctly utilized

The imports for isElectron and isNonProductionEnvironment are appropriately added and used within the code, enhancing environment-specific functionality.


32-32: SvgCog icon imported successfully

The SvgCog icon is imported from '../../icons/v1' and is ready for use in the SettingsButton component.


374-384: Verify support for the 'gap' style property

The gap style property is used within a flex container. Ensure that the styling solution and target browsers support the gap property for flex layouts to maintain consistent spacing between elements.

To confirm compatibility, you can check browser support for the gap property in flexbox layouts.


463-463: onOpenSettings prop connected correctly

The onOpenSettings prop is properly passed to BudgetListHeader, and it dispatches the 'files-settings' modal as intended.

youngcw
youngcw previously approved these changes Oct 6, 2024
Copy link
Member

@youngcw youngcw left a comment

Choose a reason for hiding this comment

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

Looks 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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between eb80512 and 11f9b09.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • packages/desktop-electron/index.ts (2 hunks)
  • packages/desktop-electron/package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/desktop-electron/package.json
🧰 Additional context used
🔇 Additional comments (2)
packages/desktop-electron/index.ts (2)

19-19: LGTM: Correct import of fs-extra functions

The import statement correctly imports the necessary functions (copy, exists, remove) from the fs-extra library, which are used in the new 'move-budget-directory' IPC handler.


Line range hint 1-435: Summary of changes and recommendations

The main change in this file is the addition of a new IPC handler 'move-budget-directory' for moving budget directories. The implementation is generally good, but some improvements have been suggested to enhance robustness and safety.

Key points:

  1. The necessary fs-extra functions are correctly imported.
  2. The new IPC handler performs basic validation and error handling.
  3. Suggestions have been made to improve error checking, prevent unintended data loss, and implement a rollback mechanism.

Overall, the changes align with the PR objectives of integrating file management functionality. Once the suggested improvements are implemented, this part of the PR should be ready for approval.

packages/desktop-electron/index.ts Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Oct 7, 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.31 MB (+12.89 kB) +0.24%
Changeset
File Δ Size
src/components/modals/manager/ConfirmChangeDocumentDir.tsx 🆕 +6.83 kB 0 B → 6.83 kB
src/components/modals/manager/FilesSettingsModal.tsx 🆕 +6 kB 0 B → 6 kB
src/components/settings/Backups.tsx 🆕 +1.13 kB 0 B → 1.13 kB
src/components/manager/BudgetList.tsx 📈 +912 B (+8.54%) 10.43 kB → 11.32 kB
src/components/Modals.tsx 📈 +370 B (+2.41%) 14.99 kB → 15.35 kB
src/browser-preload.browser.js 📈 +36 B (+0.90%) 3.93 kB → 3.96 kB
src/components/settings/index.tsx 📉 -7 B (-0.11%) 6.06 kB → 6.05 kB
src/components/settings/Global.tsx 🔥 -2.36 kB (-100%) 2.36 kB → 0 B
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 3.32 MB → 3.33 MB (+13.6 kB) +0.40%

Smaller

Asset File Size % Changed
static/js/wide.js 225.26 kB → 224.55 kB (-727 B) -0.32%

Unchanged

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

Copy link
Contributor

github-actions bot commented Oct 7, 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 → 1.19 MB (+62 B) +0.00%
Changeset
File Δ Size
packages/loot-core/src/server/main.ts 📈 +126 B (+0.20%) 61.37 kB → 61.5 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
kcab.worker.js 1.19 MB → 1.19 MB (+62 B) +0.00%

Smaller

No assets were smaller

Unchanged

No assets were unchanged

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