From e9cd7491511177b4531bc97e364ae935a082d19f Mon Sep 17 00:00:00 2001 From: Xavier Fiechter Date: Thu, 18 Dec 2025 00:32:47 +0100 Subject: [PATCH] . --- django/labellabor/views.py | 34 ++++- django/templates/_base.html | 6 +- django/templates/home.html | 7 +- django/templates/labelbase_tree_maps.html | 6 + .../labelbase_tree_maps_unspent_outputs.html | 128 +++++++++++------- django/templates/profile_update_fees.html | 8 +- django/userprofile/models.py | 13 +- 7 files changed, 145 insertions(+), 57 deletions(-) diff --git a/django/labellabor/views.py b/django/labellabor/views.py index f2ba030..3f5594f 100644 --- a/django/labellabor/views.py +++ b/django/labellabor/views.py @@ -564,7 +564,7 @@ class TreeMapsView(ListView): context['action'] = self.kwargs.get('action', 'unspent-outputs') return context - def get_queryset(self): + def get_queryset_OLD(self): #action = self.kwargs.get('action', 'unspent-outputs') label_ids = [] @@ -596,6 +596,38 @@ class TreeMapsView(ListView): qs = Label.objects.none() return qs.order_by("id") + def get_queryset(self): + label_ids = [] + + qs = Label.objects.filter( + labelbase__user_id=self.request.user.id, + labelbase_id=self.kwargs["pk"], + ) + + action = self.kwargs.get('action', 'unspent-outputs') + + for l in qs: + if l.type == "output": + output = OutputStat.objects.filter( + user=l.labelbase.user, + type_ref_hash=l.type_ref_hash, + network=l.labelbase.network).last() + if output and output.spent is False: + # For fee-efficiency, only show spendable outputs + if action == 'fee-efficiency': + if l.spendable is True: + label_ids.append(l.id) + else: + label_ids.append(l.id) + + if label_ids: + qs = qs.filter(id__in=label_ids, + labelbase__user_id=self.request.user.id, + labelbase_id=self.kwargs["pk"]) + else: + qs = Label.objects.none() + return qs.order_by("id") + class LabelbasePortfolioView(LabelbaseView): template_name = "labelbase_portfolio.html" diff --git a/django/templates/_base.html b/django/templates/_base.html index a07b2fc..464f5a0 100644 --- a/django/templates/_base.html +++ b/django/templates/_base.html @@ -185,12 +185,12 @@ {% endwith %}
  • Fix & Manage
  • Sync Fields
  • - {% comment %}
  • UTXOs Health
  • {% endcomment %} -
  • Tree Map
  • - {% comment %}
  • Stats & KPIs
  • {% endcomment %} {% if request.user.profile.use_fiatfinances %}
  • Fiat Finances
  • {% endif %} + {% comment %}
  • UTXOs Health
  • {% endcomment %} +
  • Tree Map
  • + {% comment %}
  • Stats & KPIs
  • {% endcomment %}
  • Import
  • Export
  • {% if labelbase.user.profile.use_hashtags %} diff --git a/django/templates/home.html b/django/templates/home.html index 8ee6db2..51e0c97 100644 --- a/django/templates/home.html +++ b/django/templates/home.html @@ -339,7 +339,12 @@

    Instantly visualize the cost-effectiveness of spending your UTXOs. Labelbase calculates and displays fee health status for each spendable output, color-coded to show if transaction fees would consume a healthy percentage of the output value.

    - +
    +
    +

    UTXO Fee Efficiency Visualization

    +

    Visualize the cost-effectiveness of spending your UTXOs with color-coded treemaps. See at a glance which outputs have healthy fee-to-value ratios and which would be expensive to spend, helping you make informed decisions about consolidation and transaction planning.

    +
    +
    diff --git a/django/templates/labelbase_tree_maps.html b/django/templates/labelbase_tree_maps.html index 36e80e1..b18d500 100644 --- a/django/templates/labelbase_tree_maps.html +++ b/django/templates/labelbase_tree_maps.html @@ -16,6 +16,12 @@ + diff --git a/django/templates/labelbase_tree_maps_unspent_outputs.html b/django/templates/labelbase_tree_maps_unspent_outputs.html index 56fbe2a..326ceb2 100644 --- a/django/templates/labelbase_tree_maps_unspent_outputs.html +++ b/django/templates/labelbase_tree_maps_unspent_outputs.html @@ -11,14 +11,26 @@ - -{% if labelbase.is_testnet %} +{% if action == "fee-efficiency" %} +
    + +
    + Fee Efficiency (VTER): Color shows how efficient it is to spend each output based on the fee-to-value ratio. +

    + 🟢 Healthy: Fee < {{ request.user.profile.my_fee_threshold_healthy }}% of value
    + 🟡 Warning: Fee {{ request.user.profile.my_fee_threshold_healthy }}-{{ request.user.profile.my_fee_threshold_warning }}% of value
    + 🔴 High: Fee > {{ request.user.profile.my_fee_threshold_warning }}% of value +

    + Box size represents output value in sats. Thresholds based on your fee settings. Adjust in Profile → Fees +
    +
    +{% elif labelbase.is_testnet %}
    Important Notice for Testnet Transactions: Testnet coins hold no real-world value and are solely intended for testing purposes.
    -
    {% else %}
    @@ -28,6 +40,7 @@ If the UTXO value is not provided, Labelbase will estimate it based on historica
    {% endif %} +