Refined-github: `batch-open-conversations` on repo without access fires too early

Created on 6 Sep 2020  路  9Comments  路  Source: sindresorhus/refined-github

image
Notice the last 2 do not have check boxes.

https://github.com/primer/octicons/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
Go into an issue and then click back
(The same happens on refined-github but gave an external link for maintainers to test)

The issue is waitfordomready: false. select-observer can be used or wait for domReady here 猬囷笍

https://github.com/sindresorhus/refined-github/blob/e1d836a2f542bb77e9510e5c5aaed2af8c572c91/source/features/batch-open-conversations.tsx#L83-L84

bug good first issue help wanted

All 9 comments

waitfordomready: false doesn鈥檛 make sense here because the last item is near the end of the page, so the DOM is ready a few milliseconds later anyway.

Generally, if we use select.all, we don鈥檛 use waitfordomready: false

@fregante I think there should be 2 inits. The if and the else do not have anything in common. WDYT?

Agreed

@fregante if we wait for dom ready there is a terrible jump
Video_2020-09-06_173729

I鈥檓 not accepting any more selector-observer refactoring until we figure out how to avoid https://github.com/sindresorhus/refined-github/issues/3527 + https://github.com/josh/selector-observer/issues/30

Also I鈥檓 not particularly fond of how this looks, due to the duplicate elementReady.

As an immediate solution, you can add a single line before the for loop: await domLoaded

The jump isn鈥檛 that big, we have other features that do the same, like shorten-links and reaction-avatars

Yeah I agree. That why I didn't open a pr before asking.
https://github.com/yakov116/refined-github/commit/8aa9447d281a4ae2cab6ddc29d29de1eb13b2e7c what about that?

I鈥檓 not particularly fond of how this looks, due to the duplicate elementReady.

you can add a single line

I thought it should be in its own init?

Ahh I missed this line - sorry

As an immediate solution, you can add a single line before the for loop: await domLoaded

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MilesBHuff picture MilesBHuff  路  3Comments

Celthi picture Celthi  路  3Comments

hkdobrev picture hkdobrev  路  3Comments

Arcanemagus picture Arcanemagus  路  3Comments

hkdobrev picture hkdobrev  路  3Comments