Release v2.2.3#5381
Merged
Merged
Conversation
Adds TabsFanOutDiagnosticTests with seven parallelizable tests that observe SubViewsLaidOut, DrawComplete, ClearedViewport, DrawingContent, and FrameChanged events per tab to measure layout/draw fan-out when an active TextView inside Tabs scrolls. Captures the current #4973 behavior so that future fixes can be verified and silent regressions caught: - Active tab vs. inactive tab layout work - Active tab vs. inactive tab draw work (DrawComplete, ClearedViewport, DrawingContent) - A comparable single-TextView baseline vs. tabbed scenario fan-out ratio - ViewportSettings.Transparent does not mask the diagnostic - Shadow margin does not mask active-tab activity - IOutput-level output (not Driver.Contents) is observed - Layout and draw counters reported separately so regressions can be localized to one pipeline The tests are instrumentation-only and do not change rendering or invalidation semantics.
TextView is being deprecated in favor of Code (read-only) and Editor
(editable). The fan-out behavior lives in the View base class layout/draw
pipeline, so any scrollable view inside Tabs reproduces it — swap to Code
so the diagnostic survives the deprecation.
Adjusts assertions to use only widget-agnostic signals (DrawComplete on
each tab, ClearedViewport on the Tabs container). Code overrides
OnClearingViewport/OnDrawingContent and returns true, which suppresses
the ClearedViewport/DrawingContent events on the Code instances. The
per-Code data is still reported but no longer asserted at that level.
Adds Tests/IntegrationTests/TabsFanOutIntegrationTests.cs that drives
the active tab via a real Key.PageDown through the input processor →
command dispatch → main-loop LayoutAndDraw path (rather than mutating
Viewport directly). Runs against all registered drivers. Confirms the
fan-out is observable end-to-end:
Driver: <each>
Active tab Viewport.Y after 3 PageDowns: 3
Tabs 3 3 3
Code1 (active) 3 3 0
Code2-4 (inact) 3 3 0
Sum inactive DrawComplete = 9
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Fixes #5356. Add tab fan-out layout/draw diagnostic tests
* Fixes #5367. Include Terminal.Gui.Editor in DocFX API reference Add a minimal EditorRef project that restores the Terminal.Gui.Editor NuGet package so its DLL is available at a predictable path. Update docfx.json with a metadata entry for the Editor assembly. NOTE: .github/workflows/api-docs.yml also needs a build step for EditorRef before docfx runs. That change requires workflow scope and must be applied separately by a maintainer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add EditorRef build step to api-docs workflow Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Remove --no-restore from EditorRef build step EditorRef.csproj is not in Terminal.sln so the repo-level restore does not cover it. Let dotnet build handle its own restore. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix TextAlignmentAndDirection scenario * Add a surrogate pair and a ZWJ emoji
…b nav (#5370) * Fixes #5365. Prevent Markdown table links from auto-focusing on initial render MarkdownTable.BuildLinkRegions() was setting CanFocus = true during layout, which caused View.AddAt() to auto-focus the table when the parent Markdown view had focus. This scrolled the viewport to the last table with links. Fix: Remove CanFocus assignment from BuildLinkRegions (keep TabStop only). The parent Markdown view now sets CanFocus on tables after Add() completes, then clears any auto-focused table to prevent unwanted viewport scrolling. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add Home/End key support to Markdown; fix Deepdives Tab navigation - Markdown: Add Command.LeftStart/RightEnd handlers so Home/End keys scroll to top/bottom (Ctrl+Home/End already worked via Command.Start/End) - Deepdives: Set TabStop = TabBehavior.TabStop on both FrameViews so Tab navigates between the list and markdown viewer (FrameView defaults to TabGroup which requires F6/Ctrl+Tab) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Prevent CursorDown/Up from escaping Docs list in Deepdives When the ListView is at the bottom/top and CursorDown/Up is not handled, it propagates to the Application level where it maps to NextTabStop, shifting focus to the markdown viewer. Add KeyDownNotHandled handler to consume arrow keys at boundaries. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Restore CanFocus in MarkdownTable.BuildLinkRegions for standalone use When MarkdownTable is used outside of a Markdown parent, BuildLinkRegions must set CanFocus = hasLinks so that tables with links are keyboard- navigable. The Markdown parent's OnSubViewLayout already handles clearing unwanted auto-focus that results from this. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix focus theft when Markdown content changes while another view has focus Root cause: OnSubViewLayout set table.CanFocus=true AFTER tables were already in the hierarchy. The CanFocus setter's auto-focus guard (SuperView is { Focused: null }) fired because the Markdown view had no focused child, calling SetFocus and stealing focus from the ListView. Additionally, when the Markdown view gains focus, SetHasFocusTrue calls AdvanceFocus(Forward, null) which auto-focuses the first focusable table. Fix: - Set CanFocus in BuildLinkRegions (before Add, when SuperView is null - the setter's guard doesn't fire) - Remove redundant CanFocus loop from OnSubViewLayout - Cancel auto-advance (behavior==null) in OnAdvancingFocus so gaining focus doesn't drill into table SubViews; only Tab navigation does - Remove incorrect KeyDownNotHandled workaround from Deepdives Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address CR: prevent table auto-focus during layout with two-phase approach - BuildRenderedLines: set CanFocus=false before Add() to prevent AddAt auto-focus, then re-enable with HasFocusChanging cancel handler after all tables are added (prevents CanFocus setter's auto-focus guard) - OnSubViewLayout: keep cleanup as safety net for edge cases where a table still gets focused; reset _activeLinkIndex to avoid link nav state leaking from layout - MarkdownTable.BuildLinkRegions: updated comment to accurately describe the CanFocus behavior for standalone vs hosted usage - Added 3 regression tests covering: multiple layout cycles, content change while focused, and multi-table cascade prevention - Strengthened original regression test with multiple layout/draw cycles All 17,076 parallel tests pass (96 MarkdownView + 38 MarkdownTable). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…amespace (#5378) * Fixes #5369. Move Bind and PlatformKeyBinding to Terminal.Gui.Input namespace Move both types from namespace Terminal.Gui to namespace Terminal.Gui.Input to match their sibling types (Key, KeyBinding, KeyBindings, ModifierKey, etc.) in the same directory. To break the circular dependency with the published Terminal.Gui.Editor NuGet package (which had compiled IL referencing Terminal.Gui.Bind), a local Editor package (2.2.6-local) is built against the namespace-fixed Terminal.Gui and placed in local_packages/. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Include Terminal.Gui.2.2.2-local.nupkg so Editor dependency resolves The local Editor package (2.2.6-local) depends on Terminal.Gui 2.2.2-local. Include that package in local_packages/ so restore succeeds for all projects. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9c43575342
ℹ️ 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".
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.
Release v2.2.3
Version:
2.2.3NuGet Package:
Terminal.Gui 2.2.3What happens when this PR is merged
v2.2.3main→developwill be openedChecklist
2.2.3