import './rgh-feature-descriptions.css'; import React from 'dom-chef'; import * as pageDetect from 'github-url-detection'; import {CopyIcon} from '@primer/octicons-react'; import features from '../feature-manager'; import {featuresMeta} from '../../readme.md'; import {getNewFeatureName} from '../options-storage'; import {isRefinedGitHubRepo} from '../github-helpers'; import observe from '../helpers/selector-observer'; async function add(infoBanner: HTMLElement): Promise { const [, currentFeature] = /source\/features\/([^.]+)/.exec(location.pathname) ?? []; // Enable link even on past commits const currentFeatureName = getNewFeatureName(currentFeature); const feature = featuresMeta.find(feature => feature.id === currentFeatureName); if (!feature) { return; } const conversationsUrl = new URL('https://github.com/refined-github/refined-github/issues'); conversationsUrl.searchParams.set('q', `sort:updated-desc "${feature.id}"`); infoBanner.before(

{feature.id}

{ /* eslint-disable-next-line react/no-danger */ }
Related issues { location.pathname.endsWith('css') ? <> • See JavaScript : undefined }
{feature.screenshot && ( )}
, ); } function init(signal: AbortSignal): void { observe('#repos-sticky-header', add, {signal}); } void features.add(import.meta.url, { asLongAs: [ isRefinedGitHubRepo, ], include: [ pageDetect.isSingleFile, ], awaitDomReady: false, init, });