RoamJS / workbench

https://roamjs.com/extensions/workbench
The Unlicense
286 stars 35 forks source link

Privacy Mode: Improve UX #394

Open mdroidian opened 1 year ago

mdroidian commented 1 year ago

from: https://github.com/dvargas92495/roamjs-workbench/pull/391

Blank roam pages get deleted by default, so WorkBench Privacy Mode List doesn't get created for the user. As a user, this requires multiple clicks/reading to understand how the plugin functions.

Proposed solution:

Create the page with a block of instructions:

  Promise.resolve(
        createPage({ title: roamPageWithPrivacyList })
      ).then((parentUid) =>
        createBlock({ node: { text: `Add \`pages\` or \`tags\` to be redacted below.  By default, the full block tree will be redacted. If you would like to redact just the page name, then add an exclamation mark \`!\`.  See more info at https://roamjs.com/extensions/workbench/privacy_mode` }, parentUid })
      );

Refactor getPrivateBlockDetails() to only include blocks that match a page / tag so that if (!privacyDefined.length) toast triggers only if nothing is defined.

This will also make the redirect to roamPageWithPrivacyList will work again.

Also, rename page to roam/js/privacy-mode to stay consistent with config page naming conventions.