Skip to content

Commit 4b35bf2

Browse files
committed
Improve the maintenance badge user experience
* Change the alt-text to be a little more descriptive and screen-reader friendly * Create a page with the details of what each of the categories for a maintenance badge means, including a link to the Cargo manifest documentation so crate maintainers know how to configure * Link to the new page from the badge
1 parent b46f672 commit 4b35bf2

File tree

6 files changed

+91
-5
lines changed

6 files changed

+91
-5
lines changed

app/components/badge-maintenance.hbs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<span class="badge" ...attributes>
22
{{#unless this.none}}
3-
<img
4-
src="https://img.shields.io/badge/maintenance-{{this.escapedStatus}}-{{this.color}}.svg"
5-
alt="{{this.text}}"
6-
title="{{this.text}}">
3+
<LinkTo @route="maintenance-intentions">
4+
<img
5+
src="https://img.shields.io/badge/maintenance-{{this.escapedStatus}}-{{this.color}}.svg"
6+
alt="{{this.text}}"
7+
title="{{this.text}}">
8+
</LinkTo>
79
{{/unless}}
810

911
</span>

app/components/badge-maintenance.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,21 @@ export default Component.extend({
3333
}
3434
}),
3535

36-
text: 'Maintenance intention for this crate',
36+
// eslint-disable-next-line ember/require-return-from-computed
37+
text: computed('badge', function() {
38+
switch (this.get('badge.attributes.status')) {
39+
case 'actively-developed':
40+
return 'Maintenance intention: Actively developed';
41+
case 'passively-maintained':
42+
return 'Maintenance intention: Passively maintained';
43+
case 'as-is':
44+
return 'Maintenance intention: As-is';
45+
case 'experimental':
46+
return 'Maintenance intention: Experimental';
47+
case 'looking-for-maintainer':
48+
return 'Maintenance intention: Looking for maintainer';
49+
case 'deprecated':
50+
return 'Maintenance intention: Deprecated';
51+
}
52+
}),
3753
});

app/router.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Router.map(function() {
4646
this.route('team', { path: '/teams/:team_id' });
4747
this.route('policies');
4848
this.route('data-access');
49+
this.route('maintenance-intentions');
4950
this.route('confirm', { path: '/confirm/:email_token' });
5051
this.route('accept-invite', { path: '/accept-invite/:token' });
5152

app/styles/app.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ $link-color: rgb(0, 172, 91);
1414
@import "home";
1515
@import "category-slugs";
1616
@import "categories";
17+
@import "maintenance-intentions";
1718
@import "crate";
1819
@import "crate/version";
1920
@import "components/crate-toml-copy";
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#maintenance-intentions {
2+
dt {
3+
margin-bottom: 5px;
4+
font-weight: bold;
5+
}
6+
dd {
7+
margin-bottom: 20px;
8+
}
9+
.badge {
10+
margin-left: 5px;
11+
img {
12+
vertical-align: text-top;
13+
}
14+
}
15+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{{ title 'Maintenance intention guidelines' }}
2+
<div id='crates-heading'>
3+
{{svg-jar 'circle-with-i'}}
4+
<h1>Maintenance intention guidelines</h1>
5+
</div>
6+
7+
<p>
8+
The maintenance badge is a way for crate maintainers to convey their
9+
maintenance intentions. The definitions below provide a high level
10+
categorization. The exact cadence for releases or support provided
11+
will still vary between crates. Crate maintainers should provide
12+
further details in their crate's documentation if they wish to
13+
clarify their intentions or commitments. Crate maintainers should
14+
refer to the <a href="https://doc.rust-lang.org/cargo/reference/manifest.html">Cargo manifest documentation</a>
15+
for more information on how to add a maintenance badge.
16+
</p>
17+
18+
<h2>Categories</h2>
19+
20+
<dl id='maintenance-intentions'>
21+
<dt>Actively developed<BadgeMaintenance @badge={{hash attributes=(hash status="actively-developed")}} /></dt>
22+
<dd>
23+
New features are being added and bugs are being fixed.
24+
</dd>
25+
<dt>Passively maintained<BadgeMaintenance @badge={{hash attributes=(hash status="passively-maintained")}} /></dt>
26+
<dd>
27+
There are no plans for new features, but the maintainer intends to respond
28+
to issues that get filed.
29+
</dd>
30+
<dt>As-is<BadgeMaintenance @badge={{hash attributes=(hash status="as-is")}} /></dt>
31+
<dd>
32+
The crate is feature complete, the maintainer does not intend to continue
33+
working on it or providing support, but it works for the purposes it was
34+
designed for.
35+
</dd>
36+
<dt>Experimental<BadgeMaintenance @badge={{hash attributes=(hash status="experimental")}} /></dt>
37+
<dd>
38+
The author wants to share it with the community but is not intending to meet
39+
anyone's particular use case.
40+
</dd>
41+
<dt>Looking for maintainer<BadgeMaintenance @badge={{hash attributes=(hash status="looking-for-maintainer")}} /></dt>
42+
<dd>
43+
The current maintainer would like to transfer the crate to someone else.
44+
</dd>
45+
<dt>Deprecated<BadgeMaintenance @badge={{hash attributes=(hash status="deprecated")}} /></dt>
46+
<dd>
47+
The maintainer does not recommend using this crate, possibly due there being
48+
a better solution available or being problems with the crate that they
49+
do not want to fix.
50+
</dd>
51+
</dl>

0 commit comments

Comments
 (0)