feat(admin): surface ep.json disables in /admin plugin browser (#7649)

Companion to ether/ether.github.com#395 — the admin UI's "available
plugins" listing now also renders the plugin's declared `disables`
(see doc/PLUGIN_FEATURE_DISABLES.md) so an operator about to click
Install sees the same warning as a user browsing etherpad.org/plugins:
"Disables: chat".

- src/node/types/PackageInfo.ts: optional `disables?: string[]` on
  the registry payload type.
- admin/src/pages/Plugin.ts: same on the admin-side PluginDef.
- admin/src/pages/HomePage.tsx: render an amber callout under the
  description when `disables` is present and non-empty. Plugins
  without a disables field render unchanged.

The plugin-registry build pipeline still has to start surfacing
`disables` from ep.json into plugins.json/plugins.viewer.json — until
that lands, the new callout no-ops everywhere, which is fine.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
John McLear 2026-05-02 17:29:25 +08:00 committed by GitHub
parent b769ab6e54
commit e028016296
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 39 additions and 2 deletions

View File

@ -229,7 +229,30 @@ export const HomePage = () => {
filteredInstallablePlugins.map((plugin) => {
return <tr key={plugin.name}>
<td><a rel="noopener noreferrer" href={`https://npmjs.com/${plugin.name}`} target="_blank">{plugin.name}</a></td>
<td>{plugin.description}</td>
<td>
{plugin.description}
{plugin.disables && plugin.disables.length > 0 && (
<div
className="plugin-disables"
title="This plugin intentionally removes the listed Etherpad features."
style={{
marginTop: '0.25rem',
padding: '0.2rem 0.5rem',
borderRadius: '4px',
fontSize: '0.85em',
background: 'rgba(180, 83, 9, 0.15)',
border: '1px solid rgba(180, 83, 9, 0.4)',
color: '#92400e',
display: 'inline-block',
}}
>
<strong>Disables: </strong>
{plugin.disables
.map((tag) => tag.replace(/^@feature:/, ''))
.join(', ')}
</div>
)}
</td>
<td>{plugin.version}</td>
<td>{plugin.time}</td>
<td>

View File

@ -4,6 +4,12 @@ export type PluginDef = {
version: string,
time: string,
official: boolean,
/**
* `@feature:*` Playwright tags for core specs the plugin intentionally
* disables. See doc/PLUGIN_FEATURE_DISABLES.md. May be undefined for
* plugins without a disables list, which is the common case.
*/
disables?: string[],
}

View File

@ -10,7 +10,15 @@ export type PackageInfo = {
},
homepage: string,
repository: string,
path: string
path: string,
/**
* `@feature:*` Playwright tags for core specs the plugin intentionally
* disables. Sourced from the plugin's ep.json `disables` array; see
* doc/PLUGIN_FEATURE_DISABLES.md for the contract. Populated by the
* plugin-registry build pipeline; absent for plugins that don't
* declare a disables list.
*/
disables?: string[]
}