Skip to content

fix(web): preserve numeric zero defaults in Studio previews - #45005

Merged
Stream29 merged 1 commit into
langgenius:mainfrom
MindOfqc:fix/studio-zero-default-inputs
Oct 29, 2026
Merged

Stream29 merged 1 commit into
langgenius:mainfrom
MindOfqc:fix/studio-zero-default-inputs

Conversation

@MindOfqc

Copy link
Copy Markdown
Contributor

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 0 initializes 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

  • New default-zero regressions fail on the unchanged production source and pass with the fix.
  • Affected Debug/input/Completion-panel suites: 4 files, 61 tests passed. They mount the actual Debug owner, default initialization and Number inputs, then verify both the displayed zero and outgoing numeric inputs.n === 0 for Chat and Completion.
  • Required empty inputs remain rejected. A separate temporary runtime probe also verified missing, null, empty-string and false values block sending; the permanent tests keep their declared input types.
  • Scoped vp check on the four changed files passed: 0 errors, 8 existing warnings.
  • Normal pre-commit vp staged passed after its automatic fixes; no hooks were bypassed.
  • A broader related-directory run had three streaming-render failures; all three reproduce against the unmodified production baseline. No unrelated rendering changes were made.
  • The full-repository vp check passed formatting on 9,072 files, then exhausted local memory during type-aware lint. It is not reported as a passing full-repository lint run.
  • Windows cannot run the repository's tsrs type-check binary (@tsrs/win32-x64 is unsupported). This limitation is not reported as a passing type check.
  • Independent source/test review found no blocking issues. No browser deployment, backend or live-model test is claimed.

Screenshots

The component regressions assert the visible Number input value and the request payload. No browser screenshots were taken.

Checklist

  • Documentation update required — no API, configuration or navigation change.
  • Associated issue and proposed fix were published before this PR.
  • Verified the behavior and added regression coverage.
  • Full type check — blocked by the Windows binary support noted above.

From Codex

@github-actions github-actions Bot added size:L This PR changes 100-499 lines, ignoring generated files. web This relates to changes on the web. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Oct 29, 2026
@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.54%. Comparing base (0bd2012) to head (fdc69b6).
⚠️ Report is 23 commits behind head on main.

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              
Flag Coverage Δ
dify-ui 92.65% <ø> (ø)
web 89.51% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor Author

CI note for fdc69b61706d6fab097c59fe3df6da5e5a6cb84c: Chromium Full (2/3) failed during API dependency setup, before any browser tests ran.

setup-uv could not fetch its version manifest from https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson. All three attempts failed; the job then ended with fetch failed. The aggregate Web Full-Stack E2E check is red because of that setup failure.

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 Stream29 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@Stream29
Stream29 added this pull request to the merge queue Oct 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 29, 2026
@Stream29
Stream29 added this pull request to the merge queue Oct 29, 2026
Merged via the queue into langgenius:main with commit 9e55d53 Oct 29, 2026
86 of 88 checks passed
@laipz8200 laipz8200 mentioned this pull request Nov 3, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio Debug treats a required Number default of 0 as empty

2 participants