feat: bug report page & clipboard data inspector#8317
Conversation
… copy-paste from user
| {:name :bug-report | ||
| :view bug-report/bug-report}] | ||
|
|
||
| ["/bug-report-tool/:tool" |
There was a problem hiding this comment.
non-blocking: Better hide it under "Developer mode".
There was a problem hiding this comment.
IMO hiding it in Dev mode is not a good idea 👀
There was a problem hiding this comment.
IMO this is a feature orienting to the users. 🤔
… copy-paste from user
64002dd to
902330a
Compare
|
Just rebase to the current master. It's upgraded to Electron 20 |
andelf
left a comment
There was a problem hiding this comment.
Looks good. Let's deliver it.
Also add missing label to bug report url
* feat: init page route for bug-report * feat: navigate to bug-report page in dropdown-menu * feat: add route for bug report tools * feat: export clipboard to map * fix: set-step! in promise and remove unused state * chore: there is no need to actively read from clipboard, just waiting copy-paste from user * chore: only parse dataTransfer * feat: initially done the clipboard data inspector * fix: use `util/copy-to-clipboard!` instead * feat: init page route for bug-report * feat: navigate to bug-report page in dropdown-menu * feat: add route for bug report tools * feat: export clipboard to map * fix: set-step! in promise and remove unused state * feat: initially done the clipboard data inspector * fix: use `util/copy-to-clipboard!` instead * fix: remove unused `:require` * ux: finetune clipbard inspector and bug report * feat: component `report-item-button` * fix: update text for clarity * fix: add subtext to button to fix lint error * fix: add missing argument * fix: change bg color to logseq css variable * fix: remove redundant div box in `report-item-button` Co-authored-by: Junyi Du <junyidu.cn@gmail.com> Co-authored-by: Bad3r <bad3r@protonmail.com>
Also add missing label to bug report url
Also add missing label to bug report url
| [:input.form-input.is-large.transition.duration-150.ease-in-out {:type "text" :placeholder "Long press here to paste if you are on mobile"}] | ||
| [:div.flex.justify-between.items-center.mt-2 | ||
| [:div "Something wrong? No problem, click here to go to the previous step."] | ||
| (ui/button "Go back" :on-click #(util/open-url (rfe/href :bug-report)))])) |
There was a problem hiding this comment.
This :on-click pointed here will mess up the history stack since it pushes the href to the stack instead of popping, as the following screen recording shows.
Kapture.2023-01-15.at.16.19.51.mp4
* feat: init page route for bug-report * feat: navigate to bug-report page in dropdown-menu * feat: add route for bug report tools * feat: export clipboard to map * fix: set-step! in promise and remove unused state * chore: there is no need to actively read from clipboard, just waiting copy-paste from user * chore: only parse dataTransfer * feat: initially done the clipboard data inspector * fix: use `util/copy-to-clipboard!` instead * feat: init page route for bug-report * feat: navigate to bug-report page in dropdown-menu * feat: add route for bug report tools * feat: export clipboard to map * fix: set-step! in promise and remove unused state * feat: initially done the clipboard data inspector * fix: use `util/copy-to-clipboard!` instead * fix: remove unused `:require` * ux: finetune clipbard inspector and bug report * feat: component `report-item-button` * fix: update text for clarity * fix: add subtext to button to fix lint error * fix: add missing argument * fix: change bg color to logseq css variable * fix: remove redundant div box in `report-item-button` Co-authored-by: Junyi Du <junyidu.cn@gmail.com> Co-authored-by: Bad3r <bad3r@protonmail.com>
Also add missing label to bug report url




close #8309
@cnrpman I made a simple bug report page and a clipboard data inspector.
Mechanism of clipboard data inspector
When a paste event occurs, the inspector does these things.
(.-clipboardData e)(.-items data)=>Array<{kind:string, type:string}>(.-types data)=>Array<{kind:string, data: string}>. Notes thatdatais read by(.getData data type)(.-files data)=>Array<{name:string, type:string, size:number}>conjthen into a{}For example, if I copy these codes from vscode.
The output will be
{ "items": [ { "kind": "string", "type": "text/plain" }, { "kind": "string", "type": "text/html" }, { "kind": "string", "type": "vscode-editor-data" } ], "types": [ { "type": "text/plain", "data": "#?(:cljs\n (defn copy-to-clipboard!\n ([s]\n (utils/writeClipboard (clj->js {:text s})))\n ([s html]\n (utils/writeClipboard (clj->js {:text s :html html})))))" }, { "type": "text/html", "data": "<meta charset='utf-8'><div style=\"color: #abb2bf;background-color: #23272e;font-family: Fira Code ,PingFang SC, Menlo, Monaco, 'Courier New', monospace;font-weight: normal;font-size: 12px;line-height: 18px;white-space: pre;\"><div><span style=\"color: #abb2bf;\">#?(</span><span style=\"color: #56b6c2;\">:cljs</span></div><div><span style=\"color: #abb2bf;\"> (</span><span style=\"color: #d19a66;\">defn</span><span style=\"color: #abb2bf;\"> </span><span style=\"color: #61afef;\">copy-to-clipboard!</span></div><div><span style=\"color: #abb2bf;\"> ([</span><span style=\"color: #e06c75;\">s</span><span style=\"color: #abb2bf;\">]</span></div><div><span style=\"color: #abb2bf;\"> (</span><span style=\"color: #e5c07b;\">utils</span><span style=\"color: #e06c75;\">/</span><span style=\"color: #61afef;\">writeClipboard</span><span style=\"color: #abb2bf;\"> (</span><span style=\"color: #61afef;\">clj->js</span><span style=\"color: #abb2bf;\"> {</span><span style=\"color: #c678dd;\">:text</span><span style=\"color: #abb2bf;\"> </span><span style=\"color: #e06c75;\">s</span><span style=\"color: #abb2bf;\">})))</span></div><div><span style=\"color: #abb2bf;\"> ([</span><span style=\"color: #e06c75;\">s</span><span style=\"color: #abb2bf;\"> </span><span style=\"color: #e06c75;\">html</span><span style=\"color: #abb2bf;\">]</span></div><div><span style=\"color: #abb2bf;\"> (</span><span style=\"color: #e5c07b;\">utils</span><span style=\"color: #e06c75;\">/</span><span style=\"color: #61afef;\">writeClipboard</span><span style=\"color: #abb2bf;\"> (</span><span style=\"color: #61afef;\">clj->js</span><span style=\"color: #abb2bf;\"> {</span><span style=\"color: #c678dd;\">:text</span><span style=\"color: #abb2bf;\"> </span><span style=\"color: #e06c75;\">s</span><span style=\"color: #abb2bf;\"> </span><span style=\"color: #c678dd;\">:html</span><span style=\"color: #abb2bf;\"> </span><span style=\"color: #e06c75;\">html</span><span style=\"color: #abb2bf;\">})))))</span></div></div>" }, { "type": "vscode-editor-data", "data": "{\"version\":1,\"isFromEmptySelection\":false,\"multicursorText\":null,\"mode\":\"clojure\"}" } ], "files": [] }Screenshots
Clipboard data can be collected on both PC and phone.
Kapture.2023-01-12.at.12.52.24.mp4
Kapture.2023-01-12.at.13.00.36.mp4
Reviews