Skip to content

Small bug fixes - #4444

Merged
fregante merged 33 commits into
mainfrom
dep
Jun 10, 2021
Merged

fregante merged 33 commits into
mainfrom
dep

Conversation

@yakov116

@yakov116 yakov116 commented Jun 4, 2021 •

Copy link
Copy Markdown
Member

Fixes #3945

Make features faster closes #3673

@yakov116
yakov116 marked this pull request as ready for review June 4, 2021 14:58
@yakov116 yakov116 changed the title lint Lint and small bug fixes Jun 4, 2021
@yakov116 yakov116 added the meta Related to Refined GitHub itself label Jun 4, 2021
Comment thread source/features/latest-tag-button.tsx Resolved
Comment thread source/features/list-prs-for-file.tsx Resolved
Comment thread source/features/list-prs-for-file.tsx Resolved
Comment thread source/features/show-whitespace.tsx Resolved
@yakov116
yakov116 marked this pull request as draft June 4, 2021 16:45
@fregante

fregante commented Jun 5, 2021

Copy link
Copy Markdown
Member

#4444 nice.

@fregante

fregante commented Jun 6, 2021

Copy link
Copy Markdown
Member

Can you also drop the comment at the top of refined-github.ts since we’re going to use hotfixes from now on?

@fregante

fregante commented Jun 6, 2021

Copy link
Copy Markdown
Member

What's b45b4bb? It's not mentioned in the post and there are no test links or bug issues

@yakov116

yakov116 commented Jun 6, 2021 •

Copy link
Copy Markdown
Member Author

What's b45b4bb? It's not mentioned in the post and there are no test links or bug issues

I marked it as draft. My computer broke (son dropped it 😢), I have to redo the whole first post. Will do when I can.

@yakov116

yakov116 commented Jun 6, 2021

Copy link
Copy Markdown
Member Author

That checks if the date of the comment is after or before the last commit.

The selector needed to be updated.

async function hideProjects(): Promise<void> {
if (!await hasProjects()) {
(await elementReady('[data-hotkey="p"]'))!.parentElement!.remove();
(await elementReady('[data-hotkey="p"]'))?.parentElement!.remove();

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.

Line 57 exactly checks for projects. If we get to line 58, there should not be any projects.

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.

hmm I will double check what's going on

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.

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.

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.

Let's merge hideProjects and hasProjects into something that makes more sense. Currently the condition is "has projects" while it tries to be "should it hide the section"

Why are we even checking for projects if there's no sidebar section to hide at all?

@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.

Other than source/features/comments-time-machine-links, which I haven't verified, and the reverted commit, the code so far is approved.

@yakov116

yakov116 commented Jun 9, 2021

Copy link
Copy Markdown
Member Author

Other than source/features/comments-time-machine-links,

example url that should not show the bar

https://github.com/sindresorhus/refined-github/blob/main/source/features/action-used-by-link.tsx?rgh-link-date=2021-04-28T07%3A12%3A39Z

@yakov116
yakov116 marked this pull request as ready for review June 10, 2021 04:06
@yakov116
yakov116 requested a review from fregante June 10, 2021 09:37
@fregante

Copy link
Copy Markdown
Member

example url that should not show the bar

I'm confused, why should that page not show the bar?

  • It points to a branch
  • The URL has a date in April

// eslint-disable-next-line import/prefer-default-export
export function getCommitHash(commit: HTMLElement): string {
return commit.querySelector('a[href]')!.pathname.split('/').pop()!;
return commit.querySelector('a[href]:not(.js-issue-link)')!.pathname.split('/').pop()!;

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.

Does not work? PRs also have the same class

Screen Shot

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.

PR's? We are catching the wrong link.

From now on I will open an issue for each and thing I want to fix.

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.

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.

From now on I will open an issue for each and thing I want to fix.

If you're writing a PR, you can include the details in the PR itself to save some time

@fregante fregante changed the title Lint and small bug fixes Small bug fixes Jun 10, 2021
@fregante
fregante merged commit 8510894 into main Jun 10, 2021
@fregante
fregante deleted the dep branch June 10, 2021 10:03
@fregante

fregante commented Jun 10, 2021 •

Copy link
Copy Markdown
Member

Thanks for the many bug fixes but it's best to open multiple PRs, following the template. If I can't see the bug in a link, in a screenshot, and/or in a issue, I'm reverting.

@fregante fregante added the bug label Jun 10, 2021
@yakov116

Copy link
Copy Markdown
Member Author

Thanks for the many bug fixes but it's best to open multiple PRs, following the template. If I can't see the bug in a link, in a screenshot, and/or in a issue, I'm reverting.

Please look at the first post post....

@fregante

fregante commented Jun 10, 2021 •

Copy link
Copy Markdown
Member

Where are the screenshots? I don’t know what “Fix duplication in show-whitespace” refers to. No screenshot of bug, no screenshot of fix, no link to any issues for most fixes here.

We had discussed that specific bug somewhere but that doesn’t mean everyone reading knows; I’m not sure I remember what the bug was specifically. Follow the template, it’s just easier to understand and review. I don’t know why I have to explain how to follow a template in every PR you open.

@fregante fregante removed the meta Related to Refined GitHub itself label Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants