From 4d49f5dfa6a0e0e69013a0dfcdcd9034a740eae9 Mon Sep 17 00:00:00 2001 From: KernelDeimos <7225168+KernelDeimos@users.noreply.github.com> Date: Fri, 13 Feb 2026 18:50:17 -0500 Subject: [PATCH] fix: allow `html` property in UIComponentWindow A component was removed and an html property was passed to UIComponentWindow. This makes sense because UIWindow accepts an html property, so rather than update the calling code it made more sense to update UIComponentWindow to be more intuitive. --- src/gui/src/UI/UIComponentWindow.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/src/UI/UIComponentWindow.js b/src/gui/src/UI/UIComponentWindow.js index a10baf909..3edffd6e6 100644 --- a/src/gui/src/UI/UIComponentWindow.js +++ b/src/gui/src/UI/UIComponentWindow.js @@ -18,17 +18,20 @@ */ import UIWindow from './UIWindow.js'; import Placeholder from '../util/Placeholder.js'; +import JustHTML from './Components/JustHTML.js'; /** * @typedef {Object} UIComponentWindowOptions - * @property {Component} A component to render in the window + * @property {Component} [component] A component to render in the window + * @property {string} [html] HTML string to render in the window (uses JustHTML component) */ /** - * Render a UIWindow that contains an instance of Component + * Render a UIWindow that contains an instance of Component or HTML string * @param {UIComponentWindowOptions} options */ export default async function UIComponentWindow (options) { + const component = options.component ?? new JustHTML({ html: options.html ?? '' }); const placeholder = Placeholder(); const win = await UIWindow({ @@ -37,8 +40,8 @@ export default async function UIComponentWindow (options) { body_content: placeholder.html, }); - options.component.attach(placeholder); - options.component.focus(); + component.attach(placeholder); + component.focus(); return win; }