From ba77d88550fbcb9e5e148d22d74b798e99b9c0c8 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] 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. --- src/fava/core/fava_options.py | 1 + src/fava/help/options.md | 11 +++++++++++ src/fava/templates/_journal_table.html | 5 +++-- .../test_internal_api-test_get_ledger_data.json | 1 + .../__snapshots__/test_json_api-test_api-options.json | 1 + 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/fava/core/fava_options.py b/src/fava/core/fava_options.py index 01bf07fb9..9f97193ac 100644 --- a/src/fava/core/fava_options.py +++ b/src/fava/core/fava_options.py @@ -108,6 +108,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 upcoming_events: int = 7 uptodate_indicator_grey_lookback_days: int = 60 diff --git a/src/fava/help/options.md b/src/fava/help/options.md index 0c33d7d43..038e7fbf2 100644 --- a/src/fava/help/options.md +++ b/src/fava/help/options.md @@ -179,6 +179,17 @@ shown. ______________________________________________________________________ +## `show-metadata-indicators` + +Default: `true` + +Whether to show metadata indicators in journals. For each metadata key on an +entry or posting, a small badge with the first two characters of the key is +shown in the indicators column, with the full key and value available on hover. +Set this to `false` to hide these indicators. + +______________________________________________________________________ + ## `collapse-pattern` Default: Not set diff --git a/src/fava/templates/_journal_table.html b/src/fava/templates/_journal_table.html index 8b170e11b..db410f473 100644 --- a/src/fava/templates/_journal_table.html +++ b/src/fava/templates/_journal_table.html @@ -40,6 +40,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 +89,10 @@ {% endif %} - {{- _render_metadata_indicators(metadata_items) -}} + {%- if show_metadata_indicators %}{{- _render_metadata_indicators(metadata_items) -}}{% endif -%} {%- for posting in entry.postings -%} - {{- _render_metadata_indicators(posting.meta|meta_items) -}} + {%- if show_metadata_indicators %}{{- _render_metadata_indicators(posting.meta|meta_items) -}}{% endif -%} {%- endfor -%} {% if type == 'balance' %} 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 8da3e7dae..04480564a 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, "upcoming_events": 7, "uptodate_indicator_grey_lookback_days": 60, diff --git a/tests/__snapshots__/test_json_api-test_api-options.json b/tests/__snapshots__/test_json_api-test_api-options.json index 613c3762b..ce2a2ecf1 100644 --- a/tests/__snapshots__/test_json_api-test_api-options.json +++ b/tests/__snapshots__/test_json_api-test_api-options.json @@ -56,6 +56,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", "upcoming-events": "7",