djblue / portal

A clojure tool to navigate through your data.
https://djblue.github.io/portal/
MIT License
872 stars 81 forks source link

Extend multi selection #199

Closed handerpeder closed 10 months ago

handerpeder commented 10 months ago

ref: slack chat

I often find myself in situations where I'm doing:

;; click first arg
(def arg1 @session)
;; click second arg
(def arg2 @session)
(my-func arg1 arg2)

this patch is a sketch that would allow the following instead:

;; click first arg
;; alt-click second arg
(apply my-func (p/selected session))

I've also extended the commands copy and copy-json to support multi-selection. If there is only one value selected the value is not wrapped in a list to remain backwards compatible.

At this stage I'm mostly looking for feedback if this is a good approach or not.

To end I'd just like to say that I've found portal a very useful addition to my workflow. This is my first time diving into the code and I found the code to be very clear and well structured. Kudos!

djblue commented 10 months ago

Hi @handerpeder, thanks for the PR!

I forgot to mention a couple of the other clients that need to be updated:

Do you mind updating them as well?

handerpeder commented 10 months ago

Sure, was expecting that. I take it this means you're okay with the changes?

djblue commented 10 months ago

@handerpeder I think I have a fix for the tests, but looking into some performance issues.

djblue commented 10 months ago

A rebase fixed the perf issue, not sure where the regression was but latest seems to be fine 👌 I manually pushed the commits on master https://github.com/djblue/portal/commit/d617feffb26869ea9347118580cc219e26727b73, thanks again for the PR!