Added context compression (#1198)

Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
j-erlerandThorsten Sommer authored and GitHub committed 2026-11-21 14:16:04 +01:00
1 parent 28b88580a9
commit 8a4a26503b
54 files changed
+4582 -56

No files matched your search

@@ -0,0 +1,32 @@
using Microsoft.AspNetCore.Components.Web;
namespace AIStudio.Tools;
public static class KeyboardEventArgsExtensions
{
/// <param name="keyEvent">The key pressed.</param>
extension(KeyboardEventArgs keyEvent)
{
/// <summary>
/// Whether the key is Enter, of the main keyboard or of the number pad, pressed without Alt, Ctrl, or the Command key.
/// </summary>
/// <remarks>
/// Confirms a dialog whose text field takes a single line, e.g., a name. The key and its code are both
/// asked: the key names what the keyboard layout produces, the code the key on the keyboard. A text
/// field which takes several lines uses SendBehavior.IsSendShortcut instead, which follows the setting of
/// the user.
/// </remarks>
public bool IsPlainEnter
{
get
{
var key = keyEvent.Key.ToLowerInvariant();
var code = keyEvent.Code.ToLowerInvariant();
if (key is not "enter" && code is not "enter" and not "numpadenter")
return false;
return keyEvent is { AltKey: false, CtrlKey: false, MetaKey: false };
}
}
}
}