[GH-ISSUE #397] Use Ctrl Modifier to Select Files #310

Open
opened 2026-02-25 21:31:40 +03:00 by kerem · 2 comments
Owner

Originally created by @Ionshard on GitHub (Jul 4, 2021).
Original GitHub issue: https://github.com/ciur/papermerge/issues/397

Originally assigned to: @ciur on GitHub.

Currently to select files in Papermerge you either need to select the checkbox on a file or use the rectangle selection. This can make it difficult to select many files that are not all in the same location.

When using a file editor in any major OS they support using the Control key as a way to add to the selection.

Thus with Papermerge I think it would be nice if it supported this as well. If I hold down the control key and click a document, rather than navigating to the document itself it would be nice to just select the document instead.

I understand that on the web that Ctrl+Click can also mean to open up in a new tab. However testing on my local papermerge installation it appears that Ctrl+Click doesn't currently open a new tab. So this request wouldn't change any existing behavior with the application.

Originally created by @Ionshard on GitHub (Jul 4, 2021). Original GitHub issue: https://github.com/ciur/papermerge/issues/397 Originally assigned to: @ciur on GitHub. Currently to select files in Papermerge you either need to select the checkbox on a file or use the rectangle selection. This can make it difficult to select many files that are not all in the same location. When using a file editor in any major OS they support using the Control key as a way to add to the selection. Thus with Papermerge I think it would be nice if it supported this as well. If I hold down the control key and click a document, rather than navigating to the document itself it would be nice to just select the document instead. I understand that on the web that Ctrl+Click can also mean to open up in a new tab. However testing on my local papermerge installation it appears that Ctrl+Click doesn't currently open a new tab. So this request wouldn't change any existing behavior with the application.
Author
Owner

@Ionshard commented on GitHub (Jul 4, 2021):

Putting on my developer hat for a minute. I think this might be pretty easy to do. Maybe I'll try to get the code running locally and see if I can help out if this is an acceptable solution.

Looking at the papermerge JS code. In the browse.js view you already have a really useful select_node_by_cid that you call when the checkbox is clicked and in the on_node_clicked_handler you are getting the cid to open the node anyways.

Looks like it should be possible to grab the state of the Control Key from the mouse event and just call the select_node_by_cid function instead.

Looks like there may be some additional handling to handle the UI updates that are in the on_checkbox_clicked that would need to be refactored.

If I am not crazy and missing something obvious and you are open to contributions let me know and I can give it a shot. Otherwise you probably don't need the help to do it yourself and can ignore everything I said above 😝

<!-- gh-comment-id:873608876 --> @Ionshard commented on GitHub (Jul 4, 2021): Putting on my developer hat for a minute. I think this might be pretty easy to do. Maybe I'll try to get the code running locally and see if I can help out if this is an acceptable solution. Looking at the papermerge JS code. In the browse.js view you already have a really useful `select_node_by_cid` that you call when the checkbox is clicked and in the on_node_clicked_handler you are getting the cid to open the node anyways. Looks like it should be possible to grab the state of the [Control Key from the mouse event](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/ctrlKey) and just call the `select_node_by_cid` function instead. Looks like there may be some additional handling to handle the UI updates that are in the `on_checkbox_clicked` that would need to be refactored. If I am not crazy and missing something obvious and you are open to contributions let me know and I can give it a shot. Otherwise you probably don't need the help to do it yourself and can ignore everything I said above 😝
Author
Owner

@ciur commented on GitHub (Jul 5, 2021):

@Ionshard, yes, indeed, it is not that hard to add. However, please note that I am refactoring most of the code out of papermerge JS into smaller npm packages. The part responsible for selection is now in commander-js.

<!-- gh-comment-id:874302769 --> @ciur commented on GitHub (Jul 5, 2021): @Ionshard, yes, indeed, it is not that hard to add. However, please note that I am refactoring most of the code out of papermerge JS into smaller npm packages. The part responsible for selection is now in [commander-js](https://github.com/papermerge/commander-js/blob/master/document-commander/views/commander.js).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/papermerge#310
No description provided.