RedditEnhancer icon indicating copy to clipboard operation
RedditEnhancer copied to clipboard

(BUG) Auto Show Formatting Options when commenting does not worked

Open dnet890 opened this issue 1 year ago • 2 comments

Hi I tried the new new Reddit UI and toggle the Auto Show Formatting Options when commenting. But, the thing is it does not automatically load unless I toggle it manually. What do you think? 2024-09-19_01-06

dnet890 avatar Sep 18 '24 16:09 dnet890

I'm not sure, it's still working for me. When you click "Reply" on a comment, does it not enable the formatting options for that either?

joelacus avatar Sep 19 '24 20:09 joelacus

it is quite erratic. sometimes it does not appear and I have to click the T button or the comment button again to make it appear

dnet890 avatar Sep 20 '24 01:09 dnet890

@joelacus after extension update to version 1.12 it looks like I need to refresh the webpage again to make sure the toolbar appear again. What do you think? 2024-10-21 09-24-21.flv.zip

dnet890 avatar Oct 21 '24 00:10 dnet890

I think I kinda figured out what the problem was:

  1. ASFOWC only executes when comment-body-header is attached to the page; this element only shows up on full post pages routename='post_page' and not on comment thread pages routename='comment_page';
  2. waitForAddedNode only runs once and does not execute again, which means hidden comments (x more replies) and new batch of comments (as user scrolls down to the end of the current batch) won't have the listener attached;
  3. the listener can be attached multiple times, which repeatedly opens and closes the formatting toolbar.

I've rewritten this feature and placed an MutationObserver that would look for new comments and attach the listener instead. So far things are looking more promising, but I won't bet on it working perfectly all the time.

bmndc avatar Feb 10 '25 17:02 bmndc