unify schema-driven settings forms#2510
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
c0cdea9 to
650a2fa
Compare
650a2fa to
059bd70
Compare
059bd70 to
77d8cbe
Compare
77d8cbe to
ff1899a
Compare
ff1899a to
7acd0d3
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue. You can view the agent here.
Reviewed by Cursor Bugbot for commit a02ed3d. Configure here.
ApprovabilityVerdict: Needs human review This refactoring PR has an unresolved high-severity review comment identifying a potential bug where settings fields may not render due to AST inference failing on schema-wrapped types. This substantive concern requires human verification. You can customize Macroscope's approvability policy. Learn more. |

Summary
@t3tools/contracts/schemaFormcontract module that owns the schema-form annotation vocabulary and the singleeffect/Schemamodule augmentationschemaForm/schemaFormSchemaannotations instead of main/provider-specific annotation namesschemaFormOptionLabels(...)so literal select labels must cover every literal member staticallyValidation
bun fmtbun lint(passes with existing unrelated warnings)bun typecheckcd apps/web && bun run test MainSettingsForm.test.ts ProviderSettingsForm.test.tsNote
Medium Risk
Refactors how both main and provider settings UIs are derived/rendered from schemas, which could change field ordering, defaults, and persistence/clear-empty behavior. While mostly internal plumbing, mistakes could lead to incorrect settings being displayed or saved.
Overview
Unifies settings UI generation around a shared schema-form contract and derivation pipeline. Adds
@t3tools/contracts/schemaForm(new exported module) to defineschemaForm/schemaFormSchemaannotations and typedschemaFormOptionLabels(...)for select labels.Moves settings metadata into schemas and reworks the web settings panels to consume it.
ClientSettingsSchema,ServerSettings, and provider settings schemas now carry titles/descriptions/order/reset labels/placeholders and control overrides (including a customtextGenerationModelSelectioncontrol), andSettingsPanelsrenders General settings via a newMainSettingsForminstead of hand-authored rows.Centralizes field inference and rendering. Introduces
apps/webschemaForm.tsto derive ordered, filtered field models (including control inference from schema AST and boolean defaults) andSchemaFormControl.tsxto normalize values and render controls, withProviderSettingsFormsimplified to use the shared pipeline and components.Reviewed by Cursor Bugbot for commit a02ed3d. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Unify settings forms to use a schema-driven field rendering system
schemaForm.tsandschemaForm.tsthat derives UI field models (control type, labels, order, defaults) from Effect schema annotations and AST inference.GeneralSettingsPanelandProviderSettingsFieldRowwith a unifiedSchemaFormFieldControlcomponent that handles switches, selects, text/password, and textareas.MainSettingsFormfor general settings with per-field dirty state tracking, reset buttons, and a custom-control injection point (used for the text generation model picker).settings.tsfrom provider-specific keys (providerSettingsForm,providerSettingsFormSchema) to the new unifiedschemaForm/schemaFormSchemakeys.useSettingsRestorenow derives changed-setting labels from schema annotations rather than a hardcoded list, so any field missing an annotation will no longer appear in the restore confirmation.Macroscope summarized a02ed3d.