portal

Alexander Kouznetsov 2024-01-25T23:57:25.668659Z

Is there a way in UI to drop individual values in the portal?

Alexander Kouznetsov 2024-01-27T08:25:07.580079Z

What’s the preferred way to configure such things on user’s side?

djblue 2024-01-25T23:58:26.400079Z

Like filtering out stuff you've tapped out?

Alexander Kouznetsov 2024-01-25T23:58:51.420749Z

Just completely removing them

Alexander Kouznetsov 2024-01-25T23:59:12.935309Z

Like clearing all, but only the selected items

djblue 2024-01-26T00:05:02.798599Z

Currently, this can be achieved via a custom tap list:

(def tap-list (atom (with-meta (list) {:portal.viewer/default :portal.viewer/inspector})))

(defn submit [x] (swap! tap-list conj x))

(add-tap #'submit)

(defn clear-selected [& args]
  (let [values (into #{} args)]
    (swap! tap-list (fn [taps] (remove values taps)))))

(p/register! #'clear-selected)

(p/inspect tap-list)

(tap> :hi)

djblue 2024-01-26T00:06:32.167499Z

You could also implement the command in terms of the default Portal tap-list atom #'portal.runtime/tap-list but technically that's an internal implementation detail, but I probably won't change it 😂

djblue 2024-01-26T00:07:15.806839Z

The other thing here is that items are removed by value, not by index since that info isn't really available to commands

Alexander Kouznetsov 2024-01-26T00:14:46.084789Z

Interesting, thanks! Do you think it would make sense to have it in the standard features?

djblue 2024-01-26T00:53:53.055679Z

I think if something can be accomplished by the user, I would rather not include it. Currently, there are certain commands that could be user added, but they were added before the ability to add your own commands and now I can't remove them.

🤔 1