[PR #6628] [WIP]: Add flag to transaction #6638

Closed
opened 2026-02-28 21:30:57 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/actualbudget/actual/pull/6628

State: closed
Merged: No


Summary

Closes #1898.

This PR adds a flag column to transactions.

Details

Actual users emigrating from YNAB often ask for this feature. Here's how YNAB describes them:

Flags

Flags are customizable color-coded markers for transactions, acting like digital sticky notes to track specific statuses like pending reimbursements, tax-deductible expenses, items needing review, or subscriptions, helping you organize spending, identify important transactions quickly, and gain insights into habits.

Prior to coming to Actual, I used flags in much the same way. Flags are incredibly useful for short-term tasks. For example, if I am balancing my budget and the total doesn't match what my statement says, I can go line-by-line through the statement and mark off transactions that are reflected in my Actual account. This helped me numerous times in YNAB to track down doubled expenses, typos in amounts, errors in entering income vs expense, etc. I know others use flags for their custom workflows as well.

I believe (and I think others do too, based on conversations on issues and Discord) that flags fill a need that is different from tags. Tags are useful as long-lived organizing and classification. You can create multiple tags on a transaction to slice and dice it multiple ways. Flags are simpler in that you only have one flag per transaction. But that simplicity is also its own kind of power. Flags are more visual than tags, communicate information visually rather than text, and are easy to add or remove without having to jump into the notes field. Additionally, emojis are more powerful that YNAB flags because YNAB limited users to one of a few colors. Emojis provide more customization and more personalization.

This PR creates the initial framework for flags. In this PR, a user can add zero or one flags to a transaction, using an emoji selector. Right now, the only supported emojis are those in the @emoji-mart/data library. However, that library supports custom emojis. I could see this being a powerful feature in Actual to create budgeting-specific emojis to further empower users.

Basic Design

  • A transaction has zero or one emojis
  • Child/split transactions do not have emojis (for now at least)
  • Emojis are stored in the database as their short-code (e.g. :100: for 💯 ). This allows for future support of custom emojis inside Actual that do not map into unicode characters, for example, emojis that are budget-based, category-based, etc.
  • Anywhere a transaction is supported, the flag field is supported

The emoji popover uses a search bar to search for emojis, and keyboard navigation is supported.

Flag demo

Out Of Scope

The goal of this first implementation is to get the basic flag logic implemented in the UI and in the database. I didn't want to do everything in one PR as it would cause the size of the PR to be much larger than it is now.

Once this PR is accepted, I plan to submit PR's in the near future that:

  • Enable bulk editing flags
  • Enable filtering/matching by flags
  • Rule/Schedule flag support
  • Mobile support

Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 28 14.46 MB → 14.97 MB (+518.37 kB) +3.50%
loot-core 1 5.84 MB → 6.3 MB (+468.38 kB) +7.83%
api 1 4.38 MB → 4.84 MB (+468.19 kB) +10.44%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
28 14.46 MB → 14.97 MB (+518.37 kB) +3.50%
Changeset
File Δ Size
node_modules/@emoji-mart/data/sets/15/native.json 🆕 +467.11 kB 0 B → 467.11 kB
src/components/select/EmojiSelect.tsx 🆕 +43.65 kB 0 B → 43.65 kB
home/runner/work/actual/actual/packages/loot-core/src/shared/emoji.ts 🆕 +1.01 kB 0 B → 1.01 kB
home/runner/work/actual/actual/packages/component-library/src/icons/v1/Flag.tsx 🆕 +805 B 0 B → 805 B
src/components/transactions/SimpleTransactionsTable.tsx 📈 +1.35 kB (+14.80%) 9.13 kB → 10.48 kB
src/components/transactions/TransactionsTable.tsx 📈 +4.3 kB (+5.01%) 85.88 kB → 90.18 kB
src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx 📈 +173 B (+0.60%) 28.32 kB → 28.49 kB
src/components/select/DateSelect.tsx 📈 +4 B (+0.02%) 16.52 kB → 16.53 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 9.22 MB → 9.73 MB (+518.37 kB) +5.49%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 12.94 kB 0%
static/js/workbox-window.prod.es5.js 5.64 kB 0%
static/js/da.js 106.62 kB 0%
static/js/de.js 177.78 kB 0%
static/js/en-GB.js 7.18 kB 0%
static/js/en.js 162.91 kB 0%
static/js/es.js 171.21 kB 0%
static/js/fr.js 179.72 kB 0%
static/js/it.js 171.54 kB 0%
static/js/nb-NO.js 157.23 kB 0%
static/js/nl.js 103.82 kB 0%
static/js/pl.js 88.64 kB 0%
static/js/pt-BR.js 146.35 kB 0%
static/js/ru.js 106.97 kB 0%
static/js/sv.js 78.2 kB 0%
static/js/th.js 182.35 kB 0%
static/js/uk.js 215.11 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 120.54 kB 0%
static/js/ReportRouter.js 1.11 MB 0%
static/js/narrow.js 641.19 kB 0%
static/js/TransactionList.js 105.97 kB 0%
static/js/wide.js 160.07 kB 0%
static/js/AppliedFilters.js 9.71 kB 0%
static/js/usePayeeRuleCounts.js 11.79 kB 0%
static/js/useTransactionBatchActions.js 13.23 kB 0%
static/js/FormulaEditor.js 1.04 MB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.84 MB → 6.3 MB (+468.38 kB) +7.83%
Changeset
File Δ Size
node_modules/@emoji-mart/data/sets/15/native.json 🆕 +467.12 kB 0 B → 467.12 kB
home/runner/work/actual/actual/packages/loot-core/src/shared/emoji.ts 🆕 +1.01 kB 0 B → 1.01 kB
home/runner/work/actual/actual/packages/loot-core/src/server/transactions/export/export-to-csv.ts 📈 +146 B (+4.59%) 3.11 kB → 3.25 kB
home/runner/work/actual/actual/packages/loot-core/src/server/transactions/transfer.ts 📈 +80 B (+1.73%) 4.5 kB → 4.58 kB
home/runner/work/actual/actual/packages/loot-core/src/server/aql/schema/index.ts 📈 +27 B (+0.23%) 11.57 kB → 11.6 kB
View detailed bundle breakdown

Added

Asset File Size % Changed
kcab.worker.BvVLFVIZ.js 0 B → 6.3 MB (+6.3 MB) -

Removed

Asset File Size % Changed
kcab.worker.DE5uAdQe.js 5.84 MB → 0 B (-5.84 MB) -100%

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged
No assets were unchanged


api

Total

Files count Total bundle size % Changed
1 4.38 MB → 4.84 MB (+468.19 kB) +10.44%
Changeset
File Δ Size
node_modules/@emoji-mart/data/sets/15/native.json 🆕 +467.11 kB 0 B → 467.11 kB
src/shared/emoji.ts 🆕 +884 B 0 B → 884 B
src/server/transactions/export/export-to-csv.ts 📈 +130 B (+4.56%) 2.78 kB → 2.91 kB
src/server/transactions/transfer.ts 📈 +72 B (+1.76%) 4 kB → 4.07 kB
src/server/aql/schema/index.ts 📈 +23 B (+0.22%) 10.41 kB → 10.43 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
bundle.api.js 4.38 MB → 4.84 MB (+468.19 kB) +10.44%

Smaller
No assets were smaller

Unchanged
No assets were unchanged

**Original Pull Request:** https://github.com/actualbudget/actual/pull/6628 **State:** closed **Merged:** No --- ## Summary Closes #1898. This PR adds a flag column to transactions. ## Details Actual users emigrating from YNAB often ask for this feature. Here's how YNAB describes them: > Flags > ----- > Flags are customizable color-coded markers for transactions, acting like digital sticky notes to track specific statuses like pending reimbursements, tax-deductible expenses, items needing review, or subscriptions, helping you organize spending, identify important transactions quickly, and gain insights into habits. Prior to coming to Actual, I used flags in much the same way. Flags are incredibly useful for short-term tasks. For example, if I am balancing my budget and the total doesn't match what my statement says, I can go line-by-line through the statement and mark off transactions that are reflected in my Actual account. This helped me numerous times in YNAB to track down doubled expenses, typos in amounts, errors in entering income vs expense, etc. I know others use flags for their custom workflows as well. I believe (and I think others do too, based on conversations on issues and Discord) that flags fill a need that is different from tags. Tags are useful as long-lived organizing and classification. You can create multiple tags on a transaction to slice and dice it multiple ways. Flags are simpler in that you only have one flag per transaction. But that simplicity is also its own kind of power. Flags are more visual than tags, communicate information visually rather than text, and are easy to add or remove without having to jump into the notes field. Additionally, emojis are more powerful that YNAB flags because YNAB limited users to one of a few colors. Emojis provide more customization and more personalization. This PR creates the initial framework for flags. In this PR, a user can add zero or one flags to a transaction, using an emoji selector. Right now, the only supported emojis are those in the [@emoji-mart/data](https://github.com/missive/emoji-mart) library. However, that library supports custom emojis. I could see this being a powerful feature in Actual to create budgeting-specific emojis to further empower users. ## Basic Design - A transaction has zero or one emojis - Child/split transactions do not have emojis (for now at least) - Emojis are stored in the database as their short-code (e.g. `:100:` for 💯 ). This allows for future support of custom emojis inside Actual that do not map into unicode characters, for example, emojis that are budget-based, category-based, etc. - Anywhere a transaction is supported, the flag field is supported The emoji popover uses a search bar to search for emojis, and keyboard navigation is supported. ![Flag demo](https://github.com/user-attachments/assets/a46399d3-8d49-48c7-b89a-708602edba6d) ## Out Of Scope The goal of this first implementation is to get the basic flag logic implemented in the UI and in the database. I didn't want to do everything in one PR as it would cause the size of the PR to be much larger than it is now. Once this PR is accepted, I plan to submit PR's in the near future that: - [ ] Enable bulk editing flags - [ ] Enable filtering/matching by flags - [ ] Rule/Schedule flag support - [ ] Mobile support <!--- actual-bot-sections ---> <hr /> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 28 | 14.46 MB → 14.97 MB (+518.37 kB) | +3.50% loot-core | 1 | 5.84 MB → 6.3 MB (+468.38 kB) | +7.83% api | 1 | 4.38 MB → 4.84 MB (+468.19 kB) | +10.44% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 28 | 14.46 MB → 14.97 MB (+518.37 kB) | +3.50% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `node_modules/@emoji-mart/data/sets/15/native.json` | 🆕 +467.11 kB | 0 B → 467.11 kB `src/components/select/EmojiSelect.tsx` | 🆕 +43.65 kB | 0 B → 43.65 kB `home/runner/work/actual/actual/packages/loot-core/src/shared/emoji.ts` | 🆕 +1.01 kB | 0 B → 1.01 kB `home/runner/work/actual/actual/packages/component-library/src/icons/v1/Flag.tsx` | 🆕 +805 B | 0 B → 805 B `src/components/transactions/SimpleTransactionsTable.tsx` | 📈 +1.35 kB (+14.80%) | 9.13 kB → 10.48 kB `src/components/transactions/TransactionsTable.tsx` | 📈 +4.3 kB (+5.01%) | 85.88 kB → 90.18 kB `src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx` | 📈 +173 B (+0.60%) | 28.32 kB → 28.49 kB `src/components/select/DateSelect.tsx` | 📈 +4 B (+0.02%) | 16.52 kB → 16.53 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- static/js/index.js | 9.22 MB → 9.73 MB (+518.37 kB) | +5.49% **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/indexeddb-main-thread-worker-e59fee74.js | 12.94 kB | 0% static/js/workbox-window.prod.es5.js | 5.64 kB | 0% static/js/da.js | 106.62 kB | 0% static/js/de.js | 177.78 kB | 0% static/js/en-GB.js | 7.18 kB | 0% static/js/en.js | 162.91 kB | 0% static/js/es.js | 171.21 kB | 0% static/js/fr.js | 179.72 kB | 0% static/js/it.js | 171.54 kB | 0% static/js/nb-NO.js | 157.23 kB | 0% static/js/nl.js | 103.82 kB | 0% static/js/pl.js | 88.64 kB | 0% static/js/pt-BR.js | 146.35 kB | 0% static/js/ru.js | 106.97 kB | 0% static/js/sv.js | 78.2 kB | 0% static/js/th.js | 182.35 kB | 0% static/js/uk.js | 215.11 kB | 0% static/js/resize-observer.js | 18.37 kB | 0% static/js/BackgroundImage.js | 120.54 kB | 0% static/js/ReportRouter.js | 1.11 MB | 0% static/js/narrow.js | 641.19 kB | 0% static/js/TransactionList.js | 105.97 kB | 0% static/js/wide.js | 160.07 kB | 0% static/js/AppliedFilters.js | 9.71 kB | 0% static/js/usePayeeRuleCounts.js | 11.79 kB | 0% static/js/useTransactionBatchActions.js | 13.23 kB | 0% static/js/FormulaEditor.js | 1.04 MB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.84 MB → 6.3 MB (+468.38 kB) | +7.83% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `node_modules/@emoji-mart/data/sets/15/native.json` | 🆕 +467.12 kB | 0 B → 467.12 kB `home/runner/work/actual/actual/packages/loot-core/src/shared/emoji.ts` | 🆕 +1.01 kB | 0 B → 1.01 kB `home/runner/work/actual/actual/packages/loot-core/src/server/transactions/export/export-to-csv.ts` | 📈 +146 B (+4.59%) | 3.11 kB → 3.25 kB `home/runner/work/actual/actual/packages/loot-core/src/server/transactions/transfer.ts` | 📈 +80 B (+1.73%) | 4.5 kB → 4.58 kB `home/runner/work/actual/actual/packages/loot-core/src/server/aql/schema/index.ts` | 📈 +27 B (+0.23%) | 11.57 kB → 11.6 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.BvVLFVIZ.js | 0 B → 6.3 MB (+6.3 MB) | - **Removed** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.DE5uAdQe.js | 5.84 MB → 0 B (-5.84 MB) | -100% **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** No assets were unchanged </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 4.38 MB → 4.84 MB (+468.19 kB) | +10.44% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `node_modules/@emoji-mart/data/sets/15/native.json` | 🆕 +467.11 kB | 0 B → 467.11 kB `src/shared/emoji.ts` | 🆕 +884 B | 0 B → 884 B `src/server/transactions/export/export-to-csv.ts` | 📈 +130 B (+4.56%) | 2.78 kB → 2.91 kB `src/server/transactions/transfer.ts` | 📈 +72 B (+1.76%) | 4 kB → 4.07 kB `src/server/aql/schema/index.ts` | 📈 +23 B (+0.22%) | 10.41 kB → 10.43 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- bundle.api.js | 4.38 MB → 4.84 MB (+468.19 kB) | +10.44% **Smaller** No assets were smaller **Unchanged** No assets were unchanged </div> </details> </details> <!--- bundlestats-action-comment key:combined end --->
GiteaMirror added the pull-request label 2026-02-28 21:30:57 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#6638