serenity icon indicating copy to clipboard operation
serenity copied to clipboard

Clipboard: Add persistent storage for clipboard entries

Open sagittarius-a opened this issue 3 years ago • 5 comments

A clipboard entry can be set as persistent to survive reboots. Persistence is configured globally thanks to a setting in the Settings/Keyboard menu.

Clipboard window can now be toggled by clicking on the icon in the status bar. If the window is already open but not in front, it will be focused. This way, one can easily access the clipboard entries.

An entry is defined as (non-)persistent by right clicking on it in the clipboard window and use "Toggle persistence" action. This action is available only if clipboard persistence is enabled globally.

If persistence is enabled globally, clipboard content will be loaded when the ClipboardHistory applet is started. If one change the global settings, the applet should be restarted to automatically load clipboard content.

Partially addresses #4051


Known limitations:

  • If window is minimized, impossible to show it again without calling hide() beforehand
  • Rightclick menu label does not change based on persistence status. Here is the expected behaviour eventually:
    • "Set as persistent" when the current entry is not persistent
    • "Unset as persistent" when the current entry is persistent
  • Sorting does not work when clicking headers in the clipboard window

sagittarius-a avatar Aug 17 '22 22:08 sagittarius-a

Hello!

One or more of the commit messages in this PR do not match the SerenityOS code submission policy, please check the lint_commits CI job for more details on which commits were flagged and why. Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.

BuggieBot avatar Aug 17 '22 22:08 BuggieBot

Thanks for your thorough review :heart: I'm currently working of applying your suggestions.

On a side note:

What about placing the clipboard configuration in a new tab under Settings->Keyboard ? It would scope configuration related to clipboard in a dedicated space instead of clobbering the existing one dedicated to keyboard specific configuration.

Or create a new entry in Settings altogether, but it seemed a bit overkill at the time (since a single option was available).

sagittarius-a avatar Aug 21 '22 21:08 sagittarius-a

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!

stale[bot] avatar Sep 12 '22 06:09 stale[bot]

Hello again @alimpfard,

I still have a conversation pending in the current merge request. I did not want to resolve it since I'm not sure the new implementation is compliant with your expectations.

No urgency here, just noticed the PR is now stale and may still be relevant to merge.

sagittarius-a avatar Sep 13 '22 19:09 sagittarius-a

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!

stale[bot] avatar Oct 06 '22 03:10 stale[bot]

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!

stale[bot] avatar Nov 05 '22 05:11 stale[bot]

This pull request has been closed because it has not had recent activity. Feel free to re-open if you wish to still contribute these changes. Thank you for your contributions!

stale[bot] avatar Nov 12 '22 06:11 stale[bot]