feat: finish the remote-desktop plugin (B14)

This commit is contained in:
LukeGus committed 2026-09-24 01:02:45 -05:00
1 parent 0af2c94983
commit 14eb558b85
215 files changed
+30029 -3921

No files matched your search

+8 -1
View File
@@ -1,7 +1,8 @@
import type { PluginSettingsField } from "@/api/plugins-api";
/**
* Whether a field's `requires` gate is satisfied.
* Whether the generic form draws a field: not hidden (the plugin edits it in
* its own UI) and its `requires` gate satisfied.
*
* Kept out of the component file so both the settings page and the host editor
* section can import it without dragging a component along.
@@ -10,6 +11,12 @@ export function isFieldActive(
field: PluginSettingsField,
values: Record<string, unknown>,
): boolean {
if (field.hidden) return false;
if (!field.requires) return true;
return values[field.requires] === true;
}
/** Whether a plugin has any field the generic form would ever draw. */
export function hasVisibleFields(fields: PluginSettingsField[]): boolean {
return fields.some((field) => !field.hidden);
}