Skip to content

.NET: HarnessConsole: Improve rendering perf / reduce flickering#6014

Open
westey-m wants to merge 2 commits into
microsoft:mainfrom
westey-m:harness-console-renderingperf-improvement
Open

.NET: HarnessConsole: Improve rendering perf / reduce flickering#6014
westey-m wants to merge 2 commits into
microsoft:mainfrom
westey-m:harness-console-renderingperf-improvement

Conversation

@westey-m
Copy link
Copy Markdown
Contributor

Motivation and Context

Description

  • Reduce the amount of re-rendering for the main scroll area

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings May 21, 2026 17:47
@moonbox3 moonbox3 added the .NET label May 21, 2026
@github-actions github-actions Bot changed the title HarnessConsole: Improve rendering perf / reduce flickering .NET: HarnessConsole: Improve rendering perf / reduce flickering May 21, 2026
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

This PR updates the .NET Harness console rendering path to reduce unnecessary re-renders (and resulting flicker), primarily by changing how the scroll area is updated during streaming output.

Changes:

  • Simplifies HarnessAppComponent layout by removing the separate “last item” text panel and rendering all scroll content via TextScrollPanel.
  • Refactors TextScrollPanel to treat the last item as dynamic (re-rendered each update) while keeping earlier items “finalized”.
  • Reduces line-clearing work in ListSelection by erasing only the remainder of each line instead of the entire line.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
dotnet/samples/02-agents/Harness/Harness_Shared_Console/HarnessAppComponent.cs Removes dedicated last-item rendering and relies on TextScrollPanel for the full scroll region.
dotnet/samples/02-agents/Harness/ConsoleReactiveFramework/ConsoleReactiveMemo.cs Adds a small memoization helper for caching mapped outputs when inputs are unchanged.
dotnet/samples/02-agents/Harness/ConsoleReactiveComponents/TextScrollPanel.cs Implements “dynamic last item” rendering to minimize scroll-area redraws.
dotnet/samples/02-agents/Harness/ConsoleReactiveComponents/ListSelection.cs Switches from erasing entire lines to erasing to end-of-line to reduce redraw work.

Comment thread dotnet/samples/02-agents/Harness/ConsoleReactiveComponents/TextScrollPanel.cs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants