Skip to content

Renderer: gamescope-builder NumberField cleared -> NaN -> 422 -> preview degrades to 'gamescope --' #43

Description

@I4cTime

Summary

React Aria NumberField emits NaN (not null) when cleared; NaN ?? 0 is NaN; JSON.stringify serializes it as null; Pydantic output_width: int rejects with 422; the effect's rejection handler sets setPreview("gamescope --").

Location

electron/renderer/src/components/gamescope-builder.tsx:768-777 (error fallback at 227)

Failure scenario

User clears "Out W" to type a new width -> preview, Copy, and Insert all yield the useless gamescope -- prefix; pressing Insert at that moment prepends a broken prefix to the launch options.

Fix

Treat NaN/empty as "unset" (omit the field) rather than coercing to 0; guard Insert against a degraded preview.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions