MCPcopy Index your code
hub / github.com/refined-github/refined-github / moveDisabledFeaturesToTop

Function moveDisabledFeaturesToTop

source/options/feature-list.tsx:10–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8import {createRghIssueLink, getFeatureUrl} from '../helpers/rgh-links.js';
9
10function moveDisabledFeaturesToTop(): void {
11 const container = $('.js-features');
12 const features = $$('.feature').toSorted((a, b) => a.dataset.text!.localeCompare(b.dataset.text!));
13 const grouped = Object.groupBy(features, feature => {
14 const checkbox = $('input.feature-checkbox', feature);
15 return checkbox.checked ? 'on' : checkbox.disabled ? 'broken' : 'off';
16 });
17
18 for (const group of [grouped.off, grouped.broken, grouped.on]) {
19 if (group) {
20 for (const feature of group) {
21 container.append(feature);
22 }
23 }
24 }
25}
26
27async function markLocalHotfixes(): Promise<void> {
28 for (const [feature, relatedIssue] of await getLocalHotfixes()) {

Callers 1

updateListDomFunction · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected