UX touch-friendly: add Evaluate button; increase min sizes/spacing; make variables/functions tap-to-insert via InsertVariable/InsertFunction commands.

This commit is contained in:
Codex CLI 2025-08-27 03:03:07 -05:00
commit 055c2fae03
2 changed files with 74 additions and 34 deletions

View file

@ -41,6 +41,37 @@ public partial class MainViewModel : ViewModelBase
IsFunctionsPanelOpen = !IsFunctionsPanelOpen;
}
// Insert helpers for touch: appends tokens to the input box
[RelayCommand]
private void InsertVariable(string? variableName)
{
if (string.IsNullOrWhiteSpace(variableName))
return;
InsertToken(variableName);
}
[RelayCommand]
private void InsertFunction(string? functionName)
{
if (string.IsNullOrWhiteSpace(functionName))
return;
InsertToken(functionName + "()");
}
private void InsertToken(string token)
{
if (string.IsNullOrEmpty(InputText))
{
InputText = token;
return;
}
if (!char.IsWhiteSpace(InputText[^1]))
InputText += " ";
InputText += token;
}
[RelayCommand(AllowConcurrentExecutions = false)]
private async Task Submit()
{