makeread.me icon indicating copy to clipboard operation
makeread.me copied to clipboard

Support Multiple of The Same Block

Open ShaanCoding opened this issue 1 year ago • 1 comments

Feature Details

Following up from #92 as this UX was intrusive from the user, in #92 I've decided to hide / remove this functionality on the UI to prevent this issue from occurring until a fix for colliding template names / UUID is resolved.

Do what was discussed in #92

ShaanCoding avatar May 07 '24 10:05 ShaanCoding

Notes

From @MathPow

Describe the bug

When we add blocks from the current template, nothing seems to update in the preview but we can see the change in the blocks area. If we select "Add Block" from an other template on the right (with the new feature), it works fine.

To Reproduce

Steps to reproduce the behavior:

  1. Go to othneildrew-best-readme-template
  2. Click on 'Add Block' from any of the option of the right. It needs to be a block from the current template
  3. Scroll down to the bottom of the page
  4. See that nothing updates in the preview

Expected behavior

We want the markedown preview to update in real time everytime

Screenshots

image

From @ShaanCoding

I think this is due to the useEffect that generates the template not containing blocks to regenerate it upon adding. As usually on a new block being added a macro is added, which is not the case for duplicate blocks.

Another issue here is they share the same keys, and thus will share the same form values / cause conflicts. As they use global values, we need to uplift #24, or generate new UUID keys on query or just make it 1 block per template as realistically you would never need 2 duplicate sections

ShaanCoding avatar May 07 '24 10:05 ShaanCoding