Repository navigation
fix(web): preserve numeric zero defaults in Studio previews - #45005
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #45005 +/- ##
==========================================
+ Coverage 89.53% 89.54% +0.01%
==========================================
Files 6009 6008 -1
Lines 376837 376888 +51
Branches 76232 76312 +80
==========================================
+ Hits 337385 337472 +87
+ Misses 33455 33419 -36
Partials 5997 5997
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
CI note for
A maintainer rerun of the failed job after the network recovers would help complete verification. I have not changed CI configuration or test thresholds to work around this. The four affected component suites pass locally (61 tests). |
Stream29
left a comment
There was a problem hiding this comment.
LGTM for fdc69b61706d6fab097c59fe3df6da5e5a6cb84c.
Reviewed the basic Chat and Completion Studio owners, default initialization, required validation, and both outgoing input-processing paths. The Number display expressions now preserve zero without converting the stored value to a string, and the validation exception is limited to numeric zero on Number variables. String "0", empty values, false, and other fields' existing required behavior are preserved.
The new owner regressions assert the displayed zero and outgoing numeric input in both previews. My independent local verification was source review and 246 assertions on extracted function bodies; I did not locally run mounted component, browser, or backend tests.
Fixes #45002. Follow-up to the zero-value reports #43240 and #43242 on the remaining Studio Debug surfaces.
Summary
A required Number variable with numeric default
0initializes correctly, but Studio's Chat and Completion controls render it as blank and the shared send check rejects it as missing. The default editor emits a number, so this is reachable through normal configuration; manually entering the string"0"hides the problem.Render numeric zero in both controls and allow it through required validation only for Number variables. Empty values and non-number falsy values retain their validation behavior. The change is limited to these three existing Studio owners and their Debug regression tests. Existing #43241/#44827 and #43243 cover different input surfaces.
The normal commit hook also requires logical-direction utility classes in the touched owners; its automatic fixes and removal of their obsolete lint suppressions are included.
Validation
inputs.n === 0for Chat and Completion.vp checkon the four changed files passed: 0 errors, 8 existing warnings.vp stagedpassed after its automatic fixes; no hooks were bypassed.vp checkpassed formatting on 9,072 files, then exhausted local memory during type-aware lint. It is not reported as a passing full-repository lint run.tsrstype-check binary (@tsrs/win32-x64is unsupported). This limitation is not reported as a passing type check.Screenshots
The component regressions assert the visible Number input value and the request payload. No browser screenshots were taken.
Checklist
From Codex