Refined-github: `show-whitespace` doesn鈥檛 work on newly sent suggestions

Created on 3 Mar 2020  路  8Comments  路  Source: sindresorhus/refined-github

Peek 2020-03-03 16-01

bug help wanted

Most helpful comment

Anyway, no special events seem to be available. The only solution I can think of:

o = new MutationObserver(runUpdates);

for commentHolders of select.all('.diff-table tbody, .js-comments-holder')
    o.observe(commentHolders, {childList: true})

This should probably be part of on-new-comments somehow. After #2987

All 8 comments

No, I checked that for PRs (hence the "start a review" button).

Checked again, the issue still persists.

I am only seeing it on the PR Files Tab.

That's what I'm talking about... Files changed... I guess I could've said that at the beginning :P

While looking for this I figured out an easy way to see GitHub's event names:

d = Node.prototype.dispatchEvent;
Node.prototype.dispatchEvent = function (...a) {
    console.log(...a);
    // debugger; // Uncomment when necessary
    d.apply(this, a);
}

screen

Anyway, no special events seem to be available. The only solution I can think of:

o = new MutationObserver(runUpdates);

for commentHolders of select.all('.diff-table tbody, .js-comments-holder')
    o.observe(commentHolders, {childList: true})

This should probably be part of on-new-comments somehow. After #2987

I really think that https://github.com/sindresorhus/refined-github/issues/3084 should fix all of our problems, it should be revisited: https://github.com/sindresorhus/refined-github/pull/3092

That PR probably just needs an efficient mechanism to avoid applying changes to the same element.

@fregante any reason we can't listen on socket:message events and handle everything from there?

If it works, sure, but I think updates can happen seconds _after_ the event.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

supremebeing7 picture supremebeing7  路  3Comments

hkdobrev picture hkdobrev  路  3Comments

fregante picture fregante  路  3Comments

olso picture olso  路  3Comments

alexanderadam picture alexanderadam  路  3Comments