Skip to content

Conversation

@tig
Copy link
Collaborator

@tig tig commented Dec 14, 2025

This is a tweak on

that is intended to

a) Take the best from that PR and ensure it gets used going forward
b) Identify and fix the issue seen here:

devenv_flZe40Hnx6

Potentially related:

tig added 11 commits December 7, 2025 15:43


Previously, shadow size was fixed at 1x1. This change introduces ShadowWidth and ShadowHeight properties to both Margin and View, allowing variable shadow dimensions. The Margin class now manages its own shadow sizing, enforcing valid values based on ShadowStyle (e.g., Opaque and Transparent require a minimum of 1, and Opaque only allows 1). Margin.Thickness is dynamically adjusted to account for shadow size, with original values preserved and restored as needed.

ShadowView rendering is updated to correctly handle wide graphemes (such as emojis) in the shadow area, preventing rendering errors. The View class exposes ShadowWidth and ShadowHeight, synchronizing with Margin. Extensive new unit tests verify correct behavior for shadow sizing, style changes, thickness adjustments, and rendering, including edge cases and visual output.

Additional minor bug fixes and refactoring are included, such as proper management of Margin's cached clip region and correcting a loop order bug in ShadowView. The codebase is also modernized with recent C# features.
@codecov
Copy link

codecov bot commented Dec 14, 2025

Codecov Report

❌ Patch coverage is 67.12329% with 48 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.28%. Comparing base (fb1a3e0) to head (65c4889).

Files with missing lines Patch % Lines
Terminal.Gui/ViewBase/Adornment/Margin.cs 76.54% 13 Missing and 6 partials ⚠️
Terminal.Gui/ViewBase/View.Drawing.cs 8.33% 9 Missing and 2 partials ⚠️
Terminal.Gui/ViewBase/View.Adornments.cs 65.38% 7 Missing and 2 partials ⚠️
Terminal.Gui/ViewBase/Adornment/ShadowView.cs 75.00% 3 Missing and 1 partial ⚠️
Terminal.Gui/Drivers/OutputBufferImpl.cs 71.42% 2 Missing ⚠️
Terminal.Gui/Text/StringExtensions.cs 0.00% 2 Missing ⚠️
Terminal.Gui/Views/CharMap/CharMap.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           v2_develop    #4490       +/-   ##
===============================================
- Coverage       77.45%   66.28%   -11.18%     
===============================================
  Files             386      386               
  Lines           44678    44801      +123     
  Branches         6283     6305       +22     
===============================================
- Hits            34605    29695     -4910     
- Misses           8220    13119     +4899     
- Partials         1853     1987      +134     
Files with missing lines Coverage Δ
Terminal.Gui/Drawing/Glyphs.cs 100.00% <100.00%> (ø)
Terminal.Gui/Views/TextInput/TextField.cs 84.00% <ø> (-1.66%) ⬇️
Terminal.Gui/Views/CharMap/CharMap.cs 35.47% <0.00%> (-2.98%) ⬇️
Terminal.Gui/Drivers/OutputBufferImpl.cs 80.45% <71.42%> (-3.66%) ⬇️
Terminal.Gui/Text/StringExtensions.cs 60.16% <0.00%> (-28.46%) ⬇️
Terminal.Gui/ViewBase/Adornment/ShadowView.cs 89.43% <75.00%> (-3.43%) ⬇️
Terminal.Gui/ViewBase/View.Adornments.cs 87.09% <65.38%> (-5.77%) ⬇️
Terminal.Gui/ViewBase/View.Drawing.cs 83.79% <8.33%> (-6.40%) ⬇️
Terminal.Gui/ViewBase/Adornment/Margin.cs 86.77% <76.54%> (-4.51%) ⬇️

... and 163 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb1a3e0...65c4889. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tig tig mentioned this pull request Dec 14, 2025
8 tasks
tig added 10 commits December 14, 2025 12:45
Introduce AdornmentsEditor and ViewportSettingsEditor with custom border styles and positioning, enhancing UI editing capabilities. Also update arrangeableViewAtEven to use Color.Black and Color.Green, and adjust a commented border style from Dashed to Dotted.
Enhance ShadowStyles with a second shadow window (transparent style) and a button event handler that shows a message box. In WideGlyphs, add AdornmentsEditor and ViewportSettingsEditor for view property editing, apply custom color schemes to arrangeable views, and update superView with a transparent shadow and increased shadow width. These changes improve interactivity and visualization in the demo scenarios.
Enhance ShadowStyles with a second shadow window (transparent style) and a button event handler that shows a message box. In WideGlyphs, add AdornmentsEditor and ViewportSettingsEditor for view property editing, apply custom color schemes to arrangeable views, and update superView with a transparent shadow and increased shadow width. These changes improve interactivity and visualization in the demo scenarios.
v2_scenario-editors-tweaks
Adds Glyphs.ReplacementChar as a configurable replacement character, replacing all uses of Rune.ReplacementChar. The default is now a space (' ') and can be set via config.json. Updates all rendering, string decoding, and buffer invalidation logic to use the new property, ensuring consistency and themeability. Updates tests and comments accordingly. Also includes minor UI tweaks in WideGlyphs.cs and .DotSettings updates.
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