Panel: area plugin cards with per-feature toggles, the Fixes list, modes (first-run screen and Settings)

- PanelSite.features: the app's feature table; AreaPlugins draws one card per area (switch, count, grouped features, Settings button that runs the area's command in the site tab) and the core flags as Fixes
- a feature still backed by an old plugin file is switched through plugin_set_enabled from its card and left out of the JavaScript plugins list
- Modes: Onboarding (three cards, recommended preselected; an existing setup may be kept) and ModeSettings with the keep-my-changes question; openOnboardingWhenDue for ShellSite.start
- flags are saved sparsely (only what differs from the table's defaults)
- PanelSite.appearance.extra; palette commands of an area are listed under its name
- the kit's words for feature settings and health notes; English in the framework catalog
This commit is contained in:
CRTkafa 2026-09-30 18:34:14 +07:00
parent 365f55f604
commit d8619c7482
16 changed files with 689 additions and 24 deletions

View file

@ -8,6 +8,7 @@ import { t as frameText, tx } from '../frame/i18n.ts';
import { site } from '../frame/site.ts';
import { permissionBadges, type InstallRecord } from '../storeModel.ts';
import { Badge, Button, EmptyState, Row, Section, Toggle, useSettingsQuery } from './controls.tsx';
import { featureFiles } from './featureModel.ts';
import { panelSite } from './site.ts';
import './plugins.css';
@ -78,6 +79,10 @@ export function ScriptPlugins({ notify }: { notify: Notify }) {
finally { setBusy(null); }
}
// A plugin file that is a feature of an area card (until it is ported) is switched there.
const table = panelSite().features?.table;
const inCards = table ? featureFiles(table) : null;
const listed = plugins && inCards ? plugins.filter(plugin => !inCards.has(plugin.file)) : plugins;
// Removing a file goes through the install screen's native side (`plugin_remove`).
const removable = !!panelSite().store;
const folder = <div className="bt-inline">
@ -86,13 +91,13 @@ export function ScriptPlugins({ notify }: { notify: Notify }) {
</div>;
return <Section title={t('wb.plugins.title')} hint={t('wb.plugins.hint')}
action={plugins && plugins.length > 0 ? folder : undefined}>
action={plugins && (plugins.length > 0 || table) ? folder : undefined}>
{error && <div className="bt-alert" role="alert">{error}</div>}
{plugins?.length === 0 && !query && <EmptyState icon={PLUG} title={t('wb.plugins.none')} action={folder}>
{listed?.length === 0 && !query && !table && <EmptyState icon={PLUG} title={t('wb.plugins.none')} action={folder}>
{t('wb.plugins.noneHint')}
<code className="bt-snippet" style={{ display: 'block' }}>{PLUGIN_EXAMPLE}</code>
</EmptyState>}
{plugins?.map(plugin => {
{listed?.map(plugin => {
const record = records[`plugin:${plugin.file}`];
const source = record ? (record.source === 'store' ? t('wb.panel.section.store') : record.source === 'link' ? t('wb.plugins.source.link') : t('wb.plugins.source.file')) : null;
const text = pluginText(plugin);