roam-toolkit icon indicating copy to clipboard operation
roam-toolkit copied to clipboard

Find & Replace for block

Open Stvad opened this issue 5 years ago • 5 comments
trafficstars

would be nice to support children too, but it's hard unless they all are visible

Stvad avatar Mar 23 '20 01:03 Stvad

I'd love to help get this started as it's a pretty critical feature missing from Roam. Trouble is that when I clone the project and try to run it at v.0.2.0, I get:

Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".

Error Screenshot

@Stvad @ymdevs and/or @panpiotrs Is there any chance one of you'd be willing to hop on a screenshare with me to troubleshoot this and to discuss initial ideas for how this feature could/should work?

clozach avatar Apr 28 '20 00:04 clozach

ah, I need to update dev instructions - revert the following commit locally & rebuild to make it work: https://github.com/roam-unofficial/roam-toolkit/commit/20ad9560b7cfaf71adf65dbc3645b3554c2ab598

Stvad avatar Apr 28 '20 03:04 Stvad

given that there is no write access to Datalog (would've been very handy here). I imagine you need something like:

  • Trigger search mode (when Roam expands all the blocks on the page)
  • Find the blocks with matching text
  • Activate them one by one and do the replacement.

It's gonna be slow

Stvad avatar Apr 28 '20 03:04 Stvad

Ok. Maybe I'll start with something simpler, then. See https://github.com/roam-unofficial/roam-toolkit/issues/48.

clozach avatar Apr 28 '20 05:04 clozach

@clozach,

Thank you for mentioning me. I now get to learn about a new and exiting extension 😊 Though this is not my chrome extension, I only made the starter code for it. I am not sure that I can help with particular features on this extension, but general questions about the how extensions work I can try answering.

ymdevs avatar Apr 30 '20 04:04 ymdevs