Skip to content

Hiding the login image with an incomplete custom size disables Save with no visible reason #1676

Closed

Description

@joshunrau

In the login page editor, hiding the Login Image section can leave Save disabled with no visible reason. isCustomSizeInvalid applies whenever logoSize is 'custom', whatever showLogo is set to. The only message that explains it ("Enter at least one positive value (1–5000).") is rendered inside the Login Image card's content, and that content unmounts when "Show" is unticked. An admin who picks Custom size, leaves the dimensions blank, and then hides the image gets a disabled Save button and nothing on screen that says why. The resource-links check already skips its section when it is hidden (form.showResourceLinks && ...). The logo check does not.

Where

apps/web/src/components/LoginPageEditor/hooks.ts:244-248:

const isCustomSizeInvalid =
  form.logoSize === 'custom' &&
  ((form.customLogoWidth.trim() !== '' && customWidth === null) ||
    (form.customLogoHeight.trim() !== '' && customHeight === null) ||
    (customWidth === null && customHeight === null));

apps/web/src/components/LoginPageEditor/sections/SectionCards.tsx:105: the card content, including the error message at lines 262-270, renders only while the section is shown:

{form.showLogo && (
  <Card.Content className="flex flex-col gap-4">

Reproduce

  1. Sign in as an admin and open /admin/branding/login-page on an instance with no custom logo size saved.
  2. In "Login Image", set Size to "Custom" and leave Width and Height empty.
  3. Untick "Show" on the Login Image card.

Actual: Save stays disabled, and no error is visible anywhere on the page.
Expected: either a hidden section's size does not block saving, or the reason Save is disabled stays visible.

Tests

apps/web/src/components/LoginPageEditor/__tests__/hooks.test.tsx: it('should not block saving on the custom logo size while the login image is hidden, since nothing on screen explains it').

testing/src/specs/admin-branding.spec.ts: test('should allow saving after hiding a login image that has an incomplete custom size').

Suggested fix

Gate the flag on form.showLogo, the same way hasInvalidResourceLinks is gated on form.showResourceLinks. handleSubmit already sends customLogoWidth/customLogoHeight as null when they do not parse, and the panel falls back to the small preset when both are null, so saving in this state is safe.

Activity

  1. added
    BugType: existing behavior is wrong
    Priority: LowNice to have, cosmetic or speculative
    Difficulty: LowIsolated change, about 2 hours or less
    Area: Webapps/web (clinician-facing React SPA)
    Good First IssueWell-scoped, low-risk and self-contained; a good entry point for a new contributor
    on Oct 7, 2026
  2. added a commit that references this issue on Oct 29, 2026
    ec28908
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: Webapps/web (clinician-facing React SPA)BugType: existing behavior is wrongDifficulty: LowIsolated change, about 2 hours or lessGood First IssueWell-scoped, low-risk and self-contained; a good entry point for a new contributorPriority: LowNice to have, cosmetic or speculative

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions