Skip to content

Conversation

@Garulf
Copy link
Member

@Garulf Garulf commented Dec 1, 2021

Invoking CTRL+C will copy the selected results title to clipboard.

2021-12-02.03-51-35.mp4
  • Don't copy result if Query text selected
  • Add logic to copy actual file object to clipboard

Selected Query text is copied otherwise result title is added to the clipboard.

Edited:
Invoking CTRL+C on a selected result will:

  • if the result is directory/file path, copy the actual file/folder
  • if the result is not directory/file path then the subtitle is copied
  • if the query text is highlighted, then copy the highlighted query text
  • if not above, then the selected result's subtitle is copied, but plugin can pass through the text to be copied to override this default behaviour.
  • notifications for file/folder/text copy

@Garulf Garulf added the enhancement New feature or request label Dec 1, 2021
@Garulf Garulf marked this pull request as ready for review December 2, 2021 09:15
@onesounds
Copy link
Contributor

onesounds commented Dec 2, 2021

@Flow-Launcher/team

  1. We need to discuss how to copy files as well.
  • we need to decide whether to use ctrl+c as a file copy shortcut or a path copy. ctrl+shift+c for the rest of the keys. I suggest ctrl+c as a file copy and ctrl+shift+c as a file path copy. It is recommended to follow the window basic control key as much as possible.
  1. This function requires copying the entire path. not a title.
    and There is also a slight problem with copying the subtitle area. because Subtitle result path should till parent directory & and subtitle non highlight option #706 that issue.

So, Copy the path by distinguishing between folders and files, or After reducing the path in subtitle output method, It is expected that there will be a way to copy the path in form like subtitle + Title

example
Case A: c:\programs\league\league.exe
Case B: c:\windows\configs

current version
A Title: league.exe
A subtitle : c:\programs\league\league.exe
League.exe is duplicated information.

B Title: configs
B Path: c:\windows\configs
Config is duplicated information. Users may be confused with c:\windows\configs\configs.

modify version
A Title: league.exe
A subtitle : c:\programs\league
A subtitle + A Title =c:\programs\league\league.exe

B Title: configs
B Path: c:\windows
B subtitle + B Title = c:\windows\configs

@Garulf
Copy link
Member Author

Garulf commented Dec 2, 2021

I think it's best we let the plugin delegate what's copied to clipboard. Default behavior is to copy result.Title.

We can supply a new field for plugins to populate with what they think is most relevant for the clipboard.

Should we delay this feature for this functionality?

@onesounds
Copy link
Contributor

onesounds commented Dec 2, 2021

I think it's best we let the plugin delegate what's copied to clipboard. Default behavior is to copy result.Title.

We can supply a new field for plugins to populate with what they think is most relevant for the clipboard.

Should we delay this feature for this functionality?

Yes. I don't think it's actually very useful that the default value is Title. I think most basic plugins and users will use ctrl+c as either file copy or path copy. Shortcut keys should not be inserted in a state that does not operate with this function. It is good to work for the purpose used in the plug-in, but this function must be preceded first. This is because it causes confusion if it changes in the future.

Anyway, this is my opinion, and I don't know what others think. We need to discuss more. I hate answering tightly, but your three PR take 3 hotkeys in important place. (It's in the middle of New York) The functions you choose to fix are also very important in terms of long-term UX, and I think it's better to plan ahead because if the shortcut changes, there will be confusion.

On the one hand, if we don't tell the shortcut anyway, no one will use it, and I think it's okay to put it in because it's necessary for plug-in development for now. I don't think flow launcher will be downloaded a lot.😂

@jjw24
Copy link
Member

jjw24 commented Dec 4, 2021

Agree with @onesounds to use ctrl + c  as a file copy and ctrl+shift+c as a file path copy.

I think this maybe best implemented at plugin level, where plugin decide when ctrl + c is pressed, what exactly to copy- title, subtitle, title+subtitle, or the actual file. This reduces complications because otherwise flow will have to decide in what scenario to copy what.

@Garulf you got it to copy title ATM, what scenario will require in copying title ATM?

@Garulf Garulf linked an issue Dec 8, 2021 that may be closed by this pull request
@Garulf Garulf marked this pull request as draft December 8, 2021 15:55
@Garulf Garulf marked this pull request as ready for review January 26, 2022 00:45
@Garulf Garulf added this to the 1.10.0 milestone Jan 26, 2022
@Garulf
Copy link
Member Author

Garulf commented Jan 26, 2022

Capture.24.mp4

@jjw24 jjw24 force-pushed the global-copy-to-clipboard branch from 5bf1722 to c5be5b8 Compare January 27, 2022 05:36
@jjw24 jjw24 enabled auto-merge January 27, 2022 05:41
@jjw24
Copy link
Member

jjw24 commented Jan 27, 2022

@Garulf I moved the actual copy logic into MainViewModel and added notification for file/folder/text copied. Just a FYI, general rule of thumb, avoid application/business logic in your Views, i.e. MainWindow.xaml.cs, this will make it easier when later wanting to change the view, and it follows the MVVM pattern.

@jjw24 jjw24 merged commit 150ce09 into Flow-Launcher:dev Jan 27, 2022
@Garulf Garulf deleted the global-copy-to-clipboard branch January 27, 2022 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Copy File / Folder Path in Context Menu

3 participants