Maccy icon indicating copy to clipboard operation
Maccy copied to clipboard

Limit the size of the popup but leave older items

Open thysm00 opened this issue 4 years ago • 16 comments

I know i can limit the number of items in the list manually, but when i do that, i can no longer access them unless i search for them (which means i remember what they contained). I've seen that in other apps, but wouldn't it be possible to have a submenu under the list the show the rest of the items that Maccy remembers? This way, the menu stays small for most usage but when you need to find an older item, you can still do it even if you don't remember precisely what it was.

thysm00 avatar Jan 14 '21 09:01 thysm00

How would you find the item if you don't remember what it was? If you remember at least a part of the text, this should be enough, shouldn't it?

p0deje avatar Jan 25 '21 20:01 p0deje

Well, if it's for example a phone number, a name or email, a serial number (i sell softwares), it's usually impossible to remember any part of it. I've been using clipmenu for years, and it happened to me hundreds of times to have to copy something i did not remember.

thysm00 avatar Jan 26 '21 09:01 thysm00

That's why being able to go through the whole list is important even if and i agree, searching through them is good. The other reason why submenus could be useful is that you still get a small popup but it can contain many items.

thysm00 avatar Jan 26 '21 09:01 thysm00

My 2c: I find it useful to have an arbitrary tag for pinned entries. I have tons of pinned entries for things like URLs of public facing documentation, contracts, registration and bank account numbers. What I do now, is put save some text in UPPERCASE: Works super for searching, typically I just use the keyboard and do not even look an my MANUAL: url is pasted. (Problem is that I have to delete the tag preceding a URL when I paste into a browser, that could be solved by a tag that is not by default pasted)

-- one day all computers will be made this way 🤔 Thanks Alex for this master-work 😊

allomorphy avatar Jan 26 '21 10:01 allomorphy

I second @thysm00's request. I think having the last X items displayed and the rest of them under a submenu would be nice to un-clutter the main menu. I love how ClipMenu handles this:

image

image

sveggiani avatar Mar 25 '21 13:03 sveggiani

I think I've found a way to show a smaller popup and then the rest could be scrolled. It will look like this: Screen Shot 2021-07-02 at 12 50 33

Would that work for your case?

p0deje avatar Jul 02 '21 19:07 p0deje

Yes, that would definitely work for me! And would indeed be even better than the sub menus!

thysm00 avatar Jul 04 '21 08:07 thysm00

@p0deje I think the scrollable would work and solve the inconvenience of having a very long list of items.

sveggiani avatar Jul 14 '21 23:07 sveggiani

Another use case is having a weird Unicode character in the history, like a middle dot or something – that cannot be easily searched for.

Scrolling as shown above looks like a great solution! 👍

borekb avatar Aug 21 '21 18:08 borekb

I was going to suggest this but I am happy to see the author came to the same conclusion.

kerryj89 avatar Oct 10 '21 06:10 kerryj89

There are a lot of edge cases when trying to force menu height using confinementRect(for:on:):

  1. It seems like it's completely ignored when showing a popup by clicking on the menu icon.
  2. It works on the main display, but doesn't on the secondary.
  3. The direction of the popup needs to be handled manually (e.g. it should draw below the cursor by default, but when the cursor is at the bottom of the screen - it should draw above the cursor).
  4. Similar to previous, the popup should offset to the left when part of the menu is wider than the screen (e.g. popup when the cursor is near the right edge of the screen).

The dummy reference implementation which limits height to 250px is done by add this to Menu.swift:


  func confinementRect(for menu: NSMenu, on screen: NSScreen?) -> NSRect {
    var x: CGFloat = 0
    var y: CGFloat = 0

    switch UserDefaults.standard.popupPosition {
    case "center":
      if let screen = screen {
        let topLeftX = (screen.visibleFrame.width - menu.size.width) / 2 + screen.visibleFrame.origin.x
        var topLeftY = (screen.visibleFrame.height + menu.size.height) / 2 + screen.visibleFrame.origin.y
        if screen.visibleFrame.height < menu.size.height {
          topLeftY = screen.visibleFrame.origin.y
        }

        x = topLeftX + 1
        y = topLeftY + 1
      }
    default:
      x = NSEvent.mouseLocation.x
      y = NSEvent.mouseLocation.y
    }

    return NSRect(x: x, y: y - CGFloat(250) - 1, width: menu.size.width, height: 250)
  }

Given the existing problems, I'm not sure if I find a way to make it work reliably.

p0deje avatar Jun 03 '22 20:06 p0deje

An alternative approach could be:

  • using more than 1 column for viewing the list of text on the popup menu
  • using the arrow down/up keys for selecting the desired text as currently
  • using the arrow left/right keys for going forward/backward in the pagination
  • moving the shortcut keys ( ⌘1 to ⌘9 ) along the pagination

juarezr avatar Nov 09 '22 18:11 juarezr

@p0deje Has there been any progress in implementing this feature? I would love to be able to limit the height of the popup to 20 items, but be able to scroll through my entire history.

robert-d-94 avatar Aug 18 '23 21:08 robert-d-94

Nothing new since my last comment. On Aug 18, 2023, at 14:16, robert-d-94 @.***> wrote: @p0deje Has there been any progress in implementing this feature? I would love to be able to limit the height of the popup to 20 items, but be able to scroll through my entire history.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

p0deje avatar Aug 18 '23 21:08 p0deje

This would be awesome!

itdhsc avatar Feb 28 '24 13:02 itdhsc

I think I've found a way to show a smaller popup and then the rest could be scrolled. It will look like this: Screen Shot 2021-07-02 at 12 50 33

Would that work for your case?

This is a very good solution! But i found only at the botton of the screen, this type of popup will function, is it possible to limit all popup height anywhere it appears?

chenxiccc avatar Apr 07 '24 08:04 chenxiccc