Skip to content

Improve reliability of clean-conversation-headers - #5322

Merged
cheap-glitch merged 20 commits into
mainfrom
refactor-conversation-headers
Apr 10, 2022
Merged

Improve reliability of clean-conversation-headers#5322
cheap-glitch merged 20 commits into
mainfrom
refactor-conversation-headers

Conversation

@kidonng

@kidonng kidonng commented Jan 19, 2022

Copy link
Copy Markdown
Member

Fixes #5573

Goals for this PR:

Test URLs

Screenshot

Before:

image

After:

image

Comment thread source/features/first-published-tag-for-merged-pr.tsx
@kidonng kidonng linked an issue Jan 20, 2022 that may be closed by this pull request
4 tasks

@fregante fregante left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good stuff if the result is equivalent! 👌

Comment thread source/features/clean-conversation-headers.css Outdated
Comment thread source/features/clean-conversation-headers.css Outdated
Comment thread source/features/clean-conversation-headers.css Outdated
Comment thread source/features/clean-conversation-headers.tsx Outdated
@kidonng

kidonng commented Jan 20, 2022

Copy link
Copy Markdown
Member Author

Good stuff if the result is equivalent! 👌

Not exactly the same since we are comparing literal whitespaces with margins etc. But the differences should be pretty minimal.

@fregante fregante changed the title Refactor clean-conversation-headers Make clean-conversation-headers more reliable Jan 21, 2022
@kidonng
kidonng marked this pull request as draft January 21, 2022 12:43
@kidonng

This comment was marked as resolved.

@fregante

This comment was marked as resolved.

@fregante

This comment was marked as resolved.

@cheap-glitch
cheap-glitch marked this pull request as ready for review March 30, 2022 10:01
@cheap-glitch cheap-glitch changed the title Make clean-conversation-headers more reliable Improve reliability of clean-conversation-headers Mar 31, 2022
position.after(
<details
className={`details-reset details-overlay d-inline-block position-relative ${dropdownClass}`}
className={`details-reset details-overlay d-inline-block ml-2 position-relative ${dropdownClass}`}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fixed the spacing of the elements added by RGH.

Before:

before

After:

after

Comment thread source/features/clean-conversation-headers.tsx
Comment thread source/features/clean-conversation-headers.tsx

@fregante fregante left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should keep awaitDomReady: false

Comment on lines +54 to +61
async function init(): Promise<void | Deinit> {
const cleanConversationHeader = pageDetect.isIssue() ? cleanIssueHeader : cleanPrHeader;

// Wait for the initial clean-up to finish before setting up the observer #5573
if ((await cleanConversationHeader()) !== false) {
return onConversationHeaderUpdate(cleanConversationHeader);
}
}

@cheap-glitch cheap-glitch Apr 7, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems like the onConversationHeaderUpdate observer was set up too soon and ended up being triggered by the feature itself.

This makes the feature much more reliable and doesn't sacrifice speed 🏄 🌊

Comment on lines +31 to +33
.gh-header-meta .rgh-conversation-activity-filter-wrapper {
margin-bottom: 8px; /* Preserve centered vertical alignment with status badge */
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Before

before

After

after

(It's easier to add via CSS than via Primer because we only want this in the "main" header, not the sticky one.)

@fregante fregante left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yolo-deadpool

@kidonng

kidonng commented Jul 7, 2022

Copy link
Copy Markdown
Member Author

Thanks for finishing this @cheap-glitch! However the long merge window seems to caused some confusion and reverted parts of #5416 (specifically regarding first-published-tag-for-merged-pr).

@fregante

fregante commented Jul 8, 2022

Copy link
Copy Markdown
Member

I think you're specifically referring to the blue background of

Screen Shot

It took me a while to understand that 😂

@kidonng

kidonng commented Jul 8, 2022

Copy link
Copy Markdown
Member Author

Yup, I was supposed to submit a PR right after commenting 😅

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.

clean-conversation-headers is unreliable clean-conversation-headers displays incorrectly

4 participants