Skip to content

refactor: solid dev options modal (@miodec)#7561

Merged
Miodec merged 8 commits intomasterfrom
solid-dev
Mar 2, 2026
Merged

refactor: solid dev options modal (@miodec)#7561
Miodec merged 8 commits intomasterfrom
solid-dev

Conversation

@Miodec
Copy link
Member

@Miodec Miodec commented Mar 2, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 2, 2026 10:03
@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label Mar 2, 2026
@github-actions github-actions bot added the waiting for review Pull requests that require a review before continuing label Mar 2, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the legacy dev options modal into the SolidJS modal system, moving dev controls into the component-based modal stack and updating the dev overlay entry points accordingly.

Changes:

  • Replace legacy dev-options modal implementation with a Solid DevOptionsModal component.
  • Add a dev-only overlay button group to open Dev Options / server configure.
  • Remove legacy dynamic-import loader + old dev button CSS.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
frontend/src/ts/utils/async-modules.ts Removes dynamic-import helper previously used to load the dev options modal.
frontend/src/ts/stores/modals.ts Extends ModalId union with DevOptions for the new Solid modal.
frontend/src/ts/modals/dev-options.ts Deletes legacy modal implementation (non-Solid).
frontend/src/ts/index.ts Removes dev-only bootstrapping that dynamically injected legacy dev buttons.
frontend/src/ts/components/modals/Modals.tsx Registers the new DevOptionsModal in the Solid modal tree.
frontend/src/ts/components/modals/DevOptionsModal.tsx New Solid modal containing dev actions (quick login, debug toggles, etc.).
frontend/src/ts/components/layout/overlays/Overlays.tsx Adds dev-only overlay buttons to open Dev Options and backend configure.
frontend/src/styles/core.scss Removes styling for the old injected #devButtons container.

Comment on lines 3 to 15
@@ -10,6 +11,7 @@ export function Modals(): JSXElement {
<VersionHistoryModal />
<ContactModal />
<SupportModal />
<DevOptionsModal />
</>
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DevOptionsModal is now always imported + rendered in Modals, which ships dev-only actions (quick login, test toggles) in production bundles and makes them theoretically triggerable (e.g. via any future call to showModal("DevOptions")). Gate rendering behind isDevEnvironment() and preferably lazy-load the modal component (dynamic import) to keep dev-only code out of prod bundles.

Copilot uses AI. Check for mistakes.
Comment on lines +88 to +90
).then(() => {
hideLoaderBar();
});
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick Login ignores the signIn return value (it can resolve with { success: false, message }) and never surfaces failures to the user. Handle the resolved result (notify on failure) and ensure hideLoaderBar() runs via finally so the loader can’t get stuck if an unexpected exception occurs.

Suggested change
).then(() => {
hideLoaderBar();
});
)
.then((result: unknown) => {
// Handle signIn returning { success: boolean, message?: string }
if (
result &&
typeof result === "object" &&
"success" in result &&
!(result as { success: boolean }).success
) {
const message =
(result as { message?: string }).message ??
"Quick login failed.";
Notifications.add(message, -1);
}
})
.catch((error) => {
// Surface unexpected failures
Notifications.add("Quick login failed.", -1, {
details: error,
});
})
.finally(() => {
hideLoaderBar();
});

Copilot uses AI. Check for mistakes.
Comment on lines +40 to +64
<Show when={isDevEnvironment()}>
<div class="fixed top-30 left-0 z-10000 flex w-max flex-col gap-2 text-xs">
<Button
href={`${envConfig.backendUrl}/configure/`}
ariaLabel={{
text: "Configure server",
position: "right",
}}
fa={{
icon: "fa-server",
}}
class="rounded-tl-none rounded-bl-none p-2"
/>
<Button
ariaLabel={{
text: "Dev options",
position: "right",
}}
onClick={() => showModal("DevOptions")}
fa={{
icon: "fa-flask",
}}
class="rounded-tl-none rounded-bl-none p-2"
/>
</div>
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After moving dev options to Solid modals, the legacy popup DOM + styles for #devOptionsModal still exist (e.g. src/html/popups.html + styles/popups.scss) but there’s no longer any TS code referencing it. Remove the unused legacy modal markup/styles to avoid dead UI + maintenance overhead.

Copilot uses AI. Check for mistakes.
fehmer
fehmer previously approved these changes Mar 2, 2026
@github-actions github-actions bot removed the waiting for review Pull requests that require a review before continuing label Mar 2, 2026
@Miodec
Copy link
Member Author

Miodec commented Mar 2, 2026

@copilot resolve all review comments

Copy link
Contributor

Copilot AI commented Mar 2, 2026

@Miodec I've opened a new pull request, #7562, to work on those changes. Once the pull request is ready, I'll request review from you.

@Miodec Miodec requested a review from Copilot March 2, 2026 10:49
@github-actions github-actions bot added the waiting for review Pull requests that require a review before continuing label Mar 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes.

@github-actions github-actions bot added waiting for update Pull requests or issues that require changes/comments before continuing and removed waiting for review Pull requests that require a review before continuing labels Mar 2, 2026
@Miodec
Copy link
Member Author

Miodec commented Mar 2, 2026

@copilot fix lint

Copy link
Contributor

Copilot AI commented Mar 2, 2026

@Miodec I've opened a new pull request, #7563, to work on those changes. Once the pull request is ready, I'll request review from you.

@github-actions github-actions bot removed the waiting for update Pull requests or issues that require changes/comments before continuing label Mar 2, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Comment on lines +95 to +97
Notifications.add("Quick login failed.", -1, {
details: error,
});
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notifications.add expects details?: object | string, but the catch param is typed unknown and passed through as-is (details: error). This won’t type-check and can also produce non-serializable / unhelpful details at runtime. Narrow/convert error before passing (eg error instanceof Error ? { message: error.message, stack: error.stack } : String(error)), or use the existing error-message helper.

Suggested change
Notifications.add("Quick login failed.", -1, {
details: error,
});
const details =
error instanceof Error
? { message: error.message, stack: error.stack }
: String(error);
Notifications.add("Quick login failed.", -1, { details });

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +20
import { JSXElement, Show, lazy } from "solid-js";

import { isDevEnvironment } from "../../utils/misc";
import { ContactModal } from "./ContactModal";
import { SupportModal } from "./SupportModal";
import { VersionHistoryModal } from "./VersionHistoryModal";

const DevOptionsModal = lazy(() =>
import("./DevOptionsModal").then((m) => ({ default: m.DevOptionsModal })),
);

export function Modals(): JSXElement {
return (
<>
<VersionHistoryModal />
<ContactModal />
<SupportModal />
<Show when={isDevEnvironment()}>
<DevOptionsModal />
</Show>
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lazy() suspends while the module loads, but this repo doesn’t appear to use <Suspense> anywhere (including where <Modals /> is mounted). Without a Suspense boundary, Solid’s lazy components can throw/promises can bubble to the root. Either render DevOptionsModal via a normal import (it’s already dev-gated), or wrap it in a <Suspense fallback={null}> (and add the import).

Copilot uses AI. Check for mistakes.
@Miodec Miodec merged commit 3eede88 into master Mar 2, 2026
8 checks passed
@Miodec Miodec deleted the solid-dev branch March 2, 2026 12:24
Miodec added a commit that referenced this pull request Mar 2, 2026
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend User interface or web stuff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants