Skip to content

Port Editor and ted settings to MEC (re-derived; supersedes #240)#264

Merged
tig merged 3 commits into
developfrom
feat/mec-port-rederive
Jun 28, 2026
Merged

Port Editor and ted settings to MEC (re-derived; supersedes #240)#264
tig merged 3 commits into
developfrom
feat/mec-port-rederive

Conversation

@tig

@tig tig commented Jun 28, 2026

Copy link
Copy Markdown
Member

Summary

Ports Editor/ted configuration to Terminal.Gui's MEC path (TuiConfigurationBuilder), off the now-[Obsolete] ConfigurationManager API. Re-derived cleanly onto current develop to supersede the stale #240 (tig/mec-port, ~71 commits behind).

Aligns with TG's split migration plan:

  • #5411 — functional CM → MEC migration with compatibility shims (provides TuiConfigurationBuilder)
  • #5416 — later removal of legacy CM internals

This PR is the #5411-phase migration; it is not waiting on #5416.

What changed

Engine (src/Terminal.Gui.Editor)

  • New Configuration/EditorSettings.cs (settings POCO + static Defaults facade), EditorKeyBindingDefaults.cs (default binding table), EditorConfiguration.cs (Apply(IConfiguration) reading the Editor section + a legacy section).
  • Editor.Commands.cs: drop [ConfigurationProperty(Scope=typeof(SettingsScope))]; DefaultKeyBindings delegates to EditorSettings.Defaults.
    • Microsoft.Extensions.Configuration.Abstractions.

ted

  • New TerminalGuiConfigurationBootstrap (TuiConfigurationBuilderApplyToStaticFacades + EditorConfiguration.Apply + EditorSettings.Apply).
  • EditorSettings → POCO + MEC bind; Save() writes the MEC-native "EditorSettings": {…} shape and migrates away from legacy dotted / AppSettings keys. Legacy CM attributes retained under #pragma CS0618 as a transition shim.
  • Program.cs: replace ConfigurationManager.Enable with the bootstrap.

Tests: keybinding-config + ted-persistence suites ported to the MEC path; Microsoft.Extensions.Configuration added to the two test projects.

Validation

Built + tested against Terminal.Gui release/v2.4.14-beta.1 (2.5.0-beta.1, contains #5411) via the local-enlistment switch:

  • Build: succeeded
  • Tests 571 · IntegrationTests 353 · ConfigTests 1 — all 0 failures

⚠️ CI gating (expected red until TG ships #5411)

Editor CI builds against the published TG package line. The engine package builds against the current pinned TG, but ted requires TuiConfigurationBuilder (#5411), which is not yet in any published TG package — so hosted checks fail with missing-type errors until TG publishes a #5411 build (e.g. 2.5.0-beta.1 to NuGet, or #5411 on TG develop + a develop prerelease) and Editor's <TerminalGuiVersion> pin advances to it. Merge in lockstep with that bump.

Supersedes #240.

🤖 Generated with Claude Code

…ilder)

Re-derives the MEC migration (supersedes the stale #240 / tig/mec-port) onto
current develop.

Engine (src/Terminal.Gui.Editor):
- Add Configuration/EditorSettings.cs (POCO + static Defaults facade),
  EditorKeyBindingDefaults.cs (default binding table), and EditorConfiguration.cs
  (Apply(IConfiguration) reading the "Editor" section + a legacy section).
- Editor.Commands.cs: drop [ConfigurationProperty(Scope=typeof(SettingsScope))];
  DefaultKeyBindings now delegates to EditorSettings.Defaults.
- Reference Microsoft.Extensions.Configuration.Abstractions.

ted:
- Add TerminalGuiConfigurationBootstrap (TuiConfigurationBuilder ->
  ApplyToStaticFacades + EditorConfiguration.Apply + EditorSettings.Apply).
- Migrate EditorSettings to a POCO + MEC bind; Save() writes the MEC-native
  "EditorSettings": {...} shape and migrates away from legacy dotted / AppSettings
  keys. Legacy CM attributes kept under #pragma CS0618 as a transition shim.
- Program.cs: replace ConfigurationManager.Enable with the bootstrap.

Tests: port keybinding-config + ted-persistence suites to the MEC path.

Validated against Terminal.Gui release/v2.4.14-beta.1 (2.5.0-beta.1, contains
#5411): build + Tests (571) + IntegrationTests (353) + ConfigTests (1) all green.

Gating: the engine package builds against the current pinned TG, but ted needs
TuiConfigurationBuilder (#5411), not yet in a published TG package - so hosted CI
stays red until TG publishes a #5411 build and Editor's TerminalGuiVersion pin
advances to it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4f20766ac5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

{
internal static void Apply ()
{
TuiConfigurationBuilder builder = new ("ted");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Gate the TuiConfigurationBuilder call on the TG bump

When building ted with the repo's default TerminalGuiVersion pin (2.4.14-develop.2 in Directory.Build.props), this direct reference requires the new Terminal.Gui MEC API before the dependency has been bumped, so examples/ted and the solution fail to compile and the Program.cs comment's CM fallback can never run. Please either bump the Terminal.Gui pin in the same change or keep a real compatibility path, e.g. conditional/reflection fallback to ConfigurationManager, until the new API is available.

Useful? React with 👍 / 👎.

tig and others added 2 commits June 28, 2026 09:36
2.4.15 is the first published stable TG with the MEC API this branch targets.
Builds + Tests (571) + IntegrationTests (353) + ConfigTests (1) all green
against the published package. Unblocks this PR's CI and fixes develop's
red TG-bump canary once merged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- TedConfigurationManagerTests.cs: move #pragma warning disable CS0618 above
  the using block (ReSharper whole-solution cleanup canonical order) — the
  local Stop-hook only cleans changed files, so this committed-file drift
  slipped past it; CI's whole-solution gate caught it.
- Program.cs: correct the bootstrap comment — there is no ConfigurationManager
  fallback; the MEC path requires Terminal.Gui >= 2.4.15 (addresses Codex review).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tig

tig commented Jun 28, 2026

Copy link
Copy Markdown
Member Author

Re: Codex P1 (gate the TuiConfigurationBuilder call on the TG bump) — addressed:

  • Pin bumped in this PR. TerminalGuiVersion is now 2.4.15 (commit bcd3f14), the first published stable Terminal.Gui containing #5411 / TuiConfigurationBuilder. The solution + ted compile and all suites pass (Tests 571 / IntegrationTests 353 / ConfigTests 1) against the published package.
  • No phantom fallback. The reflection/CM fallback was intentionally removed (per the original Port Editor and ted settings to MEC #240 design); the bootstrap uses TuiConfigurationBuilder directly and now requires TG ≥ 2.4.15. The misleading Program.cs comment promising a CM fallback has been corrected (commit f4f389f).

So the API is available before the call site, and the comment no longer implies an unimplemented path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant