Closed wmertens closed 3 years ago
Please note that navigator.clipboard.writeText
will only work on localhost
and https
sites. Since ungit can bind to other hostnames as well (or all 0.0.0.0
) this would not work in these cases.
https://web.dev/async-clipboard/#security-and-permissions
See also https://stackoverflow.com/a/30810322 for possible workarounds.
You can test this scenario by setting ungitBindIp
to 0.0.0.0
and then load ungit with http://[yourcomputername]:8448
ungit uses octicon icons everywhere else so I think it would be better to use them here too. E.g. https://primer.style/octicons/clippy-16
What do you think about making the button smaller like btn-xs
?
@campersau actually I'm a complete n00b at KO and I'm working on the nodegit branch, this was a quick hack to get a feel for it. If you were to implement your suggestions I'd be really grateful :sweat_smile: (if not, I totally understand, I'm just saying that I wouldn't feel offended in the least if you implemented this properly, on the contrary)
@wmertens How do you like that?
@campersau :100: :heart_eyes:
I just wonder how to show the button when you hover over the commit message, not the commit node. That way you can quickly copy an oid from the page.
Or just keep the button always visible regardless of mouseover?
Hmm right, I was worrying that it adds too much visual noise
@wmertens this is how you would only show the button on mouseenter
/ mouseleave
but since the button is higher than the text it moves the files a bit down when it gets rendered. So for simplicity I am going to show the button when the node is selected.
https://github.com/FredrikNoren/ungit/commit/4530d032839c868ff009abb8b603f670eb0e6879
Right now, it shows when you hover or click the commit. How can I make it also show when I just hover over the commit hash?
Should this have a test? What should it test?