Skip to content

Fixes #5369 - BREAKING CHANGE - Move IAcceptTarget to Terminal.Gui.Input namespace#5395

Open
Copilot wants to merge 2 commits into
developfrom
copilot/move-iaccepttarget-to-terminal-gui-input
Open

Fixes #5369 - BREAKING CHANGE - Move IAcceptTarget to Terminal.Gui.Input namespace#5395
Copilot wants to merge 2 commits into
developfrom
copilot/move-iaccepttarget-to-terminal-gui-input

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 24, 2026

Summary

Moves IAcceptTarget from namespace Terminal.Gui to namespace Terminal.Gui.Input to co-locate it with related command/input types (Command, CommandBinding, ICommandContext, etc.).

Breaking Change

This is a binary-breaking namespace move. Any downstream code referencing Terminal.Gui.IAcceptTarget in compiled IL will fail with TypeLoadException unless recompiled.

Changes

  • Terminal.Gui/Input/IAcceptTarget.csnamespace Terminal.Gui;namespace Terminal.Gui.Input;
  • docfx/README.md, docfx/docs/command.md, docfx/docs/command-diagrams.md — Updated xref/doc references
  • Tests/UnitTestsParallelizable/ViewBase/ViewCommandTests.cs — Namespace assertion test

Cross-Dependency Coordination Plan (TG ↔ TG.Editor)

Lessons Learned from #5372 / #5378 / #5386

The Bind/PlatformKeyBinding namespace move required a painful 3-PR dance:

  1. PR Closes #5369: Cannot move Bind/PlatformKeyBinding to Input namespace (binary compat blocker) #5372 discovered the binary compat blocker (Editor's compiled IL referenced old namespace)
  2. PR Fixes #5369. Move Bind and PlatformKeyBinding to Terminal.Gui.Input namespace #5378 worked around it with a local_packages/ hack (local .nupkg of Editor built against new namespace)
  3. PR Fixes #5380. Remove local Terminal.Gui.Editor package hack #5386 cleaned up the hack after a real Editor release was published

Why This PR Is Lower Risk

IAcceptTarget is not referenced in the gui-cs/Editor source or compiled package (verified via GitHub code search). The Editor package will not throw TypeLoadException from this move alone.

Release Sequencing Plan

This PR will not be released until after PR #5371 (View.Text CWP / non-virtual — another breaking change) is also merged, so we batch both into a single .minor version bump.

Step-by-step merge & release order:

┌─────────────────────────────────────────────────────────────────────┐
│ Phase 1: Merge breaking changes into TG develop                     │
├─────────────────────────────────────────────────────────────────────┤
│ 1. Merge PR #5371 (View.Text CWP breaking change)                  │
│ 2. Merge PR #5395 (this PR — IAcceptTarget namespace move)          │
│ 3. Run full CI on develop (all test projects green)                 │
└─────────────────────────────────────────────────────────────────────┘
         │
         ▼
