sindresorhus/refined-github

`batch-open-conversations` on repo without access fires too early #3534

yakov116 posted onGitHub

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


waitfordomready: false doesn’t 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’t use waitfordomready: false

posted by fregante over 4 years ago

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

posted by yakov116 over 4 years ago

Agreed

posted by fregante over 4 years ago

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

posted by yakov116 over 4 years ago

I’m 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’m 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’t that big, we have other features that do the same, like shorten-links and reaction-avatars

posted by fregante over 4 years ago

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

posted by yakov116 over 4 years ago

I’m not particularly fond of how this looks, due to the duplicate elementReady.

you can add a single line

posted by fregante over 4 years ago

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

posted by yakov116 over 4 years ago

Fund this Issue

$0.00
Funded

Pull requests