Skip to content

hledger-ui/hledger-web can misleadingly hide a zero-balance parent account #1237

@simonmichael

Description

@simonmichael

Reported by glguy, with additional testing from parsnip. When showing a tree of account balances, a parent account with non-zero subaccounts should always be shown, even if its balance is zero and zeroes are being hidden, to preserve the correct tree structure. This isn't working correctly when you toggle zeroes off in hledger-ui and hledger-web.

Eg:

2020/1/1
    (A)        1
    (B:C)      1
    (B:D)     -1
    (Z)        0

The balance command hides zeroes by default (Z), but correctly does not hide B because it has non-zero subs:

$ hledger bal  -N
                   1  A
                   0  B
                   1    C
                  -1    D

hledger-ui shows zeroes by default:

 A    1
 B    0
  C   1
  D  -1
 Z    0

but when you press Z to hide them (or if you start it with -E) it incorrectly hides B:

 A    1
  C   1
  D  -1

The same thing happens in hledger-web's account sidebar when you press e.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-BUGSomething wrong, confusing or sub-standard in the software, docs, or user experience.uiThe hledger-ui tool.webThe hledger-web tool.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions