tui refactor#461
Merged
Merged
Conversation
…for better clarity
… types for enhanced validation and restart tracking
…arious numeric input types
…tadata validation and basic format tests
Binary Size Analysis
|
…hout the codebase
…values and improve settings clone error handling
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Greptile Summary
This PR is a substantial TUI refactor that migrates all settings fields from plain Go primitives (
int,bool,string,time.Duration) to*Settingwrapper types carrying metadata (label, description, type tag,NeedsRestart, validation function). The migration touches 66 files and replaces reflection-on-reflect.Kinddispatch with reflection-on-Setting.Typestring dispatch throughout the settings read/write/format paths.internal/config/settings.go+settings_schema.go: introduces theSettingtype,Resolve[T](),Clone()via JSON round-trip, and a schema-drivenCategoriesListused for metadata export and validation.internal/tui/view_settings.go+helpers.go:setSettingValue,formatSettingValue,resetSettingToDefault, andcheckRestartRequirementare all rewritten to operate on*Settingpointers;snapshotSettingsis upgraded from a shallow struct copy toClone(), which is critical because the old shallow copy would now share*Settingpointers between live and baseline.TestSettingsUnitConversionis replaced byTestSetSettingValueConversions(targeted conversion checks) andTestSettingsMetadataValidation(schema completeness).Confidence Score: 5/5
Safe to merge; the refactor is mechanically correct and the critical upgrade from shallow-copy to deep-Clone in snapshotSettings prevents a shared-pointer bug that would have broken restart detection.
The new type-dispatch paths in setSettingValue, formatSettingValue, and checkRestartRequirement all handle the float64-after-JSON-deserialization coercion correctly. Clone() and ResolveT are sound. No correctness regressions were found in the production paths.
internal/config/settings_test.go is missing assertions that duration values survive the JSON round-trip correctly.
Important Files Changed
Prompt To Fix All With AI
Reviews (4): Last reviewed commit: "refactor: remove deprecated MaxConnectio..." | Re-trigger Greptile