diff --git a/hledger-ui/Hledger/UI/AccountsScreen.hs b/hledger-ui/Hledger/UI/AccountsScreen.hs index b4b8819cd..84b0d0b13 100644 --- a/hledger-ui/Hledger/UI/AccountsScreen.hs +++ b/hledger-ui/Hledger/UI/AccountsScreen.hs @@ -86,7 +86,7 @@ asInit d reset ui@UIState{ displayitem ((fullacct, shortacct, indent), bal) = AccountsScreenItem{asItemIndentLevel = indent ,asItemAccountName = fullacct - ,asItemDisplayAccountName = if flat_ ropts' then fullacct else shortacct + ,asItemDisplayAccountName = replaceHiddenAccountsNameWith "All" $ if flat_ ropts' then fullacct else shortacct ,asItemRenderedAmounts = map showAmountWithoutPrice amts -- like showMixedAmountOneLineWithoutPrice } where diff --git a/hledger-ui/Hledger/UI/RegisterScreen.hs b/hledger-ui/Hledger/UI/RegisterScreen.hs index e2edfddb7..10beedecd 100644 --- a/hledger-ui/Hledger/UI/RegisterScreen.hs +++ b/hledger-ui/Hledger/UI/RegisterScreen.hs @@ -44,7 +44,7 @@ registerScreen = RegisterScreen{ ,rsAccount = "" } -rsSetAccount a scr@RegisterScreen{} = scr{rsAccount=a} +rsSetAccount a scr@RegisterScreen{} = scr{rsAccount=replaceHiddenAccountsNameWith "*" a} rsSetAccount _ scr = scr rsInit :: Day -> Bool -> UIState -> UIState @@ -107,7 +107,7 @@ rsDraw UIState{aopts=UIOpts{cliopts_=CliOpts{reportopts_=ropts}} -- Minibuffer e -> [minibuffer e, maincontent] _ -> [maincontent] where - toplabel = withAttr ("border" <> "bold") (str $ T.unpack rsAccount) + toplabel = withAttr ("border" <> "bold") (str $ T.unpack $ replaceHiddenAccountsNameWith "All" rsAccount) <+> togglefilters <+> str " transactions" <+> borderQueryStr (query_ ropts) diff --git a/hledger-ui/Hledger/UI/TransactionScreen.hs b/hledger-ui/Hledger/UI/TransactionScreen.hs index 21bef1f17..cf0f88af6 100644 --- a/hledger-ui/Hledger/UI/TransactionScreen.hs +++ b/hledger-ui/Hledger/UI/TransactionScreen.hs @@ -66,7 +66,7 @@ tsDraw UIState{aopts=UIOpts{cliopts_=CliOpts{reportopts_=ropts}} <+> str (" of "++show (length nts)) <+> togglefilters <+> borderQueryStr (query_ ropts) - <+> str (" in "++T.unpack acct++")") + <+> str (" in "++T.unpack (replaceHiddenAccountsNameWith "All" acct)++")") togglefilters = case concat [ if cleared_ ropts then ["cleared"] else [] diff --git a/hledger-ui/Hledger/UI/UIUtils.hs b/hledger-ui/Hledger/UI/UIUtils.hs index a4c4ed9fb..6c750dc02 100644 --- a/hledger-ui/Hledger/UI/UIUtils.hs +++ b/hledger-ui/Hledger/UI/UIUtils.hs @@ -104,6 +104,16 @@ borderKeysStr keydescs = -- sep = str " | " sep = str " " +-- temporary shenanigans: + +-- | Convert the special account name "*" (from balance report with depth limit 0) to something clearer. +replaceHiddenAccountsNameWith :: AccountName -> AccountName -> AccountName +replaceHiddenAccountsNameWith anew a | a == hiddenAccountsName = anew + | a == "*" = anew + | otherwise = a + +hiddenAccountsName = "..." -- for now + -- generic topBottomBorderWithLabel :: Widget -> Widget -> Widget