-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Update Electron help menu to reflect new in-app menu #3699
Update Electron help menu to reflect new in-app menu #3699
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey 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
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey 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
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
152a4fe
to
6165879
Compare
WalkthroughThe pull request includes several changes across multiple files, primarily focusing on the Possibly related PRs
Suggested labels
Suggested reviewers
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Outside diff range and nitpick comments (1)
packages/desktop-client/src/components/HelpMenu.tsx (1)
57-57
: Approve changes in HelpMenu component with a minor suggestionThe modifications to the
HelpMenu
component significantly simplify its logic and align well with the PR objectives:
- Removing the
getPageDocs
function and related pathname-based logic reduces complexity.- Using
dispatch(openDocsForCurrentPage())
centralizes the documentation opening logic.These changes improve maintainability and consistency with the rest of the application.
For improved readability, consider extracting the
dispatch
call to a separate function:const openDocs = () => dispatch(openDocsForCurrentPage()); // Then in handleItemSelect: case 'docs': openDocs(); break;This minor refactoring would enhance the function's clarity and make it easier to add any potential pre- or post-processing steps in the future.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
upcoming-release-notes/3699.md
is excluded by!**/*.md
📒 Files selected for processing (5)
- packages/desktop-client/src/components/HelpMenu.tsx (2 hunks)
- packages/desktop-client/src/components/Titlebar.tsx (2 hunks)
- packages/desktop-client/src/util/router-tools.ts (0 hunks)
- packages/desktop-electron/menu.ts (2 hunks)
- packages/loot-core/src/client/actions/app.ts (1 hunks)
💤 Files with no reviewable changes (1)
- packages/desktop-client/src/util/router-tools.ts
🧰 Additional context used
📓 Learnings (1)
packages/desktop-client/src/components/HelpMenu.tsx (1)
Learnt from: jfdoming PR: actualbudget/actual#3648 File: packages/desktop-client/src/components/HelpMenu.tsx:48-66 Timestamp: 2024-10-13T00:54:56.185Z Learning: In `HelpMenu.tsx`, when implementing the `getPageDocs` function, prefer using a switch statement over an object map to allow for more flexibility with custom logic, such as handling pages under `/accounts`.
🔇 Additional comments (6)
packages/loot-core/src/client/actions/app.ts (1)
55-80
: Summary: Good progress on centralizing documentation accessThe changes in this file align well with the PR objectives of updating the help menu. By introducing
getPageDocs
andopenDocsForCurrentPage
, you've centralized the handling of documentation URLs, which should make it easier to maintain and update these links in the future.This refactoring aligns with the broader changes mentioned in the PR summary, moving away from direct URL handling in components like
HelpMenu.tsx
to a more centralized approach using Redux actions.While the implementation is generally good, consider the suggestions in the previous comments to further improve type safety, error handling, and compatibility with different routing setups.
packages/desktop-client/src/components/HelpMenu.tsx (3)
8-8
: Approve changes in importsThe modifications to the imports reflect a positive shift towards centralized documentation handling:
- Adding
openDocsForCurrentPage
from 'loot-core/client/actions' indicates a move towards using a Redux action for opening documentation.- Removing
useLocation
andopenUrl
imports suggests that the component no longer needs to handle URL determination and navigation directly.These changes align well with the goal of simplifying the documentation access process and centralizing it through Redux actions.
Line range hint
1-100
: Addressing previous learning aboutgetPageDocs
A previous learning suggested using a switch statement for the
getPageDocs
function. However, this learning is no longer applicable to the current implementation:
- The
getPageDocs
function has been removed entirely.- The new implementation uses a centralized Redux action (
openDocsForCurrentPage
) to handle documentation access.This change represents a significant improvement in the code structure, moving away from direct URL handling to a more maintainable and centralized approach. The current implementation aligns better with Redux patterns and simplifies the component's logic.
Line range hint
1-100
: Summary of changes in HelpMenu.tsxThe modifications to
HelpMenu.tsx
significantly improve the component's structure and align well with the PR objectives:
- Simplification: Removal of
getPageDocs
and related pathname-based logic reduces complexity.- Centralization: Introduction of
openDocsForCurrentPage
action centralizes documentation access.- Consistency: Changes align better with Redux patterns and improve overall code maintainability.
These changes contribute positively to the project by streamlining the help menu functionality and improving code quality. The new implementation should make future maintenance and extensions easier.
packages/desktop-client/src/components/Titlebar.tsx (2)
10-13
: LGTM: Import changes align with PR objectives.The addition of the
isElectron
import from the shared environment module is consistent with the PR's goal of updating Electron-specific functionality. This change enables the component to differentiate between Electron and non-Electron environments, which is crucial for the menu updates.
346-346
: Verify user experience in Electron environments.The conditional rendering of the
HelpMenu
component based on!isElectron()
aligns with the PR objectives. This change ensures that the help menu is only displayed in non-Electron environments, which is likely intended to avoid duplication with the native Electron menu.However, it's important to verify that:
- The native Electron menu provides equivalent functionality to the
HelpMenu
component.- Users in Electron environments still have easy access to help resources.
To ensure that help functionality is still accessible in Electron environments, please run the following verification:
This will help confirm that help-related items are properly configured in the Electron menu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Modifies the Electron menu items to match the web app