-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Conversation
source/features/copy-file.tsx
Outdated
@@ -30,6 +30,7 @@ function init() { | |||
|
|||
features.add({ | |||
id: 'copy-file', | |||
description: 'Copy file', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provided some suggestions. But still confused on how the description should sound like, like Looking out for what @bfred-it thinks about these. |
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:
Eventually we might have a mini-parser for links and backticks (like in #1872 ) |
Yup. And highly agree for multi-line descriptions!
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 |
Hell, I missed that PR! 😅 |
The |
Many of the descriptions are too short or ambiguous. Can you put some more time into writing good descriptions? :) |
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:
@sindresorhus I think the |
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 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. |
Yup, I forgot we can enforce this with types now. |
I just merged this feature in Refined GitHub. You'll just need the latest version from the extensions store. |
@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', |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer \'
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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`', |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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', |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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', |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
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`', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description: 'A warning appears when unchecking `Allow edits from maintainers`', | |
description: 'Add warning when unchecking `Allow edits from maintainers`', |
Ping on this issue, if possible we'd like to merge it soon |
If you can at least merge the suggestions by @sindresorhus we can accept it, otherwise we have to close it |
1. Open refined-github#1881 2. Expand add-co-authored-by.tsx 3. Notice no indentation change in the "Suggested change" diff
@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