Skip to content

Harder better faster stronger new-or-deleted-file - #6702

Merged
fregante merged 2 commits into
mainfrom
highlight-deleted-and-added-files-in-diffs
Jun 2, 2023
Merged

fregante merged 2 commits into
mainfrom
highlight-deleted-and-added-files-in-diffs

Conversation

@fregante

@fregante fregante commented May 31, 2023 •

Copy link
Copy Markdown
Member

@fregante fregante added the bug label May 31, 2023
Comment thread readme.md
- [](# "mark-merge-commits-in-list") [Marks merge commits in commit lists.](https://user-images.githubusercontent.com/16872793/75561016-457eb900-5a14-11ea-95e1-a89e81ee7390.png)
- [](# "deep-reblame") [When exploring blames, `Alt`-clicking the “Reblame” buttons will extract the associated PR’s commits first, instead of treating the commit a single change.](https://user-images.githubusercontent.com/16872793/77248541-8e3f2180-6c10-11ea-91d4-221ccc0ecebb.png)
- [](# "highlight-deleted-and-added-files-in-diffs") [Indicates with an icon whether files in commits and pull requests being added or removed.](https://user-images.githubusercontent.com/1402241/90332474-23262b00-dfb5-11ea-9a03-8fd676ea0fdd.png)
- [](# "new-or-deleted-file") [Indicates with an icon whether files in commits and pull requests being added or removed.](https://user-images.githubusercontent.com/1402241/90332474-23262b00-dfb5-11ea-9a03-8fd676ea0fdd.png)

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.

New name ok?

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.

Hmm, I don't find it as clear as the old one. Maybe new-or-deleted-file-diff-indicator?

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.

Feature names should no longer be fully descriptive, I'm only renaming long feature names because they're impossible to mention in commits or to remember. See also the other recent renames in options-storage

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.

See #6707

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.

Still think that we should include the word highlight

@fregante fregante May 31, 2023 •

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.

Then we're back to square one: highlight-new-or-delete-file is 5-words long and I don’t think it helps much;. The feature search also includes the description so we can always try to add more keywords there (but it already includes the word indicates, like github-actions-indicators does)

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.

I agree that the new name isn't very descriptive, but between descriptiveness and brevity we should prefer the latter, as described in #6707.

Alternative short names are welcome; names that are only slightly shorter than what we have aren't enough.

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.

file-diff-type-indicator?

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.

While that sounds correct, it gives me even less information about what the indicator is about. "diff type" == ?

Maybe mark-new-or-deleted-file but that's so long too.


const icon = select('.octicon-diff-removed, .octicon-diff-added', fileInList)
?.cloneNode(true);
if (icon) {

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.

I added a bunch of conditions to have clear errors in case filelists are deferred in big PRs. I can drop the features.log.error condition if anyone finds one such big PR

import observe from '../helpers/selector-observer.js';

function add(filename: HTMLAnchorElement): void {
const list = select('ul[aria-label="File Tree"]');

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.

This feature used to use this dropdown:

Screenshot 4

but it only appears on PRs and it's actually been relegated to small screens, because the whole dropdown is hidden/duplicate of the sidebar on large screens.

It seems that the sidebar is actually part of the original HTML, so we don't even need to wait for it to load (at least some times)

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.

I ended up not using the API because I figured we'd still have trouble figuring out the exact changes/api to consider in case of single commits and multi-PR-commits. The sidebar is recent enough, hopefully it will last a while.

@fregante
fregante merged commit 5dccf0e into main Jun 2, 2023
@fregante
fregante deleted the highlight-deleted-and-added-files-in-diffs branch June 2, 2023 16:26
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.

highlight-deleted-and-added-files-in-diffs broken on single commits

3 participants