Fixed text fields which kept showing an issue while you typed (#1212)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-20 12:47:40 +01:00
1 parent 1db0f85898
commit fb8f51dec4
28 files changed
+249 -46

No files matched your search

+1
View File
@@ -39,6 +39,7 @@ Key structure:
- **JSON contracts** - The contracts of all JSON which AI Studio reads or writes are generated while compiling. Each kind of options names the `JsonSerializerContext` which knows its types, with `GenerationMode = Metadata`, as its `TypeInfoResolver` and ends with `.AsReadOnly()`; only `VisualBriefingJson.Canonical` leaves that out, see MWAIS0010. A new JSON type goes into the context of the options it is read or written with, and into `JsonTestRoots` in `app/Tests/Serialization/`, whose contract, defaults, and coverage tests then check it. Give JSON types `set` instead of `init`, because the source generator of .NET 10 drops the initializer of an `init` property which the JSON leaves out, and write a record or a `JsonObject` instead of an anonymous type. Never call System.Text.Json without options, nor with `JsonSerializerOptions.Default`, `.Web`, or a `DefaultJsonTypeInfoResolver`: each of them builds the contracts by reflection, whose code a published build may lack. MWAIS0015 refuses them while compiling, `JsonOptionsResolverTests` checks the resolvers of all options of the app, and the trim smoke test of `dotnet run verify` builds the contract of every type of their contexts in a trimmed build. Reflection itself stays switched on, because Blazor Server needs it for JSON of its own, see `Trimming.props`.
- **Long menus** - MudBlazor keeps a `MudSelect` inside the window by itself, but never a `MudMenu`: a menu taller than the window runs past its edge, and its lower entries cannot be reached. Give every `MudMenu` whose entries come from data, such as the assistants or the profiles, `MaxHeight="@MenuDefaults.MAX_HEIGHT"`, so that it scrolls.
- **Growing popovers** - Since version 9, MudBlazor places an open popover again whenever its content changes size. Content which unfolds later, such as a `MudCollapse` or an `ExpansionPanel` inside a `MudPopover`, therefore stays inside the window and needs no code of its own.
- **Validated text fields** - Without `Immediate` or a `DebounceInterval`, a `MudTextField` passes its text on only when the user leaves it, so an issue stays visible while the user types the text which resolves it. Give every `MudTextField` with a `Validation` which takes typing `DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS"` and bind its `Value`, not its `Text`: bound by its text, the field also delays the texts its parent sets, e.g., by a reset, and checks them although nobody touched it. `Immediate="@true"` works as well, but renders the parent with every keystroke. `ValidatedTextFieldTests` checks this rule.
- **Encryption** - Initialized before Rust service is marked ready
- **Access to the app server** - Only the app window gets into the Blazor server. `AppAccessMiddleware` runs first in `Program.cs`, right after the host filter, and refuses every request without the session cookie of the window or with an origin other than the app's own. Add no exception for any path, not even for static files: `AppAccessPipelineTests` checks the order in `Program.cs`. Since nothing but the window holds the cookie, the app never sends a request to its own server: read files below `wwwroot/` through `WebRootFiles`. The system browser gets no cookie either, so never open a URL of the app server there; offer a save dialog through `RustService` instead, as the ERI Server assistant does for its specification. `runtime/AGENTS.md` describes the runtime side.
- **Debug environment** - Reads `startup.env` file with IPC credentials