Skip to content

Disable quick-mention on reviews without a comment - #5117

Merged
fregante merged 9 commits into
refined-github:mainfrom
kidonng:quick-mention
Dec 10, 2021
Merged

fregante merged 9 commits into
refined-github:mainfrom
kidonng:quick-mention

Conversation

@kidonng

@kidonng kidonng commented Nov 29, 2021 •

Copy link
Copy Markdown
Member

See screenshots for the issue

Also, as you can see from the screenshot, there is a z-index issue happening. However it should not happen again with this patch, but nevertheless I will leave the fix here for completeness:

wrap(avatar, <div className="avatar-parent-child TimelineItem-avatar d-none d-md-block"/>);

Add a style={{zIndex: 2}} would be fine

Test URLs

Screenshot

Before:
截屏2021-11-29 20 59 02

After:

image

Comment thread source/features/quick-mention.tsx Outdated
);

const timelineItem = avatar.closest('.js-timeline-item')!;
if (timelineItem && !timelineItem.querySelector('.timeline-comment')) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

timelineItem doesn't exist for the first "comment" (i.e. author post)

@fregante

fregante commented Nov 30, 2021 •

Copy link
Copy Markdown
Member

I'd just exclude reviews honestly 😅 like in

It's weird that this changes the spacing

@kidonng

kidonng commented Dec 2, 2021

Copy link
Copy Markdown
Member Author

Yeah that makes sense.

@kidonng kidonng changed the title Fix spacing of quick-mention items without a comment Disable quick-mention on reviews without a comment Dec 2, 2021
Comment thread source/features/quick-mention.tsx Resolved
Comment thread source/features/quick-mention.tsx Resolved
@kidonng

kidonng commented Dec 6, 2021

Copy link
Copy Markdown
Member Author

@fregante

fregante commented Dec 6, 2021

Copy link
Copy Markdown
Member

I don't see that, but I'm glad you do and can fix it 😃

Screen Shot

@kidonng

kidonng commented Dec 7, 2021

Copy link
Copy Markdown
Member Author

I don't see that

Because you don't have write access and thus that info line.

Comment thread source/features/quick-mention.tsx Resolved
Comment thread source/features/quick-mention.tsx Outdated
// The hovercard attribute avoids `highest-rated-comment`
// Avatars next to review events aren't wrapped in a <div> #4844
const avatars = select.all(`:is(div.TimelineItem-avatar > [data-hovercard-type="user"]:first-child, a.TimelineItem-avatar):not([href="/${getUsername()!}"], .rgh-quick-mention)`);
const avatars = select.all(`:is(${[

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.

I'd probably extract this array instead to avoid (`:is(${[

Common is-less example:

const avatarSelector = [

].map(x => x + ':not()');
const avatars = select.all(avatarSelector);

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.

You could also move this to the lint PR if you prefer

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.

Latest commit did not match this, let's merge this PR without it and you can make the suggested change in the lint PR if desired.

@fregante
fregante merged commit 044f1b4 into refined-github:main Dec 10, 2021
@kidonng
kidonng deleted the quick-mention branch January 9, 2022 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants