Add right click context menu on all text inputs #1486
Labels
No labels
accessibility
app-parity
area: creator
area: daemon
area: design
area: devops
area: discovery
area: docs
area: installer
area: internal
area: livestream
area: performance
area: proposal
area: reposts
area: rewards
area: search
area: security
area: subscriptions
area: sync
area: ux
area: viewer
area: wallet
BEAMER
channel
comments
community PR
consider soon
core team
css
dependencies
electron
Epic
feature request
first-timers-only
good first issue
hacktoberfest
help wanted
hub-dependent
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
merge when green
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
notifications
odysee
on hold
playlists
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
recsys
redesign
regression
resilience
sdk dependent
Tom's Wishlist
trending
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry-desktop#1486
Loading…
Reference in a new issue
No description provided.
Delete branch "right-click-menu-context"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi this PR partially fix: #1470, this pr adds the right click menu only on text inputs and copy/cut/paste works, also if you are in development mode it will show "open developers tools".
So currently works on this two items:
1.) if the copy cut paste will be enforced in the search bar then i'd recommend a "select all" option as well.
3.) If there is nothing in the search, the cut and copy can be greyed out leaving the paste option visible if there is something on the clipboard otherwise also greyed.
On this one:
2.) A right click on any of the videos can give options like copy video url or any other information on the video that copy cut paste.
I need to figure out what's the best approach to fix this one, if you have an idea, let me know!
Thanks for the PR @dan1d! We already have some code for the context menu here: https://github.com/lbryio/lbry-app/blob/master/src/main/menu/setupContextMenu.js
That would be a better place to add this.
Hi @seanyesmunt ,
After looking around on others libraries that handlesContext and reading the electron documentation, it took me a lot of testing/moving/copiying/looking other people solutions/react context menu libraries, I think I have the easiest and correct solution, I've realized that we can call the function
onContextMenu
on any component(if I knew this before It would saved me a lot of reading on github issues)I know you suggested on discord to move it to
renderer/
folder, but I think the context menu shouldn't be a component as It can be easily modified.I've deleted the code under
src/menu/setupContextMenu.js
and moved it toutil/contextMenu
which has a few functions exported to open the desired menu, if it is an input then it open this one:If it is a video link, the react component can be customized to open a different context menu:
Currently when I copy the link I get an url copied like this one:
lbry://why-i-m-bullish-but-selling-alts#19d0d7e3a3c17303d4b69fcc2b78512dd58c74db
, how I should build the url to be able to share it to others users and when they click the link the lbry-app is the one that opens that link?, is there a service to use ?Also, could you take a look at the new code on this PR please?
Also I can add a snackbar notification when the link is copied if it is required, I've only added the copy link feature just to the home page but it can be added on a lot of others components.
The code is also development aware so it will only show the
inspect element
option only if the environment is DEV.Daniel
Hi @seanyesmunt I've updated the code on this PR to parse an URI and added a new PR on lbry-redux, read my PR comment on lbry-redux!
So for example given this URI:
lbry://why-doesn-t-capitalism-work-for#36cd5b217bcc4083a6fc35cc4de2cc1196581ef9
it will convert it to this
https://open.lbry.io/why-doesn-t-capitalism-work-for#36cd5b217bcc4083a6fc35cc4de2cc1196581ef9
and now the link can be shared by just copying the link when right click is pressed on a video card.
@skhameneh