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

Unify confirmation popups into popup framework

Open neiljp opened this issue 1 year ago • 1 comments

What does this PR do, and why?

This incrementally improves the popup code until a point where the confirmation popups can be handled in the same way as others and improved upon:

  • extract the border styling from core.py and into a new PopUpFrame class in view.py
  • extend PopUpFrame to handle title-less cases (ie. for confirmation popups)
  • simplify confirmation popups to not support locations other than center, easing integration
  • migrate ConfirmationPopUpView from an Overlay to a Frame, and other changes to enable use of show_pop_up just like other popups

Other than simplifying the code, this also results in confirmation popups acquiring a solid edge, as with regular popups.

Outstanding aspect(s)

  • [ ] Last commit needs more consideration
  • [ ] Nesting of popups into frame suggests frame could be an urwid container/decorator class
  • [ ] Confirm ability to style popup borders
  • [ ] Select appropriate popup borders for different confirmation popups?

External discussion & connections

  • [ ] Discussed in #zulip-terminal in topic
  • [ ] Fully fixes #
  • [ ] Partially fixes issue #
  • [ ] Builds upon previous unmerged work in PR #
  • [ ] Is a follow-up to work in PR #
  • [ ] Requires merge of PR #
  • [ ] Merge will enable work on #

How did you test this?

  • [ ] Manually - Behavioral changes
  • [ ] Manually - Visual changes
  • [ ] Adapting existing automated tests
  • [ ] Adding automated tests for new behavior (or missing tests)
  • [ ] Existing automated tests should already cover this (only a refactor of tested code)

Self-review checklist for each commit

  • [ ] It is a minimal coherent idea
  • [ ] It has a commit summary following the documented style (title & body)
  • [ ] It has a commit summary describing the motivation and reasoning for the change
  • [ ] It individually passes linting and tests
  • [ ] It contains test additions for any new behavior
  • [ ] It flows clearly from a previous branch commit, and/or prepares for the next commit

Visual changes

neiljp avatar Jul 17 '24 07:07 neiljp