Skip to content

Move TuiCode to Terminal.Gui 2.5 and MentalDesk.Tui 0.2.0 #442

Description

@jamescrosswell

Context

TuiCode is on Terminal.Gui 2.1.0. The shared library moved to 2.5 in MentalDesk.Tui 0.2.0 (mentaldesk/tui-style-guide#11), and a-team followed (mentaldesk/a-team#346). So TuiCode can't take any library release until it moves too. Dependabot's #440 makes the version bump and shows what breaks.

#40's paste task also needs 2.5, because bracketed paste arrived in 2.4. That pitch planned the upgrade as part of its fourth task; it's split out here so it can land on its own, as a change that alters nothing.

What 2.5 changes, from the two upgrades already done (the library's Themes.cs and a-team's BundledThemes.cs are worked examples):

  • ConfigurationManager is gone, replaced by TuiConfigurationBuilder (migration guide). Bump MentalDesk.Tui and Terminal.Gui #440's build errors are all in DefaultSettingsService.cs. The 2.5 calls are TuiConfigurationBuilder.Shared.RuntimeConfig, ApplyToStaticFacades(), ThemeManager.Theme and ThemeManager.GetThemeNames().
  • Config JSON must be nested: Themes and Schemes keyed by name, and no dotted keys such as Dialog.DefaultShadow. 2.5 skips an old-shape file with only a log warning. So src/TuiCode.Workbench/Themes/themes.json needs converting, and anything TuiCode writes to ~/.tui needs checking.
  • TextView is obsolete in favour of Terminal.Gui.Editor. EditorTextView derives from it. That only means CS0618 warnings here, since CI doesn't treat warnings as errors.
  • A theme switch no longer re-applies key bindings. Check whether WorkbenchHost.NeutralizeBuiltinQuitKey still needs to run after one.
  • Tests that fake an open menu need its popover visible as well as enabled before an item takes its letter.
  • The real risk is at runtime, where TuiCode reaches into 2.1 internals: the copied draw loop, the content-width cache ([UnsafeAccessor] plus reflection), and the other places AGENTS.md marks "TG 2.1.0".

Acceptance criteria

  • TuiCode looks and works as it did: opening and editing files, multiple cursors, undo, soft wrap, find and replace, diff and review tabs, settings, and keybindings.
  • Every bundled theme shows as before, and switching between them works.
  • A theme and keybindings saved by the current release still load.
  • Esc still doesn't quit.

Tests

  • Before the version moves, a test for each place TuiCode reaches into Terminal.Gui 2.1 internals, as Make native OS shortcuts (Cmd+C/V/X etc.) work across different terminal emulators #40 planned, so a regression fails a test rather than turning up in use. EditorTextViewDrawTests and EditorTextViewContentWidthTests cover some already.
  • Re-diff TextView.Drawing.cs against the editor's copy, as AGENTS.md says to on an upgrade, and drop the copy if 2.5 bounds the loop upstream.
  • Theme loading from the converted themes.json: every bundled theme registers and applies.
  • CI's AOT smokes (--smoke, --smoke-syntax) on every platform.

Out of scope

🤖 Generated with Claude Code

Activity

  1. a-team-app commented on Oct 6, 2026

    @a-team-app
    Contributor

    Not pitching this: it's already a buildable task (criteria, tests, out of scope), and a pitch would only add an approval round before an Urgent change.

    The board won't let me move an Idea to Ready, so please move it there yourself; the Dev will take it next at Urgent. #446 (paste, #40) is blocked on it.

  2. added
    a-team:skippedThe Lead found nothing to pitch here; comment on it to put it back in the running
    on Oct 6, 2026
  3. a-team-app commented on Oct 8, 2026

    @a-team-app
    Contributor

    From reading #440's release notes, two things this task should know about. Neither needs a new task.

    • EditorTextView won't compile either. Bump MentalDesk.Tui and Terminal.Gui #440's build stops at DefaultSettingsService because it only bumps Workbench. Once the Editor project moves, public override string Text in EditorTextView.History.cs fails: View.Text isn't virtual in 2.5. That setter resets undo history, extra carets and auto-indents when a file is reloaded. It needs to move to OnTextChanged, with a test that reloading a file clears undo.
    • The Settings spinners become typeable. 2.5's NumericUpDown accepts typed numbers. Indent size and sidebar width get that for free. Check that a typed value outside the allowed range is still refused.

    Driver names (windows, dotnet, ansi) are the same in 2.5, so the Windows default in Program.cs stays as it is.

  4. a-team-app commented on Oct 8, 2026

    @a-team-app
    Contributor

    Draft PR #472 is up.

  5. jamescrosswell commented on Oct 8, 2026

    @jamescrosswell
    ContributorAuthor

    #472 is failing in CI. I made multiple comments on that PR that have been ignored.

  6. added a commit that references this issue on Oct 8, 2026
    38c892c
  7. a-team-app commented on Oct 8, 2026

    @a-team-app
    Contributor

    Answered on #472: the Windows failures are fixed in 38c892c (four tests didn't pin a screen size, and TG 2.5 takes it from the console), and CI is running again.

  8. added a commit that references this issue on Oct 8, 2026
    42bf5a9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-team:devClaimed by the a-team Deva-team:skippedThe Lead found nothing to pitch here; comment on it to put it back in the runningdependenciesPull requests that update a dependency file

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions