[PR #5939] [MERGED] ✨ Feature: Formula card and Formula for rules #48041

Closed
opened 2026-04-26 09:59:00 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/5939
Author: @lelemm
Created: 10/16/2025
Status: ✅ Merged
Merged: 10/22/2025
Merged by: @lelemm

Base: master ← Head: feat/formula-editor


📝 Commits (6)

  • 3351410 Formula card and Formula rules
  • a91def8 [autofix.ci] apply automated fixes
  • 6afa370 File move fix
  • 3484be2 [autofix.ci] apply automated fixes
  • 1a08348 Update packages/desktop-client/src/components/formula/codeMirror-excelLanguage.tsx
  • 752c01b code rabbit wrong commit suggestion fix

📊 Changes

35 files changed (+5103 additions, -36 deletions)

View changed files

📝 packages/desktop-client/index.html (+8 -0)
📝 packages/desktop-client/package.json (+8 -0)
📝 packages/desktop-client/src/components/accounts/Account.tsx (+20 -0)
➕ packages/desktop-client/src/components/formula/FormulaEditor.tsx (+102 -0)
➕ packages/desktop-client/src/components/formula/QueryManager.tsx (+860 -0)
➕ packages/desktop-client/src/components/formula/codeMirror-excelLanguage.tsx (+686 -0)
➕ packages/desktop-client/src/components/formula/queryModeFunctions.ts (+775 -0)
➕ packages/desktop-client/src/components/formula/transactionModeFunctions.ts (+498 -0)
➕ packages/desktop-client/src/components/reports/FormulaResult.tsx (+167 -0)
📝 packages/desktop-client/src/components/reports/Overview.tsx (+20 -0)
📝 packages/desktop-client/src/components/reports/ReportRouter.tsx (+3 -0)
➕ packages/desktop-client/src/components/reports/reports/Formula.tsx (+437 -0)
➕ packages/desktop-client/src/components/reports/reports/FormulaCard.tsx (+138 -0)
📝 packages/desktop-client/src/components/rules/ActionExpression.tsx (+6 -1)
➕ packages/desktop-client/src/components/rules/FormulaActionEditor.tsx (+54 -0)
📝 packages/desktop-client/src/components/rules/RuleEditor.tsx (+128 -28)
📝 packages/desktop-client/src/components/settings/Experimental.tsx (+7 -1)
📝 packages/desktop-client/src/components/transactions/TransactionList.tsx (+16 -1)
📝 packages/desktop-client/src/components/util/GenericInput.jsx (+5 -0)
📝 packages/desktop-client/src/hooks/useFeatureFlag.ts (+1 -0)

...and 15 more files

📄 Description

Added excel-like formulas to a new card and excel formulas to rules:

  • Enable the new feature flag:
    image

Formula card:

  • On reports, a new dashboard type will show:
    image

  • Open the new card to show the editor:
    image

    • Query Definitions is where you are going to define the queries to fetch data. You will use it later in the formula

    • Formula uses excel functions (in english)

      • Press ctrl+space for suggestions:
        image
    • You can use dynamic font size (like the summary card), o set a specific font size:
      image

    • You can create conditional expression to color the number
      image

This will paint the number as green for my example:

image

Formula Rules

  • You will see a new icon for fields that support formula (numeric and text fields. ID fields doesn't work)
    image

  • Clicking on it will enable the formula editor:
    image

  • The suggestion popover shows some variables related to this context
    image

  • Create the rule using the formulas and test it using the Apply actions to a single record:
    image

  • After saving it, you will see it in the rules:
    image


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/5939 **Author:** [@lelemm](https://github.com/lelemm) **Created:** 10/16/2025 **Status:** ✅ Merged **Merged:** 10/22/2025 **Merged by:** [@lelemm](https://github.com/lelemm) **Base:** `master` ← **Head:** `feat/formula-editor` --- ### 📝 Commits (6) - [`3351410`](https://github.com/actualbudget/actual/commit/3351410be3aa25b8255f6672275ec0899af4a35e) Formula card and Formula rules - [`a91def8`](https://github.com/actualbudget/actual/commit/a91def8323e73c4f994d0d242b8c61f7af55df61) [autofix.ci] apply automated fixes - [`6afa370`](https://github.com/actualbudget/actual/commit/6afa370246433116bc4a588a7bc5a0335d83b903) File move fix - [`3484be2`](https://github.com/actualbudget/actual/commit/3484be2d8972a574c88d73bc164a00e50884d1ec) [autofix.ci] apply automated fixes - [`1a08348`](https://github.com/actualbudget/actual/commit/1a0834850bb811d4de5fa92ce4117a203be705f5) Update packages/desktop-client/src/components/formula/codeMirror-excelLanguage.tsx - [`752c01b`](https://github.com/actualbudget/actual/commit/752c01b6b9cfd68ab14947f80555dfebc273a291) code rabbit wrong commit suggestion fix ### 📊 Changes **35 files changed** (+5103 additions, -36 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/index.html` (+8 -0) 📝 `packages/desktop-client/package.json` (+8 -0) 📝 `packages/desktop-client/src/components/accounts/Account.tsx` (+20 -0) ➕ `packages/desktop-client/src/components/formula/FormulaEditor.tsx` (+102 -0) ➕ `packages/desktop-client/src/components/formula/QueryManager.tsx` (+860 -0) ➕ `packages/desktop-client/src/components/formula/codeMirror-excelLanguage.tsx` (+686 -0) ➕ `packages/desktop-client/src/components/formula/queryModeFunctions.ts` (+775 -0) ➕ `packages/desktop-client/src/components/formula/transactionModeFunctions.ts` (+498 -0) ➕ `packages/desktop-client/src/components/reports/FormulaResult.tsx` (+167 -0) 📝 `packages/desktop-client/src/components/reports/Overview.tsx` (+20 -0) 📝 `packages/desktop-client/src/components/reports/ReportRouter.tsx` (+3 -0) ➕ `packages/desktop-client/src/components/reports/reports/Formula.tsx` (+437 -0) ➕ `packages/desktop-client/src/components/reports/reports/FormulaCard.tsx` (+138 -0) 📝 `packages/desktop-client/src/components/rules/ActionExpression.tsx` (+6 -1) ➕ `packages/desktop-client/src/components/rules/FormulaActionEditor.tsx` (+54 -0) 📝 `packages/desktop-client/src/components/rules/RuleEditor.tsx` (+128 -28) 📝 `packages/desktop-client/src/components/settings/Experimental.tsx` (+7 -1) 📝 `packages/desktop-client/src/components/transactions/TransactionList.tsx` (+16 -1) 📝 `packages/desktop-client/src/components/util/GenericInput.jsx` (+5 -0) 📝 `packages/desktop-client/src/hooks/useFeatureFlag.ts` (+1 -0) _...and 15 more files_ </details> ### 📄 Description Added excel-like formulas to a new card and excel formulas to rules: - Enable the new feature flag: <img width="548" height="252" alt="image" src="https://github.com/user-attachments/assets/fd23ea03-795a-4ae8-aea8-c5d9786a3218" /> # Formula card: - On reports, a new dashboard type will show: <img width="232" height="347" alt="image" src="https://github.com/user-attachments/assets/f066026e-526a-4576-983e-5302a726059c" /> - Open the new card to show the editor: <img width="1428" height="874" alt="image" src="https://github.com/user-attachments/assets/a697d4fc-af18-40cd-850a-b4522b0822a4" /> - Query Definitions is where you are going to define the queries to fetch data. You will use it later in the formula - Formula uses excel functions (in english) - Press ctrl+space for suggestions: <img width="606" height="170" alt="image" src="https://github.com/user-attachments/assets/ab42afe4-21c0-4fff-a5c6-a114c9cc2178" /> - You can use dynamic font size (like the summary card), o set a specific font size: <img width="198" height="143" alt="image" src="https://github.com/user-attachments/assets/4b7a97a7-f511-4faf-b99e-7e1b232e02ea" /> - You can create conditional expression to color the number <img width="1060" height="95" alt="image" src="https://github.com/user-attachments/assets/fff52c04-2b10-4b64-9ad2-429284b2e018" /> This will paint the number as green for my example: <img width="611" height="177" alt="image" src="https://github.com/user-attachments/assets/ebbb14aa-d5ef-488b-aaeb-5394d0ebcd19" /> # Formula Rules - You will see a new icon for fields that support formula (numeric and text fields. ID fields doesn't work) <img width="888" height="148" alt="image" src="https://github.com/user-attachments/assets/d5313e6e-50c6-4805-9b3d-667bc1505d59" /> - Clicking on it will enable the formula editor: <img width="872" height="103" alt="image" src="https://github.com/user-attachments/assets/23bc0207-7ba6-4a43-81e6-f2397eacb0aa" /> - The suggestion popover shows some variables related to this context <img width="892" height="268" alt="image" src="https://github.com/user-attachments/assets/88b3e83b-9d17-4c19-a330-573092443950" /> - Create the rule using the formulas and test it using the Apply actions to a single record: <img width="885" height="124" alt="image" src="https://github.com/user-attachments/assets/67695220-6ec7-4f2b-988d-a1a60596f7e9" /> - After saving it, you will see it in the rules: <img width="490" height="63" alt="image" src="https://github.com/user-attachments/assets/b8b34f5a-30b3-406c-bdd9-259e1c2d72e9" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-26 09:59:01 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#48041