Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding description field to features.add() #1881

Closed
wants to merge 6 commits into from

Conversation

sunilkumarc
Copy link

@sindresorhus I've now added description field to features.add() and also description text for all of the existing features. Please review and let me know if any changes are required.

Fixes #1787

@@ -30,6 +30,7 @@ function init() {

features.add({
id: 'copy-file',
description: 'Copy file',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
description: 'Copy file',
description: 'Adds button to copy file contents to clipboard',

@@ -27,6 +27,7 @@ async function init() {

features.add({
id: 'warn-pr-from-master',
description: 'Show warning when a user attempts to create a PR from their fork\'s default branch',
Copy link
Contributor

Choose a reason for hiding this comment

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

@notlmn
Copy link
Contributor

notlmn commented Mar 24, 2019

Provided some suggestions.

But still confused on how the description should sound like, like 'Adds keyboard shortcuts to comment fields' or just leaving it as 'Commented menu item' which would otherwise be ambiguous. Or if the words Adds should be added to all (most) of the features descriptions.

Looking out for what @bfred-it thinks about these.

@fregante
Copy link
Member

Some files already have a description and sometimes links in a comment in the JS file header. These can be removed from there and used as-is in the description field.

If they are multiline, they can stay as:

features.add({
	id: 'reactions-avatars',
	description: `
		Line 1
		Line 2
		https://
	`

Eventually we might have a mini-parser for links and backticks (like in #1872 )

@notlmn
Copy link
Contributor

notlmn commented Mar 24, 2019

Some files already have a description and sometimes links in a comment in the JS file header. These can be removed from there and used as-is in the description field.

Yup. And highly agree for multi-line descriptions!


Eventually we might have a mini-parser for links and backticks (like in #1872)

Thinking if the description field can be used to render a checkbox-style list in the extensions options to enable/disable individual features. 🤷‍♂️

@fregante
Copy link
Member

Thinking if the description field can be used to render a checkbox-style list in the extensions options to enable/disable individual features. 🤷‍♂️

That's the idea, when I finish #1780

@notlmn
Copy link
Contributor

notlmn commented Mar 24, 2019

That's the idea, when I finish #1780

Hell, I missed that PR! 😅

@sindresorhus
Copy link
Member

sindresorhus commented Mar 24, 2019

The description field should be required, meaning the code should ensure it exists.

@sindresorhus
Copy link
Member

sindresorhus commented Mar 24, 2019

Many of the descriptions are too short or ambiguous. Can you put some more time into writing good descriptions? :)

@sunilkumarc
Copy link
Author

Although this code base is completely new to me, I've done my best to add meaningful description to most of the features. Still I would need your help in filling description for below features:

upload-button
toggle-files-button
scroll-to-top-on-collapse
pull-request-hotkey
more-dropdown
hide-empty-meta
close-out-of-view-modals
ci-link
global-discussion-list-filters

@sindresorhus I think the description field is already a required field. Without adding this field, calling features.add() would fail saying Property 'description' is missing in type. Is this not the right way? If not, please let me know how I can ensure description field in features.

@sindresorhus
Copy link
Member

Still I would need your help in filling description for below features:

Go to the feature's JS file, click the History button, find the first commit, it should show you the readme addition which describes the feature. For example, this is the commit for ci-link: 457071f#diff-19f501127e11d5e0cc6f4c78bc44bc57

You will need the https://chrome.google.com/webstore/detail/follow-for-github/agalokjhnhheienloigiaoohgmjdpned?hl=en extension, so you can find the first commit, even if it was renamed.

@sindresorhus
Copy link
Member

I think the description field is already a required field. Without adding this field, calling features.add() would fail saying Property 'description' is missing in type. Is this not the right way? If not, please let me know how I can ensure description field in features.

Yup, I forgot we can enforce this with types now.

@fregante
Copy link
Member

You will need the chrome.google.com/webstore/detail/follow-for-github/agalokjhnhheienloigiaoohgmjdpned?hl=en extension, so you can find the first commit, even if it was renamed.

I just merged this feature in Refined GitHub. You'll just need the latest version from the extensions store.

@sunilkumarc
Copy link
Author

@notlmn @bfred-it @sindresorhus I've added the description texts by following above suggested approaches. Please review and let me know if something needs to be changed.

@@ -12,6 +12,7 @@ function init() {

features.add({
id: 'emojis-title',
description: 'Don’t add a title if the emoji\'s parents already have one',
Copy link
Contributor

@notlmn notlmn Mar 31, 2019

Choose a reason for hiding this comment

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

Styled quote () and escaped quote (\')?

Choose to have only one of these (throughout the other files too).

Copy link
Member

Choose a reason for hiding this comment

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

I would prefer \'.

Copy link
Member

Choose a reason for hiding this comment

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

I read this description many times and I'm still not sure what the feature actually does.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sidetracking here, but it takes the alias attribute (provided by GH) of the emoji, and adds it as a title (if any of its closest parent doesn't provide one).

Presumably so that anyone without access to an emoji keyboard (picket) can use this info to insert emojis in comments.

Considering that GitHub already provides autocomplete for emojis in desktop view and that the title attribute is useless on mobile devices, I think this feature can be dropped. 🤷‍♂️

Copy link
Member

Choose a reason for hiding this comment

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

Context:
#278
#437

I don't think I ever used it and even then you can just copy-paste the emoji.

Copy link
Member

Choose a reason for hiding this comment

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

I would prefer \'.

@bfred-it wants , so we'll go with that. But should be consistent everywhere.

@@ -21,6 +21,7 @@ function init() {

features.add({
id: 'filter-comments-by-you',
description: 'Search for issues and PRs with the `Everything commented by you filter`',
Copy link
Contributor

Choose a reason for hiding this comment

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

@bfred-it Would this look good after backticks are parsed?

It's not exactly code, per se. Or can bold be used in cases like these?

Copy link
Member

@fregante fregante Apr 3, 2019

Choose a reason for hiding this comment

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

It's how we've been marking them up in the readme: https://github.com/sindresorhus/refined-github/blob/0b6c7330c21f8570519143ad3d0decc328d4db47/readme.md#L185

@sindresorhus thoughts? Should they be in italics (in the readme too)?

Edit: wow, ironically the link you can only generate thanks to RGH (#1873) is correctly embedded by GitHub

Copy link
Author

Choose a reason for hiding this comment

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

@sindresorhus any comments on this? I would like to close this PR as soon as possible.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, let's go with italic.

@sunilkumarc
Copy link
Author

@bfred-it Any comments from you for latest changes? I'll work on the changes suggested by @notlmn along with your suggestions, if there are any.

@fregante fregante added the meta Related to Refined GitHub itself label Apr 3, 2019
@sindresorhus
Copy link
Member

Can you fix the merge conflict?

@@ -35,6 +35,7 @@ async function init() {

features.add({
id: 'ci-link',
description: 'Adds build status and link to CI by the repo\'s title',
Copy link
Member

Choose a reason for hiding this comment

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

Be consistent with Add and Adds. I prefer Add.

@@ -81,6 +81,7 @@ function init() {

features.add({
id: 'comment-fields-keyboard-shortcuts',
description: 'Quickly edit your last comment using the `↑` shortcut',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
description: 'Quickly edit your last comment using the `↑` shortcut',
description: 'Quickly edit your last comment using the `↑` keyboard shortcut',

@@ -19,6 +19,7 @@ function deinit() {

features.add({
id: 'copy-on-y',
description: 'Adds shortcut to copy permalink of file to clipboard',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
description: 'Adds shortcut to copy permalink of file to clipboard',
description: 'Adds shortcut to copy the permalink of a file to the clipboard',

@@ -17,6 +17,7 @@ function init() {

features.add({
id: 'download-folder-button',
description: 'Download entire folders from repositories using the `Download folder` button. (Uses download-directory.github.io)',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
description: 'Download entire folders from repositories using the `Download folder` button. (Uses download-directory.github.io)',
description: 'Download entire folders from repositories using the `Download folder` button. (Uses https://download-directory.github.io)',

@@ -15,6 +15,7 @@ function init() {

features.add({
id: 'extend-diff-expander',
description: 'Widen `Expand diff` button',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
description: 'Widen `Expand diff` button',
description: 'Widen the `Expand diff` button',

@@ -30,6 +30,7 @@ function init() {

features.add({
id: 'extend-status-labels',
description: 'Extend status labels',
Copy link
Member

Choose a reason for hiding this comment

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

Extend them with what or in what way? The description is not clear enough.

@@ -19,6 +19,7 @@ async function init() {

features.add({
id: 'user-profile-follower-badge',
description: 'Badge on user\'s profile if they follow you',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
description: 'Badge on user\'s profile if they follow you',
description: 'Add a badge on user\'s profile page if they follow you',

@@ -89,6 +85,9 @@ async function init(): Promise<false | void> {

features.add({
id: 'view-markdown-source',
description: `Add button to view the markdown source whereas GitHub only lets you see the rendered version.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
description: `Add button to view the markdown source whereas GitHub only lets you see the rendered version.
description: `Add a button to view the Markdown source whereas GitHub only lets you see the rendered version.

@@ -115,6 +115,7 @@ function init() {

features.add({
id: 'wait-for-build',
description: 'The option to wait for checks when merging a PR',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
description: 'The option to wait for checks when merging a PR',
description: 'Add checkbox to wait for checks when merging a PR',

@@ -27,6 +19,11 @@ async function init() {

features.add({
id: 'warn-pr-from-master',
description: `Creating a PR from the master branch is an anti-pattern. This feature produces a
warning when a user attempts to create a PR from their fork's default branch.
Copy link
Member

Choose a reason for hiding this comment

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

Don't hard-wrap.

@@ -31,6 +31,7 @@ function init() {

features.add({
id: 'warning-for-disallow-edits',
description: 'A warning appears when unchecking `Allow edits from maintainers`',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
description: 'A warning appears when unchecking `Allow edits from maintainers`',
description: 'Add warning when unchecking `Allow edits from maintainers`',

@fregante
Copy link
Member

Ping on this issue, if possible we'd like to merge it soon

@fregante
Copy link
Member

If you can at least merge the suggestions by @sindresorhus we can accept it, otherwise we have to close it

@fregante fregante closed this May 1, 2019
fregante added a commit to notlmn/refined-github that referenced this pull request May 24, 2019
1. Open refined-github#1881
2. Expand add-co-authored-by.tsx
3. Notice no indentation change in the "Suggested change" diff
This was referenced May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Related to Refined GitHub itself
Development

Successfully merging this pull request may close these issues.

Add description field to features.add()
5 participants