Update all examples to Terminal.Gui 2.5.x (MEC configuration, post-#5416) - #4
Open
tig wants to merge 2 commits into
Open
Update all examples to Terminal.Gui 2.5.x (MEC configuration, post-#5416)#4tig wants to merge 2 commits into
tig wants to merge 2 commits into
Conversation
…416). Ports every example off the legacy ConfigurationManager API removed by tui-cs/Terminal.Gui#5416 and onto the 2.5 MEC-based model: - Remove ConfigurationManager.Enable (ConfigLocations.All) everywhere — configuration is applied automatically at assembly load in 2.5. - Example: RuntimeConfig theme override now uses TuiConfigurationBuilder.Shared.RuntimeConfig + ApplyToStaticFacades. - ReactiveExample: the ObservableEvents source generator cannot wrap 2.5's TextField (it hides View.TextChanging with a different delegate type); subscribe to TextField.TextChanged via Observable.FromEventPattern instead. - Migrate Config/*.json and Themes/code-dark.config.json to the nested MEC shape (dotted keys and Themes/Schemes arrays no longer apply). Key bindings stay supported via nested Application:DefaultKeyBindings, View:DefaultKeyBindings, and View:ViewKeyBindings with per-command overlay. - Drop the removed ConfigurationManager.ThrowOnJsonErrors key and fix a mojibake check-mark glyph in example_config.json. - Port FSharpExample to the v2 API (v2 namespaces, IApplication model, F# 9 nullness) and add it to the solution. - Rewrite the CommunityToolkit/Reactive/SelfContained/Config READMEs (updated snippets; the old files had no line endings and mojibake). - Bump Terminal.Gui to 2.5.0-develop.* (floats once 2.5 dev packages publish after tui-cs/Terminal.Gui#5416 merges). Verified against a locally packed 2.5.0-develop.1 from the #5416 branch: solution + FSharpExample build with 0 warnings/0 errors, and all 9 smoke tests pass. dotnet format verify reports only the 46 violations already present on main under SDK 10.0.400. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NGq38GbuZPAEa5wZHkmPiZ
…ys, F# smoke test. - Config/macos.json and windows.json: trim to only the commands they actually change (2.5's per-command overlay keeps defaults for omitted commands); drop windows.json's Quit row (it restated the compile-time default). - Config/README.md: correct the default-binding tables against the 2.5 source (Quit is Esc on all platforms; DeleteCharRight includes Ctrl+D by default), and document that a binding cannot be removed via config — windows.json cannot disable Suspend; use Application.RemoveDefaultKeyBinding in code. - Examples.sln: revert the auto-generated x64/x86 platform churn (~120 lines); add FSharpExample and the previously missing Examples.SmokeTests rows as plain Any CPU entries, so solution builds stop silently skipping the tests. - SelfContained/README.md: snippet now matches the code (Accepted event, and the AppModel.Inline line the example exists to demonstrate). - ReactiveExample/README.md: scope the .Events () caveat correctly (works for other views, never for TextField) and show the IValue ValueChanged binding. - ReactiveExample/LoginView.cs: replace the two duplicated FromEventPattern pipelines with one ObserveText helper over IValue<string>.ValueChanged. - FSharpExample: add a --smoke-test mode and cover it in Examples.SmokeTests (now 10 tests, all passing); fix a space-before-parens miss. The 2.5.0-develop.* floating version is intentionally left as the merge gate until Terminal.Gui#5416 publishes packages. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NGq38GbuZPAEa5wZHkmPiZ
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.
Ports every example to the Terminal.Gui 2.5 configuration model introduced by tui-cs/Terminal.Gui#5416 (legacy
ConfigurationManagerremoved, MEC-basedTuiConfigurationBuilder).Depends on
2.5.0-develop.*packages publishing to NuGet. CI restore will fail until then — the version bump inDirectory.Packages.propsfloats on2.5.0-develop.*.Code changes
ConfigurationManager.Enable (ConfigLocations.All)from all examples — 2.5 applies configuration automatically at assembly load.Example: theme override now viaTuiConfigurationBuilder.Shared.RuntimeConfig+ApplyToStaticFacades ().ReactiveExample: the ObservableEvents source generator cannot wrap 2.5'sTextField(it hidesView.TextChangingwith a different delegate type, generator emits CS0123); the twoTextField.TextChangedsubscriptions now useObservable.FromEventPattern. Button.Events ().Acceptingwrappers still work.FSharpExample: ported from the v1 API to v2 (v2 namespaces,IApplicationmodel, F# 9 nullness handling) and added to the solution.Config/JSON changes
Config/example_config.json,Config/macos.json,Config/windows.json,Themes/code-dark.config.jsonmigrated to the nested MEC shape withTools/MigrateConfig(dotted keys andThemes/Schemesarrays no longer apply in 2.5).Application:DefaultKeyBindings,View:DefaultKeyBindings,View:ViewKeyBindings(per-command overlay; unmentioned commands keep compile-time defaults).ConfigurationManager.ThrowOnJsonErrorskey; fixed a mojibake check-mark glyph.Verification
Verified against a locally packed
2.5.0-develop.1from the currenttig/remove-cm-followupbranch (isolated NuGet cache):Examples.sln(12 projects) +FSharpExample: build clean, 0 warnings / 0 errorsdotnet format --verify-no-changes: byte-identical violation list tomainunder SDK 10.0.400 (46 pre-existing, environmental) — no new violations introduced🤖 Generated with Claude Code
https://claude.ai/code/session_01NGq38GbuZPAEa5wZHkmPiZ