From 48c8dc6245c110adb9fad9a0b12cf7f64df385a1 Mon Sep 17 00:00:00 2001 From: tim <41093512+slimslickner@users.noreply.github.com> Date: Sun, 8 Feb 2026 00:17:41 -0500 Subject: [PATCH 1/3] feat: add option to control metadata indicator visibility Add a new Fava option 'show-metadata-indicators' (default: true) that allows users to disable the display of metadata indicator badges in the journal. This addresses issue #2180 where metadata indicators were consuming valuable screen space and hiding important information like payee and narration text. Users can now disable indicators by adding to their Beancount file: 2024-01-01 custom "fava-option" "show-metadata-indicators" "false" The option is backward-compatible and defaults to showing indicators, maintaining existing behavior for current users. Co-Authored-By: Claude Haiku 4.5 --- src/fava/core/fava_options.py | 1 + src/fava/templates/_journal_table.html | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/fava/core/fava_options.py b/src/fava/core/fava_options.py index a0a6a93bc..178d6935d 100644 --- a/src/fava/core/fava_options.py +++ b/src/fava/core/fava_options.py @@ -109,6 +109,7 @@ class FavaOptions: show_accounts_with_zero_balance: bool = True show_accounts_with_zero_transactions: bool = True show_closed_accounts: bool = False + show_metadata_indicators: bool = True sidebar_show_queries: int = 5 unrealized: str = "Unrealized" upcoming_events: int = 7 diff --git a/src/fava/templates/_journal_table.html b/src/fava/templates/_journal_table.html index 8b170e11b..869e7e1b0 100644 --- a/src/fava/templates/_journal_table.html +++ b/src/fava/templates/_journal_table.html @@ -10,10 +10,12 @@ {% macro _account_link(name) %}{{ name }}{% endmacro %} -{% macro _render_metadata_indicators(metadata) -%} +{% macro _render_metadata_indicators(metadata, show_indicators=True) -%} +{% if show_indicators %} {% for key, value in metadata %} {{ key[:2] }} {% endfor %} +{% endif %} {%- endmacro %} {% macro _render_metadata(metadata, entry_hash=None) -%} @@ -40,6 +42,7 @@ {% macro journal_table_contents(entries, show_change_and_balance=False, ledger=None) %} {% set ledger = ledger or g.ledger %} +{% set show_metadata_indicators = ledger.fava_options.show_metadata_indicators %} {% autoescape false %} {% for entry in entries %} {% if show_change_and_balance %} @@ -88,10 +91,10 @@ {% endif %} - {{- _render_metadata_indicators(metadata_items) -}} + {{- _render_metadata_indicators(metadata_items, show_metadata_indicators) -}} {%- for posting in entry.postings -%} - {{- _render_metadata_indicators(posting.meta|meta_items) -}} + {{- _render_metadata_indicators(posting.meta|meta_items, show_metadata_indicators) -}} {%- endfor -%} {% if type == 'balance' %} From b4d05a43722d9a76aa48ef2ac41f997fe35dd188 Mon Sep 17 00:00:00 2001 From: tim <41093512+slimslickner@users.noreply.github.com> Date: Sun, 8 Feb 2026 00:37:36 -0500 Subject: [PATCH 2/3] test: update snapshots for new metadata indicators option Update test snapshots to include the new 'show_metadata_indicators' field in FavaOptions that was added to control metadata indicator visibility. Co-Authored-By: Claude Haiku 4.5 --- tests/__snapshots__/test_internal_api-test_get_ledger_data.json | 1 + tests/__snapshots__/test_json_api-test_api-options.json | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/__snapshots__/test_internal_api-test_get_ledger_data.json b/tests/__snapshots__/test_internal_api-test_get_ledger_data.json index 2bcd63782..e6a8a481c 100644 --- a/tests/__snapshots__/test_internal_api-test_get_ledger_data.json +++ b/tests/__snapshots__/test_internal_api-test_get_ledger_data.json @@ -733,6 +733,7 @@ "show_accounts_with_zero_balance": false, "show_accounts_with_zero_transactions": true, "show_closed_accounts": false, + "show_metadata_indicators": true, "sidebar_show_queries": 5, "unrealized": "Unrealized", "upcoming_events": 7, diff --git a/tests/__snapshots__/test_json_api-test_api-options.json b/tests/__snapshots__/test_json_api-test_api-options.json index 2d9dc6413..712d0ccaf 100644 --- a/tests/__snapshots__/test_json_api-test_api-options.json +++ b/tests/__snapshots__/test_json_api-test_api-options.json @@ -55,6 +55,7 @@ "locale": "None", "show-accounts-with-zero-balance": "False", "show-accounts-with-zero-transactions": "True", + "show-metadata-indicators":"True", "show-closed-accounts": "False", "sidebar-show-queries": "5", "unrealized": "'Unrealized'", From 62def4415e670014d7cafb7e56daf3c4b5358d49 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 8 Feb 2026 05:38:37 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/__snapshots__/test_json_api-test_api-options.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/__snapshots__/test_json_api-test_api-options.json b/tests/__snapshots__/test_json_api-test_api-options.json index 712d0ccaf..a76d28548 100644 --- a/tests/__snapshots__/test_json_api-test_api-options.json +++ b/tests/__snapshots__/test_json_api-test_api-options.json @@ -55,7 +55,7 @@ "locale": "None", "show-accounts-with-zero-balance": "False", "show-accounts-with-zero-transactions": "True", - "show-metadata-indicators":"True", + "show-metadata-indicators": "True", "show-closed-accounts": "False", "sidebar-show-queries": "5", "unrealized": "'Unrealized'",