┌─────────────────────────────────────────────────────────────────────┐
│ Phase 2: Pre-release validation in TG.Editor                        │
├─────────────────────────────────────────────────────────────────────┤
│ 4. In gui-cs/Editor, create branch: `update-tg-2.5.0`              │
│    - Bump TerminalGuiVersion property to new TG prerelease version  │
│    - Add `using Terminal.Gui.Input;` if any file needs IAcceptTarget│
│      (currently none — but verify at merge time)                    │
│    - Adapt to View.Text non-virtual changes (#5371) if affected     │
│    - Run Editor CI against TG develop nightly/prerelease feed       │
│ 5. Open PR in gui-cs/Editor — CI must pass                          │
└─────────────────────────────────────────────────────────────────────┘
         │
         ▼
┌─────────────────────────────────────────────────────────────────────┐
│ Phase 3: Coordinated release                                        │
├─────────────────────────────────────────────────────────────────────┤
│ 6. Tag & publish Terminal.Gui 2.5.0 to NuGet                        │
│ 7. Merge Editor PR (bumps to TG ≥ 2.5.0)                           │
│ 8. Tag & publish Terminal.Gui.Editor (next version) to NuGet        │
│ 9. Back in TG: bump `Terminal.Gui.Editor` PackageVersion in         │
│    Directory.Packages.props to the new Editor release               │
│ 10. Verify TG CI (NativeAot smoke test exercises Editor)            │
└─────────────────────────────────────────────────────────────────────┘

No Local Package Hack Needed This Time

Unlike the Bind/PlatformKeyBinding move (#5378), we do not need a local_packages/ workaround because:

  • IAcceptTarget has no compiled references in Editor's IL
  • The Editor's TerminalGuiVersion pin (2.4.0) will simply be bumped to ≥ 2.5.0 after TG releases

CI/CD Monitoring Checkpoints

Checkpoint What to verify Repo
After Phase 1 merge All TG test projects pass on develop gui-cs/Terminal.Gui
Editor PR opened Editor builds & tests pass against TG prerelease gui-cs/Editor
After TG 2.5.0 tag NuGet package published, GH release created gui-cs/Terminal.Gui
After Editor release Editor NuGet published, depends on TG ≥ 2.5.0 gui-cs/Editor
Final TG update NativeAot smoke test passes with new Editor pkg gui-cs/Terminal.Gui

Risk Mitigation

  • If Editor gains IAcceptTarget usage before merge: Add using Terminal.Gui.Input; to affected Editor files in the Phase 2 PR
  • If CI breaks after TG release but before Editor release: The existing TG.Editor 2.4.1 remains functional (no IL reference to IAcceptTarget) — no user-facing breakage
  • Rollback: If issues arise, revert this PR's commit on develop before tagging — the namespace move is a single-commit change

Verification

  • ✅ Full solution builds (0 errors)
  • ✅ All parallelizable tests pass
  • ✅ NativeAot example builds successfully
  • ✅ No new warnings introduced

Pull Request checklist:

  • I've named my PR in the form of "Fixes #issue. Terse description."
  • My code follows the style guidelines of Terminal.Gui
  • My code follows the Terminal.Gui library design guidelines
  • I ran dotnet test before commit
  • I have made corresponding changes to the API documentation (using /// style comments)
  • My changes generate no new warnings
  • I have checked my code and corrected any poor grammar or misspellings
  • I conducted basic QA to assure all features are working

Copilot AI assigned Copilot and tig May 24, 2026
Copilot AI linked an issue May 24, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Move IAcceptTarget to Terminal.Gui.Input namespace Move IAcceptTarget to Terminal.Gui.Input namespace May 24, 2026
Copilot finished work on behalf of tig May 24, 2026 00:25
Copilot AI requested a review from tig May 24, 2026 00:25
@tig tig changed the title Move IAcceptTarget to Terminal.Gui.Input namespace Fixes #5369. Move IAcceptTarget to Terminal.Gui.Input namespace May 24, 2026
@tig tig marked this pull request as ready for review May 24, 2026 19:10
@tig tig requested review from BDisp, Copilot and harder May 24, 2026 19:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Moves IAcceptTarget into the Terminal.Gui.Input namespace to align it with the rest of the command/input API surface, and updates docs/tests to reflect the new UID/namespace.

Changes:

  • Moved IAcceptTarget from Terminal.GuiTerminal.Gui.Input.
  • Updated DocFX docs/xref UIDs referencing IAcceptTarget to the new namespace.
  • Added a unit test asserting IAcceptTarget’s namespace to prevent regressions.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Terminal.Gui/Input/IAcceptTarget.cs Changes the interface namespace to Terminal.Gui.Input.
docfx/README.md Updates namespace prefix/UID documentation for IAcceptTarget.
docfx/docs/command.md Updates xref references from Terminal.Gui.IAcceptTarget to Terminal.Gui.Input.IAcceptTarget.
docfx/docs/command-diagrams.md Updates xref reference in diagrams text to the new namespace.
Tests/UnitTestsParallelizable/ViewBase/ViewCommandTests.cs Adds a test asserting IAcceptTarget is in Terminal.Gui.Input.

@tig tig changed the title Fixes #5369. Move IAcceptTarget to Terminal.Gui.Input namespace BREAKING CHANGE: Fixes #5369. Move IAcceptTarget to Terminal.Gui.Input namespace May 24, 2026
@tig tig changed the title BREAKING CHANGE: Fixes #5369. Move IAcceptTarget to Terminal.Gui.Input namespace Fixes #5369 - Move IAcceptTarget to Terminal.Gui.Input namespace May 25, 2026
@tig tig changed the title Fixes #5369 - Move IAcceptTarget to Terminal.Gui.Input namespace Fixes #5369 - BREAKING CHANGE - Move IAcceptTarget to Terminal.Gui.Input namespace May 25, 2026
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.

Move IAcceptTarget to Terminal.Gui.Input namespace

4 participants