hledger-web: transactions displayed as Haskell code

Created on 12 Nov 2018  路  7Comments  路  Source: simonmichael/hledger

In hledger-web-1.11.1, when hovering over a node in the graphical history, the transaction is displayed as a Haskell expression but not as human readable text.
http://127.0.0.1:5000/register?q=inacct%3AMyAccount

A BUG web

Most helpful comment

IIRC, it was previously formatted in the way 'hledger print' formats transactions normally. I would guess that there was a custom Show instance that has since been removed.

The fix is to replace #{show torig} with #{showTransactionUnelided torig} (or one of the two other showTxn functions, but this one seemed to be the one we want from skinning the docstrings).

All 7 comments

It's the file register.hamlet line 22 <tr ... title="#{show torig}" ...>

So, what should be shown? Useful information from the data type Transaction?

      tindex                   :: Integer,   -- ^ this transaction's 1-based position in the transaction stream, or 0 when not available
      tprecedingcomment        :: Text,      -- ^ any comment lines immediately preceding this transaction
     *tsourcepos               :: GenericSourcePos,  -- ^ the file position where the date starts
      tdate                    :: Day,
     *tdate2                   :: Maybe Day,
     *tstatus                  :: Status,
     *tcode                    :: Text,
     *tdescription             :: Text,
     *tcomment                 :: Text,      -- ^ this transaction's comment lines, as a single non-indented multi-line string
     *ttags                    :: [Tag],     -- ^ tag names and values, extracted from the comment
     *tpostings                :: [Posting]  -- ^ this transaction's postings
  • all information marked with *?
  • comment but without tags
  • tags
  • comments, date2, and other tags from postings?

This is a lot of information and we still need a syntax for representation...

On Sun, 17 Feb 2019, Jakob Sch枚ttl wrote:

It's the file register.hamlet line 22

So, what should be shown? Useful information from the data type Transaction?

...

This is a lot of information and we still need a syntax for representation...

I would make it reasonably short and show, say: date, title, amount

'date' and 'amount' are shown in the graph, but the resolution is too low
to see precise values. Thus I would like to point to a node and see the
precise values.

Oh, I misread and wrote about the <tr> in the table below the graphical display.

IIRC, it was previously formatted in the way 'hledger print' formats transactions normally. I would guess that there was a custom Show instance that has since been removed.

The fix is to replace #{show torig} with #{showTransactionUnelided torig} (or one of the two other showTxn functions, but this one seemed to be the one we want from skinning the docstrings).

That sounds right!

Transaction's Show instance was reclaimed for debugging purposes I believe. You could find out from the git history. I missed a lot of places where it was used.

Works for me! Thank you a lot!

Thanks for the report @amigalemming.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MisterY picture MisterY  路  9Comments

simonmichael picture simonmichael  路  8Comments

simonmichael picture simonmichael  路  9Comments

tonyxiao picture tonyxiao  路  7Comments

varac picture varac  路  9Comments