Skip to content

Conversation

@kidonng
Copy link
Member

@kidonng kidonng commented Jul 27, 2020

Resolves #3089

Open issue

image

Test: https://github.com/sindresorhus/refined-github/issues/14

Note: if someone just created a PR to close the issue or someone edited currently displayed PR, GitHub will update the header and this feature won't reapply

Open issue with pending PR

image

Test: https://github.com/sindresorhus/refined-github/issues/343

Closed issue

image

Test: https://github.com/sindresorhus/refined-github/issues/3370

Open PR (to default branch)

image

Test: https://github.com/sindresorhus/refined-github/pull/3227

Open PR (to non-default branch)

image

Test: https://github.com/Kenshin/simpread/pull/698

Merged PR (same author, to default branch)

image

Test: https://github.com/sindresorhus/refined-github/pull/3402

Merged PR (different author, to default branch)

image

Test: https://github.com/sindresorhus/refined-github/pull/3033

@kidonng kidonng changed the title Add clean-conversation-headers feature Add clean-conversation-headers feature Jul 27, 2020
@kidonng
Copy link
Member Author

kidonng commented Jul 27, 2020

Concern: hiding base ref will lose the ability to switch base Fixed

@kidonng kidonng marked this pull request as ready for review July 27, 2020 18:13
@yakov116
Copy link
Member

Your hiding it or removing it?

@kidonng
Copy link
Member Author

kidonng commented Jul 27, 2020

Your hiding it or removing it?

Actually remove it

I'm thinking about if you are the author of have permission to edit an open PR, the base will still display

@yakov116
Copy link
Member

yakov116 commented Jul 27, 2020

That will break a few features
enable-file-links-in-compare-view and cross-deleted-pr-branches

@kidonng
Copy link
Member Author

kidonng commented Jul 27, 2020

Actually it's slicing and replacing, it should not affect existing features (except the switch base one I mentioned)

cross-deleted-pr-branches

See the screenshot it's still working

@kidonng kidonng marked this pull request as draft July 27, 2020 18:30
@kidonng
Copy link
Member Author

kidonng commented Jul 27, 2020

I figured out if the switch base dropdown isn't removed, it still works even if you remove the base branch text

2UmKXNNGen

@kidonng kidonng marked this pull request as ready for review July 27, 2020 19:46
@kidonng
Copy link
Member Author

kidonng commented Jul 27, 2020

Note the PR author is always shown if you are not on the conversation list

image

About the screenshot, there are too many situations to show, maybe just pick some from #3089?

@kidonng kidonng marked this pull request as draft July 29, 2020 17:47
@fregante
Copy link
Member

About the screenshot, there are too many situations to show, maybe just pick some from #3089?

Use a PR and make a before/after view of the header

@fregante
Copy link
Member

fregante commented Aug 8, 2020

I hope to see this merged soon!

@kidonng
Copy link
Member Author

kidonng commented Aug 8, 2020

😁 Yeah I will finish these PR today (or tomorrow), just submitted 3 PR to different icon extensions fixing compatibility with Refined GitHub.

@kidonng kidonng marked this pull request as ready for review August 9, 2020 16:17
Copy link
Member

@fregante fregante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested it yet, but the rest seems ok


// Removes: [octocat opened this issue on 1 Jan] · 1 comments
for (const node of Array.from(childNodes).slice(0, 4)) {
node.remove();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's best to also hide this

Suggested change
node.remove();
node.hidden = true;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a text node

image

@fregante
Copy link
Member

I think that many features using selector-observer can use waitForDomReady: false

Copy link
Member

@fregante fregante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work great! except waitForDomReady

Can you (always) provide testing links? Especially for rare situations like non-default base branch PRs

@fregante fregante merged commit 6bba1c5 into refined-github:master Aug 13, 2020
@yakov116
Copy link
Member

I get

refined-github.js:18097 Uncaught (in promise) TypeError: Cannot read property 'textContent' of null
    at getBranches (refined-github.js:18097)
    at MutationObserver.addButton (refined-github.js:18152)
getBranches @ refined-github.js:18097
addButton @ refined-github.js:18152
childList (async)
(anonymous) @ updatable-content.ts:79
he @ scroll-anchoring.esm.js:43
me @ scroll-anchoring.esm.js:2
ve @ updatable-content.ts:60
u @ updatable-content.ts:39
async function (async)
u @ updatable-content.ts:24
setTimeout (async)
(anonymous) @ updatable-content-observer.ts:22
cs @ socket-channel.ts:43
receive @ socket-channel.ts:93
AliveSessionProxy.worker.port.onmessage @ socket-channel.ts:61
refined-github.js:7305 Uncaught TypeError: Cannot read property 'textContent' of null
    at add (refined-github.js:7305)
    at runAdd (refined-github.js:3558)
    at applyChanges (refined-github.js:3474)
    at SelectorObserver.handleRootMutations (refined-github.js:4000)

When I open a new pr and I get errors if you switch tabs too quickly

@yakov116 yakov116 mentioned this pull request Aug 18, 2020
@kidonng kidonng deleted the clean-conversation-headers branch August 24, 2020 13:06
@kidonng
Copy link
Member Author

kidonng commented Aug 27, 2020

Can you (always) provide testing links? Especially for rare situations like non-default base branch PRs

Late reply: I forgot to include the URL when I uploaded the screenshots 😅 already added them to make future debug easier

@fregante
Copy link
Member

Thanks! Especially when adding new features, PRs serve as documentation for the feature, so it's great to be able to open the original PR and instantly see what it was supposed to look like and where exactly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Cleanup conversation headers

3 participants