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

@ -12,6 +12,7 @@
// before the panel renders.
import type { ComponentType } from 'react';
import { setCommandOwnerNames } from '../frame/pluginCommandStore.ts';
import Panel from './Panel.tsx';
import { configurePanel, type PanelSite } from './site.ts';
@ -21,6 +22,8 @@ export type PanelComponent = ComponentType<{ section?: { name: string; nonce: nu
/** Sets the panel's site for every panel module and returns the panel's root component. Call once. */
export function createPanel(site: PanelSite): PanelComponent {
configurePanel(site);
// Palette commands of an area plugin are listed under the area's name.
if (site.features) setCommandOwnerNames(Object.fromEntries(site.features.table.areas.map(area => [area.owner, area.name])));
return Panel;
}
@ -31,8 +34,12 @@ export { BUILTIN_SECTIONS, panelSite } from './site.ts';
export { NAV_ICONS, navEntries } from './nav.ts';
// Building blocks for the app's own sections: the panel's controls and the generic pieces.
export {
Badge, Button, ChipList, ColorField, EmptyState, InputRow, Row, SearchField, SearchProvider, Section, Segmented, Select, Slider, Stepper, Toggle, useSettingsQuery,
Badge, Button, ChipList, ColorField, EmptyState, InputRow, Row, SearchField, SearchProvider, Section, Segmented, Select, Slider, Stepper, Toggle, matchesQuery, useSettingsQuery,
type Option,
} from './controls.tsx';
export { FeatureGroups, useFeatures } from './FeatureToggles.tsx';
// Area plugins and modes (PanelSite.features): the cards, the Fixes list, the first-run screen.
export { AreaPlugins, featureTable, flagsChanged, useFlags } from './PluginFeatures.tsx';
export { ModeSettings, Onboarding, openOnboardingWhenDue, useModeState, type ModeState } from './Modes.tsx';
export { areaCards, featureFiles, fixRows, modePlan, type AreaCard, type FeatureRow, type ModePlan, type PluginFileState } from './featureModel.ts';
export { compareLines } from './compare.ts';