p0deje / Maccy

Lightweight clipboard manager for macOS
https://maccy.app
MIT License
13.1k stars 551 forks source link

[V2.x] Move popover instead of hide and show #819

Open weisJ opened 4 months ago

weisJ commented 4 months ago

Before Submitting Your Feature Request

Problem

I think the hide and immediate reshow of the popover when the selection changes is a bit unwieldy. I think it would be beneficial to transition the position of the popover in the case where the selection moves to an adjacent item. Thought?

Solution

No response

p0deje commented 4 months ago

I would not mind implementing this, but I don't think it's possible in SwiftUI without implementing custom views. A much simpler solution would probably be a complete disabling of popover show/hide animation, but I haven't found a way to do this in SwiftUI too.

weisJ commented 4 months ago

I noticed this too today. The API is pretty locked down. And various versions to implement it using NSViewRepresentable seem to not reliably produce the same behaviour (the positioning seems to be a bit off).

p0deje commented 4 months ago

I did some smaller improvements in https://github.com/p0deje/Maccy/commit/f1f3ae717846abf5fcecb7948e86077828df4928, maybe this approach can be used for moving popover too.

weisJ commented 3 months ago

I haven't found a way to utilise this for moving the popover, however I have experimented with having a "detached" popover without an arrow, that updates the content if the selection changes.

I also added a shortcut for opening the popover (⌘I by default) for manual control instead of the automatic delay.

Here is how it looks like:

https://github.com/user-attachments/assets/6cdcfa75-de71-48a3-a7f5-317da4706471

What do you think about this? Would it be worth while to add (some of) the following options:

p0deje commented 3 months ago

I think it looks great overall, can you share a rough implementation how it works? I am not sure it makes sense to change this feature in 2.0, maybe postpone until 2.1 or consider a completely different approach to previews. I was thinking about potentially adding a slideout right sidebar with preview similar to https://cindori.com/developer/expandable-floating-panel but that's something for Maccy 3.x.

weisJ commented 3 months ago

The code can be found here: https://github.com/weisJ/Maccy/tree/custom/

There are some other changes in there too, but it should be possible to discern what is related to the popup. It’s also not very cleaned up currently.

I like the idea of the slideout, though some caution needs to be taken to ensure it is always visible i.e if the window is too close to the right screen edge the slideout needs to be on the left etc.

p0deje commented 3 months ago

Let's park the idea for now, I'd like to focus on releasing 2.0 without any new big features, but make sure the app behaves well with increased storage size to 9999 (memory utilization, search, etc). If I can make it happen, it's already a big win and worth its own major release.

weisJ commented 3 months ago

Sure thing 👍🏻 getting out a first release for 2.0 really is the priority here.

o000u commented 3 months ago

I haven't found a way to utilise this for moving the popover, however I have experimented with having a "detached" popover without an arrow, that updates the content if the selection changes.

I also added a shortcut for opening the popover (⌘I by default) for manual control instead of the automatic delay.

Here is how it looks like:

Screen.Recording.2024-08-04.at.12.15.49.mov

What do you think about this? Would it be worth while to add (some of) the following options:

  • Toggle visibility manually with keyboard shortcut. (The automatic delay still being an option)

    • A selection change could then either dismiss the popover or have the current open/close behaviour.
  • Have a "global" popover as in the video without an anchor. Maybe as an alternative option, though I'm not sure whether it is a good idea to bloat the settings in this regard.

I strongly agree with these two suggestions and hope that they can be realized as soon as possible. Compared to automatically delaying the display of the preview window, I really think it is much easier and faster to switch between displaying/hiding the preview window using a shortcut key (such as the spacebar) @p0deje

p0deje commented 2 months ago

Per https://www.reddit.com/r/macapps/comments/1fi6gw8/comment/lnmbpn8/

One big annoyance: The list of clips is hidden by the preview of the currently selected clip because it is no longer shown to the side of the list as in version 1.

https://youtu.be/p2235zT6ST8

weisJ commented 1 month ago

I have rebased https://github.com/weisJ/Maccy/tree/custom/ onto master. Maybe now that 2.0 has landed we can reopen the discussion for what the best approach to the info popup is.