hledger icon indicating copy to clipboard operation
hledger copied to clipboard

Request for comment: brick EventM API changes

Open jtdaugherty opened this issue 3 years ago • 4 comments

I'm working on an overhaul of brick's EventM API and I'd love to get your feedback on how it might impact this project. Please see the details and post comments on https://github.com/jtdaugherty/brick/issues/379. Thanks!

jtdaugherty avatar Jul 18 '22 00:07 jtdaugherty

Discussion continues at https://github.com/jtdaugherty/brick/issues/379.

Note some general design discussion, possibly useful for us, beginning here.

simonmichael avatar Jul 22 '22 19:07 simonmichael

PS and thanks @jtdaugherty for your work and the heads-up.

simonmichael avatar Jul 22 '22 19:07 simonmichael

Thanks, @simonmichael !

jtdaugherty avatar Jul 22 '22 19:07 jtdaugherty

Reopening as a reminder to prepare for the future API change.

simonmichael avatar Jul 23 '22 02:07 simonmichael

Hi, folks - Brick 1.0 is out. Here are the details: https://github.com/jtdaugherty/brick/blob/master/CHANGELOG.md#10

jtdaugherty avatar Aug 08 '22 22:08 jtdaugherty

Related: https://github.com/commercialhaskell/stackage/issues/6682

simonmichael avatar Aug 14 '22 16:08 simonmichael

Hi @jtdaugherty, I'm having trouble porting code involving handleEditorEvent, which uses a different state type than the main handler. Would you have any clues handy ? Eg in code like:

  case mode of
    Minibuffer _ ed ->
      case ev of
        VtyEvent (EvKey KEsc   []) -> put $ closeMinibuffer ui
        VtyEvent ev -> do
          ed' <- handleEditorEvent (VtyEvent ev) ed
          put ui{aMode=Minibuffer "filter" ed'}

should I be using runState to run an inner computation updating ed ?

simonmichael avatar Aug 17 '22 07:08 simonmichael

Ha never mind, re-reading the excellent migration notes will help.

        VtyEvent ev -> do
          ed' <- nestEventM' ed $ handleEditorEvent (VtyEvent ev)
          put ui{aMode=Minibuffer "filter" ed'}

simonmichael avatar Aug 17 '22 08:08 simonmichael

Great, I’m glad you got it sorted out. Let me know if anything else comes up!

On Aug 17, 2022, at 1:10 AM, Simon Michael @.***> wrote:

 Ha never mind, re-reading the excellent migration notes will help.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

jtdaugherty avatar Aug 17 '22 13:08 jtdaugherty

We now use and require brick 1.0 (cf #1919). (This means that hledger 1.27 won't get into stackage nightly until brick 1.0 does.)

simonmichael avatar Aug 17 '22 15:08 simonmichael

Crashes on entering an account register.

simonmichael avatar Aug 18 '22 05:08 simonmichael

Fixed at last, UI tests passing.

simonmichael avatar Aug 23 '22 01:08 simonmichael