parrot icon indicating copy to clipboard operation
parrot copied to clipboard

Animate processes & events

Open psionic-k opened this issue 2 years ago • 7 comments

Test with:

;; straight-use-package
    (use-package parrot
      :straight
      (parrot :type git :host github :repo "positron-solutions/parrot")
      :custom
      (parrot-animate 'hide-static)
      (parrot-rotate-animate-after-rotation nil)
      (parrot-num-rotations 10)
      (parrot-type 'emacs)
      (parrot-animate-on-load t)
      (parrot-mode t)) ;; enables the mode
 
     (customize-group 'parrot)

Until PR is merged into d12/parrot or MELPA is updated

Adds support for:

  • animating while a process is running (magit-push integration provided)
  • hiding after animations
  • persistent animations
  • animating when mode starts

Improvements:

  • customize interface for parrot-type
  • code structure overhauled (see commit notes)
  • mode activation on interactive or forced calls to parrot-start-animation
  • doom modeline integration fixes
  • integration with org todo state change provided. Changing an item to "DONE" animates by default.
  • divided larger parrot-rotate custom options into subgroup
  • initialization of states cleaned up

psionic-k avatar May 26 '22 03:05 psionic-k

Found dynamic binding bug. Fixing it up real quick.

psionic-k avatar May 26 '22 10:05 psionic-k

I'm going to learn about byte compiling and then force push later. Package works before compile and breaks after compile.

psionic-k avatar May 26 '22 14:05 psionic-k

Byte compile fixed. Got lost while attempting to clean up the architecture and was not able to keep everything in separate commits. I did a lot more testing this time around. I don't use rotate much, so I won't see behavior changes there :no_mouth:

:parrot: :shipit:

psionic-k avatar May 27 '22 07:05 psionic-k

Ready for review / merge. README update was my last commit for now.

psionic-k avatar May 27 '22 07:05 psionic-k

Nobody on the phone. Going to unfork and PR melpa. Thanks for starting the package.

psionic-k avatar Jun 04 '22 07:06 psionic-k

First of all, apologies for the super long delay. I finally got around to reviewing the changes and they look like a cool addition to parrot. Thank you for contributing ❤️

Just a few comments on things that should probably get cleaned up for integration into master:

  • parrot-progress.el's top comment should be changed from parrot-rotate.el to parrot-progress.el
  • The commentary in parrot-progress.el mentions something about rotate failing to stop the animation or prematurely stopping it. Is that comment still valid?
  • I have some difficulty loading the package when using load-file that doesn't occur when I load parrot from master. For example, running the following results in an error:
(add-to-list 'load-path "/home/dp12/parrot-positron")
(load-file "/home/dp12/parrot-positron/parrot.el")

=> 

Debugger entered--Lisp error: (void-variable parrot-animate)
  (eq parrot-animate 'hide-static)
  (and maybe-static (eq parrot-animate 'hide-static))
  (or (and maybe-static (eq parrot-animate 'hide-static)) (not maybe-static))
  (if (or (and maybe-static (eq parrot-animate 'hide-static)) (not maybe-static)) (parrot-start-animation) (force-mode-line-update))
  (progn (if (not parrot-mode) (parrot-mode 1) (parrot--load-frames parrot-type)) (if (or (and maybe-static (eq parrot-animate 'hide-static)) (not maybe-static)) (parrot-start-animation) (force-mode-line-update)))
  (if (featurep 'parrot) (progn (if (not parrot-mode) (parrot-mode 1) (parrot--load-frames parrot-type)) (if (or (and maybe-static (eq parrot-animate 'hide-static)) (not maybe-static)) (parrot-start-animation) (force-mode-line-update))))
  parrot--refresh(t)
  (closure (t) (sym val) (set-default sym val) (parrot--refresh t))(parrot-click-hook nil)
  custom-initialize-reset(parrot-click-hook (funcall #'(closure (t) nil "" nil)))
  custom-declare-variable(parrot-click-hook (funcall #'(closure (t) nil "" nil)) "Hook run after clicking on the parrot." :group parrot :type hook :set (closure (t) (sym val) (set-default sym val) (parrot--refresh t)))
  load-with-code-conversion("/home/dp12/parrot-positron/parrot.el" "/home/dp12/parrot-positron/parrot.el" nil nil)
  load-file("/home/dp12/parrot-positron/parrot.el")
  (progn (load-file "/home/dp12/parrot-positron/parrot.el"))
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  eros-eval-last-sexp(nil)
  funcall-interactively(eros-eval-last-sexp nil)
  command-execute(eros-eval-last-sexp)

Thanks again for the PR!

dp12 avatar Jun 17 '22 04:06 dp12

And then I ended up flying off for a few days. :airplane:

I think I want to do a package lint and get my CI set up similar to https://github.com/positron-solutions/elisp-repo-kit

I found a lot of tiny issues just by following the linter while creating that project. I want to reproduce your issue and figure out more about lisp packaging.

The commentary in parrot-progress.el mentions something about rotate failing to stop the animation or prematurely stopping it. Is that comment still valid?

I assume this commentary: https://github.com/dp12/parrot/pull/12/files#diff-e4aac7de3e9cb2b64f3c8dda7c23af2d0eee76e09a24ed503f269ce9c365ed11R26-R29

The comment is still valid in that I don't recall fully reconciling how rotate and progress work together yet. There is not a complete abstraction yet. A staple behavior of animation libraries is to handle overlapping animations without the shorter animation stopping longer animations or losing track and animating forever. IIRC I handled this by making the longer animation replace the shorter animation timer by just punching the state.

psionic-k avatar Jun 25 '22 05:06 psionic-k