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

Adding a help modal for quick reference to goal template syntax #3691

Merged

Conversation

deathblade666
Copy link
Contributor

This adds a new help menu item to serve as a quick reference for goal template syntax. It includes a few examples for the official docs that should cover a fair number of use cases as well as a link to the official docs.

@actual-github-bot actual-github-bot bot changed the title Adding a help modal for quick reference to goal template syntax [WIP] Adding a help modal for quick reference to goal template syntax Oct 19, 2024
Copy link

netlify bot commented Oct 19, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit f51a12f
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/6716bf273090490008490c64
😎 Deploy Preview https://deploy-preview-3691.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 19, 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.31 MB → 5.32 MB (+12.2 kB) +0.22%
Changeset
File Δ Size
src/components/modals/GoalTemplateModal.tsx 🆕 +11.72 kB 0 B → 11.72 kB
src/components/HelpMenu.tsx 📈 +352 B (+13.60%) 2.53 kB → 2.87 kB
src/components/Modals.tsx 📈 +130 B (+0.83%) 15.26 kB → 15.39 kB
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 (+12.2 kB) +0.36%

Smaller

No assets were smaller

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 21.3 kB 0%
static/js/narrow.js 82.57 kB 0%
static/js/wide.js 232.12 kB 0%
static/js/ReportRouter.js 1.51 MB 0%

Copy link
Contributor

github-actions bot commented Oct 19, 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%

@youngcw
Copy link
Member

youngcw commented Oct 19, 2024

Looks pretty good. Just need to show the option only if templates are enabled.

fyi, if you run yarn lint --fix the lint will be happy

@deathblade666
Copy link
Contributor Author

Looks pretty good. Just need to show the option only if templates are enabled.

fyi, if you run yarn lint --fix the lint will be happy

Thanks, lint is fixed, looking into showing it conditionally.

@deathblade666 deathblade666 changed the title [WIP] Adding a help modal for quick reference to goal template syntax Adding a help modal for quick reference to goal template syntax Oct 20, 2024
Copy link
Contributor

coderabbitai bot commented Oct 20, 2024

Walkthrough

The pull request introduces several enhancements to the HelpMenu and Modals components within the desktop client. In HelpMenu.tsx, a new import for useFeatureFlag is added to conditionally render a menu item for "goal templates." The HelpMenuItem type is updated to include this new option, and the handleItemSelect function is modified to handle the selection of this item. The menu items are displayed based on the feature flag and the current page context.

In Modals.tsx, a new modal component, GoalTemplateModal, is introduced to manage the display of goal templates. The modal is rendered conditionally based on the presence of a budgetId. Additionally, a new file GoalTemplateModal.tsx is created, defining the modal's structure and content, which includes various budgeting templates and links to further documentation. Lastly, the FinanceModals type definition is updated to include the new modal type, ensuring its recognition within the application.

Possibly related PRs

Suggested labels

:sparkles: Merged

Suggested reviewers

  • youngcw

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 334ba9a and ba8d86c.

📒 Files selected for processing (1)
  • packages/desktop-client/src/components/modals/GoalTemplateModal.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/desktop-client/src/components/modals/GoalTemplateModal.tsx

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: 2

🧹 Outside diff range and nitpick comments (4)
packages/desktop-client/src/components/HelpMenu.tsx (2)

70-70: LGTM: New feature flag for goal templates

The showGoalTemplates constant is correctly implemented using the useFeatureFlag hook. This aligns with the PR objectives of conditionally displaying the goal templates help option.

Consider adding a brief comment explaining the purpose of this feature flag for better code readability:

// Feature flag to conditionally render the goal templates help option
const showGoalTemplates = useFeatureFlag('goalTemplatesEnabled');

116-118: LGTM: Updated Menu items array

The Menu items array has been correctly updated to conditionally include the goal templates menu item. The implementation is clean and efficient, using the spread operator and correctly applying the feature flag and page condition.

For improved readability, consider extracting the condition into a separate constant:

const showGoalTemplatesMenuItem = showGoalTemplates && page === '/budget';

items={[
  // ... other items
  ...(showGoalTemplatesMenuItem
    ? [{ name: 'goal-templates', text: t('Goal templates') }]
    : []),
]}

This change would make the condition more explicit and easier to understand at a glance.

packages/desktop-client/src/components/modals/GoalTemplateModal.tsx (1)

7-15: LGTM: Component structure is well-organized.

The GoalTemplateModal component is structured effectively, using a functional component and the render prop pattern for the modal. This approach provides good encapsulation and flexibility.

Consider extracting the modal content into a separate component to improve readability and maintainability, especially if the content grows larger in the future. For example:

const GoalTemplateContent = () => (
  <View style={{ flexDirection: 'row', fontSize: 13 }}>
    {/* ... existing content ... */}
  </View>
);

export function GoalTemplateModal() {
  return (
    <Modal name="goal-templates">
      {({ state: { close } }) => (
        <>
          <ModalHeader
            title="Goal Templates"
            rightContent={<ModalCloseButton onPress={close} />}
          />
          <GoalTemplateContent />
        </>
      )}
    </Modal>
  );
}

Also applies to: 84-88

packages/desktop-client/src/components/Modals.tsx (1)

87-89: LGTM: Implementation of 'goal-templates' case

The implementation of the 'goal-templates' case is correct and consistent with other modal renderings. The conditional rendering based on budgetId is a good practice to ensure the modal is only shown when a budget is open.

For improved readability, consider using an early return:

 case 'goal-templates':
-  return budgetId ? <GoalTemplateModal key={name} /> : null;
+  if (!budgetId) return null;
+  return <GoalTemplateModal key={name} />;

This change would make the code slightly more readable and consistent with the 'keyboard-shortcuts' case implementation.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 03f2cab and 5e462fa.

