zulip-terminal icon indicating copy to clipboard operation
zulip-terminal copied to clipboard

WIP: Barely working zforms support.

Open aero31aero opened this issue 6 years ago • 4 comments

This is just a proof of concept. I'm not sure where to add what code and I essentially wrote a lot of unneeded functions to export things from the message for now. I'll clean this up in the next few commits.

The current interface is to press a number key from 1 to 9 to select one of the choices available in a message:

image

This creates an obvious restriction of maximum 9 choices per message. I wonder if a popup menu to choose would be a better UI?

aero31aero avatar Jan 31 '19 19:01 aero31aero

I'll do a little bit of a self review on this:

  • [ ] We should probably abstract the message sending functionality in MessageBox.respond_to_submessage(key) and avoid having to expose 2 functions from MessageBox.

  • [ ] We should create a separate submessages.py file that does validation AND identification of various (message)widgets and also create (urwid)widgets.

  • [ ] Along with the above, add 2 functions for the zform choices widgets: get_widget_to_render() and send_response(key), both being used inside MessageBox functions.

  • [ ] Currently we always call .send_stream_message. Figure out how to call .client.send_message directly or add an if check for PMs.

  • [ ] Consider adding navigation like <next option> <previous option> <select option> if there are more than 9 options.

  • [ ] Unit tests.

aero31aero avatar Jan 31 '19 20:01 aero31aero

This seemed to crash for me, with an IndexError on L458 of boxes.py? I'm not sure if anyone else has tried it?

neiljp avatar Feb 03 '19 07:02 neiljp

@aero31aero Just checking if you're wanting some kind of review on this, or plan to work on it more first?

neiljp avatar Feb 16 '19 03:02 neiljp

Heads up @aero31aero, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/master branch and resolve your pull request's merge conflicts accordingly.

zulipbot avatar Apr 17 '20 00:04 zulipbot