Skip to content

* Catchup 25/04/2026 - #3356

Merged
PWagner1 merged 8 commits into
3341-bug-discord-notifications-report-the-wrong-version-numberfrom
alpha
Apr 25, 2026
Merged

* Catchup 25/04/2026#3356
PWagner1 merged 8 commits into
3341-bug-discord-notifications-report-the-wrong-version-numberfrom
alpha

Conversation

@PWagner1

Copy link
Copy Markdown
Contributor

No description provided.

PWagner1 and others added 8 commits April 22, 2026 10:49
…e active)

## Summary

- Fixes [#3342](#3342): reduce multiline `KryptonTextBox` text flicker during resize, especially horizontal resizing.
- Updates `KryptonTextBox.InternalTextBox` painting logic to avoid redundant erase/paint cycles and to use native painting in the common enabled-text path.
- Adds a dedicated TestForm repro/demo (`Bug3342KryptonTextBoxResizeFlickerDemo`) with side-by-side native `TextBox` vs `KryptonTextBox` and stress-resize tooling.

## What Changed

- `Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTextBox.cs`
  - Suppress `WM_ERASEBKGND` in the internal edit control to avoid two-stage background erase + repaint flicker.
  - Route standard enabled-text painting through native `base.WndProc` for `WM_PAINT`/`WM_PRINTCLIENT`.
  - Keep custom painting only where needed (cue hint rendering and disabled text rendering).
  - During multiline resize (`OnResize`), temporarily disable inner edit redraw (`WM_SETREDRAW`), perform layout, then re-enable redraw and repaint once.

- `Source/Krypton Components/TestForm/Bug3342KryptonTextBoxResizeFlickerDemo.cs`
  - New demo form for issue `#3342`.
  - Includes side-by-side comparison:
    - Native multiline `TextBox` (baseline)
    - Multiline `KryptonTextBox` (subject under test)
  - Includes a start/stop stress-resize toggle for repeated horizontal resize behavior.

- `Source/Krypton Components/TestForm/StartScreen.cs`
  - Registers a launcher entry:
    - `Bug 3342 Multiline TextBox Flicker`

## Why

The remaining flicker was caused by repeated intermediate redraw operations while width changed, combined with unnecessary custom background work in common paint paths. This PR reduces redraw churn and aligns the default enabled multiline path with native edit control behavior.

## Test Plan

- [x] Build `Krypton.Toolkit` in `Debug`.
- [x] Build `TestForm` in `Debug`.
- [x] Launch TestForm and open `Bug 3342 Multiline TextBox Flicker`.
- [x] Verify behavior while resizing horizontally:
  - [x] Manual drag resize with text selected.
  - [x] Automated stress-resize toggle.
  - [x] Side-by-side comparison against native `TextBox`.

## Risks / Notes

- Custom cue hint and disabled text rendering paths are preserved.
- Resize redraw suppression is scoped to multiline resize on the inner textbox handle and restored in a `finally` block.
# Fix Discord release notifications reporting wrong version (4.0.0.0)

## Summary

Fixes incorrect version strings (notably **`4.0.0.0`**) in Discord
embeds for nightly, canary, and stable release workflows by obtaining
the package version through **evaluated MSBuild** and by removing a
fragile **XPath fallback** that matched the wrong XML node.

Closes
[#3341](#3341).

## Problem

The “Get Version” steps used this fallback when reading the version from
`Krypton.Toolkit 2022.csproj`:

```powershell
$projXml.SelectSingleNode("//Version")
```

`//Version` matches the **first** `Version` element in the project file.
In the Toolkit project, that is **not** the NuGet/assembly package
version; it is the **`System.Design`** reference metadata
(`<Version>4.0.0.0</Version>`). The real version is supplied by MSBuild
imports (`LibraryVersion` / `Version` in `Directory.Build.props`).

Whenever assembly-based discovery failed or was skipped, the workflow
fell back to this XPath and Discord showed **`4.0.0.0`** instead of the
actual **110.x** style version.

## Solution

1. **Primary:** `dotnet msbuild` with **`-getProperty:Version`** and the
correct **`-p:Configuration=…`** (`Nightly`, `Canary`, or `Release`) so
the version matches full MSBuild evaluation (same as the build).
2. **Secondary:** Resolve `Krypton.Toolkit.dll` by walking candidate
paths in a **fixed order** (`artifacts/bin/...` then `Bin/...`), using
`Test-Path` / `Get-Item`, instead of `Get-ChildItem` on an array
combined with `Select-Object -First 1` (order of results is not
guaranteed).
3. **Removed** the broken `//Version` XML fallback entirely.

## Files changed

| File | Change |
|------|--------|
| `.github/workflows/nightly.yml` | Get Version step | |
`.github/workflows/canary.yml` | Get Version step | |
`.github/workflows/release.yml` | Get Version steps (stable ×2, canary
×1) | | `.github/workflows/canary-lts-release.yml` | Get Version step +
DLL candidates include `artifacts`, `Bin`, and legacy `Artefacts` |

## How to verify

- Locally (example for nightly):

```powershell dotnet msbuild "Source/Krypton
Components/Krypton.Toolkit/Krypton.Toolkit 2022.csproj"
-getProperty:Version -p:Configuration=Nightly -nologo -v:q ```

Expect a **four-part numeric** version (e.g. `110.xx.mm.ddd`), not
`4.0.0.0`.

- After merge: trigger or wait for a workflow that publishes and posts
to Discord; the embed “Version” field should match the real toolkit
build version.

## Notes

- This description file (`Documents/PR-3341-description.md`) is for
maintainers to paste into the GitHub PR body; it can be deleted after
the PR is merged if you prefer not to keep it in the tree.
## Summary

- Fixes package installation failure for `Krypton.Standard.Toolkit` by preventing an invalid dependency on `Krypton.Navigator.Utilities` from being emitted in the generated nuspec.
- Restores aggregate package binary inclusion by correcting `AddReferencedAssembliesToPackage` paths to each referenced project's real `bin/<Configuration>/<TargetFramework>` output folder.
- Keeps pack-time framework alias normalization for target frameworks and framework assembly references, while preserving dependency suppression behavior intended for this aggregate package.
- Suppresses `NU5128` for this project because it intentionally suppresses dependency groups and carries binaries directly in `lib`.

## Root Cause

`Krypton.Standard.Toolkit` is an aggregate package (`IncludeBuildOutput=false`, `SuppressDependenciesWhenPacking=true`) that should ship binaries directly and avoid project-reference NuGet dependencies.

Two packaging issues combined:

1. The `NormalizePackTargetFrameworkAliases` target rewrote `_FrameworksWithSuppressedDependencies`, which could break dependency suppression and cause invalid dependency entries (including `Krypton.Navigator.Utilities`) to leak into the nuspec.
2. `AddReferencedAssembliesToPackage` referenced legacy `..\..\..\Bin\...` paths that no longer matched actual build outputs, so referenced binaries were skipped during packing.

## Changes

- In `Source/Krypton Components/Krypton.Standard.Toolkit/Krypton.Standard.Toolkit.csproj`:
  - Added `NU5128` to `NoWarn`.
  - Updated `NormalizePackTargetFrameworkAliases` to stop mutating `_FrameworksWithSuppressedDependencies`.
  - Repointed all `TfmSpecificPackageFile` includes for `dll/xml/pdb` to project-local output paths:
    - `..\Krypton.Docking\bin\$(Configuration)\$(TargetFramework)\...`
    - `..\Krypton.Navigator\bin\$(Configuration)\$(TargetFramework)\...`
    - `..\Krypton.Navigator.Utilities\bin\$(Configuration)\$(TargetFramework)\...`
    - `..\Krypton.Ribbon\bin\$(Configuration)\$(TargetFramework)\...`
    - `..\Krypton.Toolkit\bin\$(Configuration)\$(TargetFramework)\...`
    - `..\Krypton.Toolkit.JumpList\bin\$(Configuration)\$(TargetFramework)\...`
    - `..\Krypton.Utilities\bin\$(Configuration)\$(TargetFramework)\...`
    - `..\Krypton.Workspace\bin\$(Configuration)\$(TargetFramework)\...`

## Validation

- Ran:
  - `dotnet pack "Source/Krypton Components/Krypton.Standard.Toolkit/Krypton.Standard.Toolkit.csproj" -c Nightly -p:TFMs=all`
- Verified:
  - Package is produced successfully in `Bin/Packages/Nightly/`.
  - Generated nuspec no longer contains invalid `Krypton.Navigator.Utilities` dependency.
  - Aggregate package `lib` now contains expected binaries/docs for:
    - `net472`, `net48`, `net481`
    - `net8.0-windows7.0`, `net9.0-windows7.0`, `net10.0-windows7.0`, `net11.0-windows7.0`
  - No `NU5128` warning for this package project.

## Issue

- Fixes #3348
## Summary

- Fixes package installation failure for `Krypton.Standard.Toolkit` by
preventing an invalid dependency on `Krypton.Navigator.Utilities` from
being emitted in the generated nuspec.
- Restores aggregate package binary inclusion by correcting
`AddReferencedAssembliesToPackage` paths to each referenced project's
real `bin/<Configuration>/<TargetFramework>` output folder.
- Keeps pack-time framework alias normalization for target frameworks
and framework assembly references, while preserving dependency
suppression behavior intended for this aggregate package.
- Suppresses `NU5128` for this project because it intentionally
suppresses dependency groups and carries binaries directly in `lib`.

## Root Cause

`Krypton.Standard.Toolkit` is an aggregate package
(`IncludeBuildOutput=false`, `SuppressDependenciesWhenPacking=true`)
that should ship binaries directly and avoid project-reference NuGet
dependencies.

Two packaging issues combined:

1. The `NormalizePackTargetFrameworkAliases` target rewrote
`_FrameworksWithSuppressedDependencies`, which could break dependency
suppression and cause invalid dependency entries (including
`Krypton.Navigator.Utilities`) to leak into the nuspec.
2. `AddReferencedAssembliesToPackage` referenced legacy
`..\..\..\Bin\...` paths that no longer matched actual build outputs, so
referenced binaries were skipped during packing.

## Changes

- In `Source/Krypton
Components/Krypton.Standard.Toolkit/Krypton.Standard.Toolkit.csproj`:
  - Added `NU5128` to `NoWarn`.
- Updated `NormalizePackTargetFrameworkAliases` to stop mutating
`_FrameworksWithSuppressedDependencies`.
- Repointed all `TfmSpecificPackageFile` includes for `dll/xml/pdb` to
project-local output paths:
    - `..\Krypton.Docking\bin\$(Configuration)\$(TargetFramework)\...`
    - `..\Krypton.Navigator\bin\$(Configuration)\$(TargetFramework)\...`
-
`..\Krypton.Navigator.Utilities\bin\$(Configuration)\$(TargetFramework)\...`
    - `..\Krypton.Ribbon\bin\$(Configuration)\$(TargetFramework)\...`
    - `..\Krypton.Toolkit\bin\$(Configuration)\$(TargetFramework)\...`
-
`..\Krypton.Toolkit.JumpList\bin\$(Configuration)\$(TargetFramework)\...`
    - `..\Krypton.Utilities\bin\$(Configuration)\$(TargetFramework)\...`
    - `..\Krypton.Workspace\bin\$(Configuration)\$(TargetFramework)\...`

## Validation

- Ran:
- `dotnet pack "Source/Krypton
Components/Krypton.Standard.Toolkit/Krypton.Standard.Toolkit.csproj" -c
Nightly -p:TFMs=all`
- Verified:
  - Package is produced successfully in `Bin/Packages/Nightly/`.
- Generated nuspec no longer contains invalid
`Krypton.Navigator.Utilities` dependency.
  - Aggregate package `lib` now contains expected binaries/docs for:
    - `net472`, `net48`, `net481`
- `net8.0-windows7.0`, `net9.0-windows7.0`, `net10.0-windows7.0`,
`net11.0-windows7.0`
  - No `NU5128` warning for this package project.

## Issue

- Fixes #3348
#3347)

…e active)

## Summary

- Fixes
[#3342](#3342):
reduce multiline `KryptonTextBox` text flicker during resize, especially
horizontal resizing.
- Updates `KryptonTextBox.InternalTextBox` painting logic to avoid
redundant erase/paint cycles and to use native painting in the common
enabled-text path.
- Adds a dedicated TestForm repro/demo
(`Bug3342KryptonTextBoxResizeFlickerDemo`) with side-by-side native
`TextBox` vs `KryptonTextBox` and stress-resize tooling.

## What Changed

- `Source/Krypton Components/Krypton.Toolkit/Controls
Toolkit/KryptonTextBox.cs`
- Suppress `WM_ERASEBKGND` in the internal edit control to avoid
two-stage background erase + repaint flicker.
- Route standard enabled-text painting through native `base.WndProc` for
`WM_PAINT`/`WM_PRINTCLIENT`.
- Keep custom painting only where needed (cue hint rendering and
disabled text rendering).
- During multiline resize (`OnResize`), temporarily disable inner edit
redraw (`WM_SETREDRAW`), perform layout, then re-enable redraw and
repaint once.

- `Source/Krypton
Components/TestForm/Bug3342KryptonTextBoxResizeFlickerDemo.cs`
  - New demo form for issue `#3342`.
  - Includes side-by-side comparison:
    - Native multiline `TextBox` (baseline)
    - Multiline `KryptonTextBox` (subject under test)
- Includes a start/stop stress-resize toggle for repeated horizontal
resize behavior.

- `Source/Krypton Components/TestForm/StartScreen.cs`
  - Registers a launcher entry:
    - `Bug 3342 Multiline TextBox Flicker`

## Why

The remaining flicker was caused by repeated intermediate redraw
operations while width changed, combined with unnecessary custom
background work in common paint paths. This PR reduces redraw churn and
aligns the default enabled multiline path with native edit control
behavior.

## Test Plan

- [x] Build `Krypton.Toolkit` in `Debug`.
- [x] Build `TestForm` in `Debug`.
- [x] Launch TestForm and open `Bug 3342 Multiline TextBox Flicker`.
- [x] Verify behavior while resizing horizontally:
  - [x] Manual drag resize with text selected.
  - [x] Automated stress-resize toggle.
  - [x] Side-by-side comparison against native `TextBox`.

## Risks / Notes

- Custom cue hint and disabled text rendering paths are preserved.
- Resize redraw suppression is scoped to multiline resize on the inner
textbox handle and restored in a `finally` block.

<img width="671" height="255" alt="image"
src="https://github.com/user-attachments/assets/915c60aa-e579-4f77-bc45-7eeff4f189f5"
/>
@PWagner1
PWagner1 requested a review from a team as a code owner April 25, 2026 08:08
@PWagner1
PWagner1 merged commit 190625b into 3341-bug-discord-notifications-report-the-wrong-version-number Apr 25, 2026
13 of 15 checks passed
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