⛔ Files ignored due to path filters (1)
  • upcoming-release-notes/3691.md is excluded by !**/*.md
📒 Files selected for processing (4)
  • packages/desktop-client/src/components/HelpMenu.tsx (5 hunks)
  • packages/desktop-client/src/components/Modals.tsx (2 hunks)
  • packages/desktop-client/src/components/modals/GoalTemplateModal.tsx (1 hunks)
  • packages/loot-core/src/client/state-types/modals.d.ts (1 hunks)
🧰 Additional context used
🔇 Additional comments (10)
packages/desktop-client/src/components/HelpMenu.tsx (4)

11-11: LGTM: New import for useFeatureFlag

The import statement for useFeatureFlag is correctly placed and aligns with the new feature flag functionality being introduced.


20-20: LGTM: Updated HelpMenuItem type

The HelpMenuItem type has been correctly updated to include 'goal-templates', ensuring type safety for the new menu item.


86-88: LGTM: Updated handleItemSelect function

The handleItemSelect function has been correctly updated to include the new 'goal-templates' case. The implementation is consistent with other menu items and correctly dispatches the pushModal action.


Line range hint 1-124: Overall assessment: Well-implemented feature addition

The changes to the HelpMenu component successfully introduce the new goal templates help option. The implementation is consistent with the existing codebase and correctly uses feature flags and page context to conditionally render the new menu item. The code is well-structured and type-safe.

Key points:

  1. New import and type definition added correctly.
  2. Feature flag implemented for conditional rendering.
  3. handleItemSelect function updated to handle the new menu item.
  4. Menu items array updated with conditional logic for the new item.

The changes align well with the PR objectives and enhance the user experience by providing quick access to goal template syntax help. The minor suggestions provided in the review comments can further improve code readability and maintainability.

packages/desktop-client/src/components/modals/GoalTemplateModal.tsx (2)

1-5: LGTM: Imports are appropriate and concise.

The imports are well-organized and all seem to be utilized within the component. Good job on keeping the dependencies minimal and relevant.


1-88: Overall assessment: Well-implemented component with room for enhancement.

The GoalTemplateModal component is a valuable addition to the application, providing users with quick access to goal template syntax examples. The structure is clean, and the content is informative.

Key strengths:

  1. Clear organization of different template types.
  2. Concise examples that align with the documentation.
  3. Inclusion of a link to further documentation.

Suggested improvements:

  1. Enhance accessibility with semantic HTML and ARIA attributes.
  2. Prepare for internationalization by extracting text content.
  3. Improve the external link's security and user experience.
  4. Consider breaking down the component for better maintainability.

These enhancements will further improve the component's quality and usability. Great work on implementing this helpful feature!

packages/loot-core/src/client/state-types/modals.d.ts (2)

289-289: Consider additional updates for the new modal type.

While the addition of the 'goal-templates' modal type is straightforward and non-disruptive, consider the following:

  1. Ensure that any components or functions that handle modal rendering or management (e.g., a modal manager or router) are updated to recognize and handle this new modal type.
  2. Update relevant documentation, such as API docs or developer guides, to include information about this new modal option.

To help identify areas that might need updating, run the following command:

#!/bin/bash
# Find potential areas in the codebase that handle modal types
rg "ModalType|FinanceModals" --type ts

289-289: New modal type added for goal templates.

The addition of the 'goal-templates' modal type as an EmptyObject is consistent with the PR objectives. It's correctly placed within the FinanceModals type and follows the existing pattern for modals that don't require additional properties.

To ensure this change doesn't introduce any conflicts, let's verify its uniqueness:

✅ Verification successful

'goal-templates' modal type is uniquely and correctly defined.

No conflicts found in the codebase. The 'goal-templates' modal type is properly integrated into relevant components.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify that 'goal-templates' is not defined elsewhere in the codebase
rg "'goal-templates':" --type ts

Length of output: 1793


Script:

#!/bin/bash
# Verify that 'goal-templates' is not defined elsewhere in the codebase
rg "'goal-templates':" --type ts

Length of output: 289

packages/desktop-client/src/components/Modals.tsx (2)

38-38: LGTM: Import statement for GoalTemplateModal

The import statement for GoalTemplateModal is correctly placed and follows the existing pattern for importing modal components.


38-38: Verify the implementation of GoalTemplateModal

The changes to support the new 'goal-templates' modal are well-integrated. To ensure completeness, please verify that the GoalTemplateModal component exists and is implemented correctly in the ./modals/GoalTemplateModal file.

Run the following script to check for the existence and basic structure of the GoalTemplateModal component:

Also applies to: 87-89

✅ Verification successful

GoalTemplateModal Implementation Verified

The GoalTemplateModal component exists and is implemented correctly in packages/desktop-client/src/components/modals/GoalTemplateModal.tsx.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence and basic structure of GoalTemplateModal

# Check if the file exists
if [ ! -f "packages/desktop-client/src/components/modals/GoalTemplateModal.tsx" ]; then
  echo "Error: GoalTemplateModal.tsx file not found"
  exit 1
fi

# Check for the component definition
if ! grep -q "export function GoalTemplateModal" "packages/desktop-client/src/components/modals/GoalTemplateModal.tsx"; then
  echo "Error: GoalTemplateModal component not found in the file"
  exit 1
fi

echo "GoalTemplateModal component exists and has a basic structure"

# Display the component for manual review
echo "Component content:"
cat "packages/desktop-client/src/components/modals/GoalTemplateModal.tsx"

Length of output: 3786

@MikesGlitch
Copy link
Contributor

MikesGlitch commented Oct 20, 2024

I think this is great! I'm finding the formatting a little hard to read, what do you think about making it a table? It may visually seperate the elements a bit better. E.g.

Weekly

Template Description
$10 repeat every week starting 2025-01-03 Budget $10 a week
$10 repeat every week starting 2025-01-03 up to 80 Budget $10 a week, up to a maximum of $80

Monthly

Template Description
$50 Budget $50 each month
Up to $150 Budget up to $150 each month, and remove extra funds over $150
Up to $150 hold Budget up to $150 each month, but retain any funds over $150

Longer Term

Template Description
$500 by 2025-03 repeat every 6 months Break down large, less-frequent expenses into manageable monthly expenses
$500 by 2025-03 repeat every year Break down large, less-frequent expenses into manageable monthly expenses
$500 by 2025-03 repeat every 2 years Break down large, less-frequent expenses into manageable monthly expenses

Schedules

Template Description
Schedule SCHEDULE_NAME Fund upcoming scheduled transactions over time
Schedule full SCHEDULE_NAME Fund upcoming scheduled transaction only on needed month

Goals

Template Description
Goal 1000 Set a long term goal instead of a monthly goal

I also hard to lean forward to read the text here, can we make it a bit bigger?

image

@deathblade666
Copy link
Contributor Author

I think this is great! I'm finding the formatting a little hard to read, what do you think about making it a table? It may visually seperate the elements a bit better. E.g.

Weekly

Template Description
$10 repeat every week starting 2025-01-03 Budget $10 a week
$10 repeat every week starting 2025-01-03 up to 80 Budget $10 a week, up to a maximum of $80

Monthly

Template Description
$50 Budget $50 each month
Up to $150 Budget up to $150 each month, and remove extra funds over $150
Up to $150 hold Budget up to $150 each month, but retain any funds over $150

Longer Term

Template Description
$500 by 2025-03 repeat every 6 months Break down large, less-frequent expenses into manageable monthly expenses
$500 by 2025-03 repeat every year Break down large, less-frequent expenses into manageable monthly expenses
$500 by 2025-03 repeat every 2 years Break down large, less-frequent expenses into manageable monthly expenses

Schedules

Template Description
Schedule SCHEDULE_NAME Fund upcoming scheduled transactions over time
Schedule full SCHEDULE_NAME Fund upcoming scheduled transaction only on needed month

Goals

Template Description
Goal 1000 Set a long term goal instead of a monthly goal

I also hard to lean forward to read the text here, can we make it a bit bigger?

image

That's fair, I can take a look at making it a table. for the "see more here" bit I copied what is in use for the create local account modal. but i do agree its a bit small here, not sure if it appears smaller due to context or modal size or if it may need to be adjusted on the create account modal as well. but I'll change it here and let you guys decide if it needs to be revisited on the other modal

@deathblade666
Copy link
Contributor Author

something like this? with the way the tables renders it feels a bit busy to me.
image

@deathblade666
Copy link
Contributor Author

maybe without the borders. Does this still make it easier to read?
image

@MikesGlitch
Copy link
Contributor

MikesGlitch commented Oct 20, 2024

We have components for tables - with styling it would look more like:

image

You can find examples in ManagePayees.tsx, SelectLinkedAccountsModal.jsx etc.

It's just a thought, I'm sure others will weigh in on the UI.

@MikesGlitch MikesGlitch self-assigned this Oct 20, 2024
…ge headers to use react-aria-component headings
@deathblade666
Copy link
Contributor Author

We have components for tables - with styling it would look more like:

image

You can find examples in ManagePayees.tsx, SelectLinkedAccountsModal.jsx etc.

It's just a thought, I'm sure others will weigh in on the UI.

So I figured out how to do the stylized table, I am however getting this error fro some reason i cant figure out. everything seems to work though.

Error

Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes<HTMLDivElement>, "children" | "value"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.
  Type '{ name: string; width: string; }' is not assignable to type 'string'.ts(2322)

Line that's erroring

<TableHeader
              headers={[
                { name: 'Syntax', width: 'flex' },
                { name: 'Description', width: 'flex' },
              ]}
            />

@MikesGlitch
Copy link
Contributor

MikesGlitch commented Oct 20, 2024

Line that's erroring

That code looks fine to me. You could try restarting your editor in case it's confused or push up your code so I can take a better look.

@deathblade666
Copy link
Contributor Author

Line that's erroring

That code looks fine to me. You could try restarting your editor in case it's confused or push up your code so I can take a better look.

Pushed, looks like the type check is pulling the same error

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: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c37200f and e74258f.

📒 Files selected for processing (1)
  • packages/desktop-client/src/components/modals/GoalTemplateModal.tsx (1 hunks)
🧰 Additional context used
🪛 GitHub Check: typecheck
packages/desktop-client/src/components/modals/GoalTemplateModal.tsx

[failure] 25-25:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 26-26:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 49-49:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 50-50:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 73-73:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 74-74:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 111-111:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 112-112:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 135-135:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 136-136:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.

🔇 Additional comments (3)
packages/desktop-client/src/components/modals/GoalTemplateModal.tsx (3)

1-14: LGTM: Imports and component structure

The imports and overall structure of the GoalTemplateModal component are well-organized. The use of useTranslation for internationalization is a good practice, addressing the requirement mentioned in previous comments.


46-144: LGTM: Consistent structure and comprehensive examples

The structure and content of the "Monthly", "Longer Term", "Schedules", and "Goals" sections are well-organized and consistent. The examples provided cover a wide range of use cases, which aligns well with the PR objectives of providing a quick reference for goal template syntax.

Note: The type error for the TableHeader component persists in each section. Please apply the fix suggested in the previous comment to all instances of TableHeader in this file.

🧰 Tools
🪛 GitHub Check: typecheck

[failure] 49-49:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 50-50:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 73-73:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 74-74:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 111-111:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 112-112:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 135-135:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 136-136:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


1-170: Overall implementation looks good with minor improvements needed

The GoalTemplateModal component is well-implemented and aligns with the PR objectives. Here's a summary of the strengths and areas for improvement:

Strengths:

  1. Consistent use of internationalization throughout the component.
  2. Well-structured content providing comprehensive examples of goal templates.
  3. Use of appropriate React and accessibility components.

Areas for improvement:

  1. Resolve the type errors for the TableHeader component as suggested in the earlier comment.
  2. Enhance the external link implementation for better accessibility and security.

Once these minor issues are addressed, the component will be ready for integration into the application.

🧰 Tools
🪛 GitHub Check: typecheck

[failure] 25-25:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 26-26:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 49-49:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 50-50:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 73-73:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 74-74:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 111-111:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 112-112:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 135-135:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.


[failure] 136-136:
Type '{ name: string; width: string; }' is not assignable to type 'string & Omit<Omit<ViewProps, "ref"> & RefAttributes, "value" | "children"> & { formatter?: (value: string, type?: unknown) => string | Element; ... 10 more ...; privacyFilter?: boolean | PrivacyFilterProps; }'.

@youngcw
Copy link
Member

youngcw commented Oct 21, 2024

Could the "longer-term" section be renamed to "multi month" that way there isn't as much verbiage crossover between that and the "goal" type?

Copy link
Contributor

@MikesGlitch MikesGlitch left a comment

Choose a reason for hiding this comment

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

I think it's cleaner now, but the modal's looking quite big.

What do people thing about removing the current Headings in favor of table headings to save some space?

e.g.
image

I think it's still clear what's what from looking at the Table. I'm open to other ideas

Can we shorten this text:

Break down large, less-frequent expenses into manageable monthly expenses

To:

Break down less-frequent expenses into monthly expenses

I don't think it takes away too much and if users want more description they can go to the docs.

@deathblade666
Copy link
Contributor Author

I like it, cleans things up nicely. I'll make those changes unless anyone has any objections

Copy link
Contributor

@MikesGlitch MikesGlitch left a comment

Choose a reason for hiding this comment

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

My last nit: can you add a bit more space here?

image

Copy link
Contributor

@MikesGlitch MikesGlitch left a comment

Choose a reason for hiding this comment

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

Thanks for helping with this!

LGTM

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.

3 participants