NetworkInspector.BaseApp 0.23.0

dotnet add package NetworkInspector.BaseApp --version 0.23.0
                    
NuGet\Install-Package NetworkInspector.BaseApp -Version 0.23.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NetworkInspector.BaseApp" Version="0.23.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NetworkInspector.BaseApp" Version="0.23.0" />
                    
Directory.Packages.props
<PackageReference Include="NetworkInspector.BaseApp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NetworkInspector.BaseApp --version 0.23.0
                    
#r "nuget: NetworkInspector.BaseApp, 0.23.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NetworkInspector.BaseApp@0.23.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NetworkInspector.BaseApp&version=0.23.0
                    
Install as a Cake Addin
#tool nuget:?package=NetworkInspector.BaseApp&version=0.23.0
                    
Install as a Cake Tool

NetworkInspector.BaseApp

The web host of a base application: it composes NetworkInspector.BaseApp.Core, listens on 127.0.0.1 only, guards every request before its body is read, optionally requires an access token, serves the Blazor Server window, and offers agents a REST surface with a generated OpenAPI document. An application project uses the Web SDK (Microsoft.NET.Sdk.Web), creates a builder, adds its pages, and runs.

What you get

  • One call to start: BaseApplication.CreateBuilder(args, identity) → configure → Build() → RunAsync().
  • A loopback-only Kestrel host on a preferred port that falls back to a free one, with one Info message naming both ports, or on a port the system picks at each start (app.portAuto, --port auto).
  • A guard that refuses a foreign Host (400) or Origin (403) before any handler or body read.
  • An optional access token (access.requireToken), held in memory only, and single-use start links for the window.
  • A diagnostic log: framework and application ILogger lines in the core's log file at log.level, secrets masked.
  • app.exit for agents, access.token.show and access.token.rotate for people.
  • REST under /api/ with an OpenAPI 3.1 document generated from the command catalog, paged list reads, and an untrusted list on every answer object that carries foreign text.
  • MCP over standard streams (--mcp-stdio) and loopback HTTP (/mcp) with six fixed tools, bounded agent HTTP traffic (connections with a wait, body size, receive time), and the list of connected agent clients (agents.list).
  • A last line on standard error and in the log file when an unhandled exception ends the process, naming a plugin whose code is on the failing stack.
  • The shell of every window: a page rail with the one keyboard-operable app menu on top (a drawer on phones), a top row that each page owns, status items, the license popup, a loading screen, reconnect, and the Welcome and About pages, About with the licenses of every component (see Shell).

Quickstart

Prerequisites: .NET SDK 10.0.100 or later. In an empty folder:

dotnet new web -n Empty.Application -o .
dotnet add package NetworkInspector.BaseApp
dotnet add package NetworkInspector.Licensing.Build

The project uses the Web SDK (it serves the package's Razor components and static files), references the license build (NetworkInspector.Licensing.Build, a development dependency that embeds the inventory the license gate shows), and states the facts of its own license entry; a missing fact fails the build with NILIC001 naming the property, and Authors equal to the assembly name counts as not stated. Empty.Application.csproj:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <Authors>Example</Authors>
    <PackageLicenseExpression>MIT</PackageLicenseExpression>
    <Copyright>Copyright (c) 2026 Example</Copyright>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="NetworkInspector.BaseApp" Version="0.22.0" />
    <PackageReference Include="NetworkInspector.Licensing.Build" Version="0.22.0" />
  </ItemGroup>
</Project>

Program.cs (replaces the template's):

using NetworkInspector.BaseApp;
using NetworkInspector.BaseApp.Components.Shared;
using NetworkInspector.BaseApp.Core;
using NetworkInspector.BaseApp.Core.Texts;
using NetworkInspector.BaseApp.Core.Ui;

namespace Empty.Application;

public static class Program
{
    public static async Task<int> Main(string[] args)
    {
        BaseApplicationBuilder builder = BaseApplication.CreateBuilder(args,
            ApplicationIdentity.FromEntryAssembly("Empty.Application", "Empty Application", "EmptyApplication"));
        builder.Pages.Add<HelloPage>(new PageDeclaration("hello", LocalText.Fixed("Hello"), Icons.Home, MenuPlace.Application, 10,
            ReachableBeforeAcceptance: false, ParametersType: null, Owner: "Empty Application"));
        return await builder.Build().RunAsync();
    }
}

HelloPage.razor:

<p>Hello</p>

dotnet run prints the address (http://127.0.0.1:<port>/) and opens the default browser: the shell of Empty Application asks to accept the licenses, then shows the menu with Hello and the base pages.

The sample samples/Sample.Application shows every extension point once; the base app guide walks through them.

Concepts

  • Identity. Technical name, display name, settings folder name, and semantic version; checked before anything starts. See the guide, step 1.
  • Commands. Every action of the UI, of an agent, and of the command line is one typed command through one pipeline, with the origin ui, rest, mcp, or cli; what the UI can do, an agent can do. See docs/agents.md.
  • Pages. A page is a component with a declaration (id, title, icon, menu place); the shell shows one shared page in every window and moves the address with it. Each page owns its top row (PageTopRow): its title and its tools.
  • App menu. One menu holds the application-wide commands, each once: the application's own branches (AppMenuEntry, the first path segment is the branch), one branch per plugin, Profiles, and Help (the application's guides). Every page is on the page rail, never in the menu, and the Exit control stands at the rail's foot. See Shell.
  • Widgets. A widget type is a view of a typed state on the dashboard; the layout changes only by commands and returns after a restart.
  • Popups. A popup type has typed parameters and a typed answer; the popup stack is shared by every window and agent.
  • Plugins. An application defines plugin kinds; the loader reads a plugin's identity and licenses from metadata without running it. See the plugin guide § 14. An application may ship plugin folders of its own (PluginKindRegistry.AddApplicationFolder): they load by default, before plugins.paths, under the same rules, and their rows carry the origin application (§ 15).
  • Licenses. The build embeds the inventory of everything shipped; the person accepts it once per change of its hash.
  • Texts. Typed English texts with translations that override them; English and German ship. See the texts guide.

What the base does not do

No single-instance rule (each start is its own process), no tree view, no presets, no widget editor framework, no action registry, no languages other than English and German out of the box, and no remote access: the host listens on loopback only.

Start options

The command line verbs (run, help, license show, license accept) and their options are in docs/agents.md; the desktop window is described in § Desktop mode. The text of --help (Sync: CommandLineParser.Usage):

Usage: {exe} [options]

Starts {display name}. Without options it opens the default browser.

Options:
  --desktop               Show the application in its own window (needs the desktop package).
  --no-ui                 Start without a window; agents use REST and MCP. Prints the address.
  --no-browser            Do not open the browser; only print the address.
  --port <n>              Preferred port on 127.0.0.1 (1024-65535); a taken port falls back to a free one.
                          --port auto: the system picks a free port at this start; app.port is ignored.
  --settings-path <dir>   Use this settings folder instead of the default one.
  --profile <name>        Use this existing profile for this run only.
  --set <key>=<value>     Set a setting for this run only; repeat for more. Never stored.
  --accept-licenses <h>   Accept the license set with hash h (from 'license show') before the start.
  --mcp-stdio             Serve MCP on standard input and output; no window, no HTTP.
  --help                  Show this help and exit.

Commands (attach to the running instance of the settings folder, else run standalone):
  {exe} run <command> --param <name>=<value> --json
      Run one command. Also: --params-file <file>, --target <kind:instance>, --yes, --dry-run,
      --attach | --standalone, --token-stdin (read the access token from standard input).
  {exe} help <command>
      Describe one command: parameters and examples. Without a name: every command.
  {exe} license show --json
      Show the license inventory and its hash.
  {exe} license accept <hash>
      Accept the license inventory with this hash.
  Common: --settings-path <dir>, --profile <name>, --set <key>=<value> (standalone only).
  Exit codes: 0 done, 1 the command failed, 2 usage problem.

A --set value is checked like a value typed on the Settings page (for example ui.scale takes the choices 90 % to 200 %, by name or number: --set ui.scale=120) and is never written to disk. An unknown key names the closest known one: Unknown setting ui.scal. Did you mean ui.scale?.

The port of a start comes from --port <n> (the command line wins for one run), else from --port auto or the setting Settings › Application Pick a free port at each start (app.portAuto, off by default), which let the system pick a free port on 127.0.0.1 at each start, else from app.port (Sync: WebHost.StartAsync, WebSettings.PortAuto). With a system-picked port nothing was taken, so no Port … is taken message appears; each start prints its own address, so several copies run side by side without choosing ports. --port 0 and --port automatic are refused: --port 0 is not a port between 1024 and 65535 or auto.

Exit codes

Code Meaning
0 Ended normally, --help, or a start cancelled before the host listened
1 Understood but failed: the settings folder cannot be used, the loopback address cannot be bound
2 Usage or identity problem: an option, a --set value, a missing --profile, a broken application identity, --desktop without builder.UseDesktop()
130 Ended at once: a second Ctrl+C (or SIGTERM) arrived while the application was stopping (Shutdown)

Every refusal is one sentence on standard error; besides them only the lines of a stop signal (Shutdown) are printed there.

With access.requireToken on, the start prints Access token: <token> as the first line of standard output, then the address as a start link http://127.0.0.1:<port>/start?key=<key>. The token exists only in the process's memory and on standard output: no file, log line, message, or journal line ever holds it, and a restart makes a new one.

  • Agents send Authorization: Bearer <token>; a wrong, shorter, or longer token, an empty bearer, or a token in the query string answers 401.
  • The start link enters the window once, within access.startLinkLifetime (60 s by default), and sets the ni-session cookie (HttpOnly, SameSite Strict, no expiry). The cookie is not the token, and it ends with the process.
  • access.token.rotate (window or command line only) prints Access token rotated: <token> and ends every session except the window that rotated. access.token.show reveals the token only to the window and the command line; agents get NotAllowed, and they cannot change or restore any access.* setting, also with the cli label over HTTP.

Command line

The executable is also a command-line client of itself: run <command>, help [<command>], license show [--json], license accept <hash>. A verb attaches to the running instance of the same settings folder when exactly one runs (through a record in run/ below the default settings folder; the record names the process, its loopback address, its start time, the application, and the settings folder, and holds no secret), else it composes a core of its own (standalone). --attach fails with exit 1 when not exactly one instance runs; --standalone never attaches. With the access token on, an attached call reads the token from standard input with --token-stdin; there is no option and no environment variable for it. Only the result goes to standard output (indented JSON, or one compact line with --json); {Code}: {message} goes to standard error with exit 1. --param name=value follows the parameter schema (numbers and booleans raw, arrays split at commas, objects as JSON). See docs/agents.md.

REST

Every route runs one command through the one pipeline (origin rest); the document is generated from the same catalog, never edited by hand.

Route Runs Notes
GET /api/status app.status Reachable before the licenses are accepted
GET /api/commands?search=&max= commands.search max 1 to agent.pageRows; a repeated key is refused
GET /api/commands/{name} commands.describe Schemas, examples, supportsDryRun
POST /api/commands/{name} the command Query target, dryRun, confirm; body application/json
GET /api/openapi.json none One POST operation per command, error schema, bearer scheme

Answers are {"ok":true,"result":…,"sequence":n} or {"ok":false,"error":{"code","message","parameter"}}. The status of each code: InvalidParameters 400, NotAllowed and LicenseNotAccepted 403, UnknownCommand and NotFound 404, InvalidState and Cancelled 409, LimitExceeded 429, Failed 500; a body that is not JSON answers 415, a wrong method 405 with Allow. Every /api/ answer carries Cache-Control: no-store and no Access-Control-* header.

Long lists (messages.list, jobs.list, commands.log, plugins.list, license.read) answer one page: entries, a cursor when more follow, and a cut sentence naming agent.pageRows or agent.pageDataSize when a bound ended the page. Pass pageSize (1 to agent.pageRows) and the cursor of the previous page. A cursor is tamper-proof, valid for one list in this process; the message list and the command log are paged by id, so new entries never invalidate a cursor. Every object that carries text from files, plugins, or other clients names those members in untrusted.

MCP

Two transports serve the same fixed tool set: --mcp-stdio (standard input and output; no window, no HTTP listener) and streamable HTTP at /mcp (stateless: every call is one POST). The tools are search_commands, describe_command, run_command, read_status, read_licenses, and accept_licenses; each runs one command of the catalog through the one pipeline (origin mcp). A failed command is a tool result with isError true and {"error":{"code","message","parameter"}}, the same error object as REST; an unknown tool is a protocol error. In a stdio session standard output carries protocol lines only: console writes of plugins go to standard error. A stdio session has no access token (access.requireToken has no effect there; one Info message says so), and an input line above agent.requestSize ends the session with one Error message.

Agent limits

Agent HTTP traffic (/api/… and /mcp) is bounded before routing; the window and its files are not.

Limit Bounds When hit
agent.connections Agent requests running at once The next request waits
agent.connectionWait How long a request waits for a free slot 503 with Retry-After: 1 and the sentence
agent.requestSize The body of one agent request, also chunked 413 with the sentence
agent.requestTime The time to receive one body 408 with the sentence, connection closed

Every refusal is {"ok":false,"error":{"code":"LimitExceeded","message":…}} with the standard hit sentence naming the key.

Connected agents

agents.list (and the agentClients status field) shows one row per open HTTP connection that carried an agent request, plus a running stdio session: surface (rest, cli for the label X-Ni-Client: cli, mcp), the name the client states (its User-Agent, or the MCP client name over stdio; control and format characters replaced, at most 100 characters, marked untrusted), connected since, last request, and requests. A row leaves when its connection closes. At most agent.clientsListed rows are listed: a client over it is served but not listed, counted in agentClientsUnlisted, and reported once per run of refusals as a Warning.

Shell

Every window is one shell: the page rail (from 744 layout px; collapsible to icons) with the one app-menu button on top and the collapse button and the Exit control at its foot, the top row of the shown page, the notice strip, the page area (the only scroll region), and the status bar. Below 744 layout px the rail leaves and the app-menu button at the start of the top row opens the drawer: one closed node Menu (data-menu="menu") holds the app menu, the heading Pages stands above the pages, both scroll in one box, and the drawer ends with the Exit control below it; Escape closes an open submenu first, then the drawer.

Exit. The rail and the drawer end with the one Exit control of the shell (data-test=rail-exit): a button with the power icon (Icons.Exit) below a gap and a line, never a page entry and never marked as the current page. Expanded (and in the drawer) it reads Exit {display name}; collapsed, that text is its tooltip. A press asks the close question of the desktop main window (DesktopCloseFlow, in every mode, also when closing affects nothing): Close ends the application through app.exit, Keep open leaves it running. It stays at the foot while the pages scroll above it. Over the page's area: the popups of the shown page (Popups). Above everything: the loading screen while plugins start after acceptance, the close question, and the license popup while the licenses wait (Accept is the only way past it, and no page shows until then; § License popup). A UI action is a command with origin ui, so an agent can do the same. The shell has no toolbar, no menu bar, and no theme or profile button of its own.

App menu. One WAI-ARIA menu (arrow keys, Enter, Escape) holds the commands, each once, and no page (every page is on the page rail), in this order:

  1. the application's branches, in add order (AppMenuEntry: the first path segment is the branch, never Profiles or Help in any case);
  2. one branch per plugin with entries, labelled with the plugin's UI name and its plugin badge (the plugin's path lies inside it);
  3. Profiles: one radio per profile, the active one marked, then Manage profiles, which opens the Profile tab of Settings;
  4. Help: the application's guides (AddGuide) in add order; left out when the application declares none.

The menu holds no Exit: the application ends through the Exit control at the foot of the rail. A branch without entries is left out. The node keys (app/sample/new counter, plugin/sample.plugin, profiles, profiles/{escaped name}, profiles/:manage, help/guide/{key}) are the data-menu hooks of the UI tests.

Every branch opens closed, and one branch per level is open: opening one closes the other open branch of its level. From 744 layout px each submenu flies out beside its parent entry, on its left where the right side lacks room, moved up where it would leave the bottom, and scrolling its own entries where it is taller than the window; a branch there ends in a chevron that points to the side. In the drawer the menu unfolds one level at a time, inline and each level indented under its parent (labels that do not fit are cut and show whole as their tooltip). A branch line there reads chevron, icon, label, badge: its chevron stands first, as every control of the base that opens something in place, Icons.Expand while closed and Icons.Collapse while open. The drawer shows the whole menu as one branch, Menu, above the pages: it opens closed, and opened it shows only the top level with every branch closed. A tap or a click opens or closes a branch and leaves the focus on it, Enter and ArrowRight open a branch and move into it, ArrowLeft and Escape close it again, and each opening of the drawer starts with Menu closed. Enter on the app-menu button opens the drawer with the focus on Menu; ArrowDown walks the shown menu entries and goes on into the pages, ArrowUp on the first page returns to the last shown entry. When the application removes the entry or the branch that has the focus, the focus moves to the nearest branch above it that remains, which stays open.

A path nests up to 8 submenu levels below its branch: an application's path holds its branch, up to 8 submenus, and the entry (2 to 10 segments of 1 to 64 characters); a plugin's path holds up to 8 submenus and the entry inside the plugin's branch (1 to 9 segments). A deeper path is refused when it is added: The app menu path '{path}' is {n} submenu levels deep; at most 8 are allowed below its branch. (ShellBuilder.AddMenuEntry and AppMenuEntries.Add throw ArgumentException; for a plugin the entry is left out with one Error Plugin {UiName}: … in Messages and the plugin keeps its other entries.)

A submenu shows while an entry lies under it; AddMenuSubmenu declares its parts (AppMenuSubmenu: a label in the window language, Icon, Tooltip; the menu and the drawer show the icon before the label and the tooltip on hover and on focus, and a submenu without an icon keeps no room for one), and a declaration without an entry under it shows nothing. The path follows the entry rule with the submenu's own segment as a level (the branch alone, Sample, gives the branch its parts); a second declaration of one path, in any case, throws ArgumentException:

builder.Shell.AddMenuSubmenu(new AppMenuSubmenu("Sample/Counters", LocalText.Of<SampleTexts>(t => t.Counters))
    { Icon = "sample.flask", Tooltip = LocalText.Of<SampleTexts>(t => t.CountersTip) });

An entry of the application or of a plugin may carry parts, read each time the menu opens (its button, by click or by an opening key), so they follow the application without a refresh call:

  • Icon: a name of Icons or an application icon (§ Application icons), shown before the label; an unknown name shows the neutral icon with one Warning per name and run.
  • Tooltip: shown on hover and on keyboard focus.
  • Checked: makes the entry an on/off entry (menuitemcheckbox with aria-checked) and answers whether it is on.
  • State: answers a MenuEntryState (enabled, or disabled with a reason). A disabled entry shows aria-disabled="true" and its reason as tooltip, and runs nothing on click or Enter; disabled without a reason is a bug and leaves the entry out.
  • Group: the entries of one branch show by group (lower first), then in add order, with a separator (role="separator", passed over by the arrow keys) where the group changes; the submenus follow the entries.

Checked and State run on each window's dispatcher, in several windows at once: keep them thread-safe and cheap. One that throws leaves its entry out for the run with one Error that names the entry's path; the rest of the menu keeps working. The entries of a plugin that is disabled (its start failed, or it hung later) stay, disabled, with the plugin's disabled text as tooltip (plugin {UiName} is disabled: plugin {name} failed to start), and none of the plugin's checks runs.

builder.Shell.AddMenuEntry(new AppMenuEntry("Sample/Reset counter 1", LocalText.Of<SampleTexts>(t => t.ResetCounterEntry(1)),
    "sample.counter.reset", null, SampleOwner.Name)
{
    State = () => counter.Read() == 0 ? new MenuEntryState(false, "Already 0") : new MenuEntryState(),
});
builder.Shell.AddMenuEntry(new AppMenuEntry("Sample/Count on start", LocalText.Of<SampleTexts>(t => t.CountOnStart),
    "sample.countOnStart.toggle", null, SampleOwner.Name)
{
    Icon = Icons.Add,
    Tooltip = LocalText.Of<SampleTexts>(t => t.CountOnStartTip),
    Checked = () => settings.View(SettingScopeId.Application).GetBoolSetting("sample.countOnStart") == true,
    Group = 1,
});

The sample shows both in SampleMenu.cs.

Every entry names its own node: an entry whose path equals another's in any case, or whose path another entry continues (Sample/More next to Sample/More/Deep, which would make it a submenu too), is refused with a sentence that names both paths; ShellBuilder.AddMenuEntry and a plugin's AddMenuEntry throw ArgumentException (a plugin then fails to load).

Live entries. The application adds and removes its own entries while it runs through the singleton AppMenuEntries (inject it): Add takes an entry under the same rules as the build (path, parts, node check against the build-time and the other live entries) and returns a handle whose Dispose removes exactly that entry, once. Every window's menu follows without a reload; a branch whose last entry goes is left out. Changed is raised after each change, on the thread of the add or removal. Only the application adds here: an entry whose owner is a plugin's unique name is refused with Only the application adds app menu entries while running; plugins add theirs at commit. The sample's branch Sample ▸ Counters shows one entry per named counter (SampleCountersMenu.cs).

IDisposable entry = menu.Add(new AppMenuEntry("Sample/Counters/Counter 3", LocalText.Fixed("Counter 3"), "ui.navigate",
    "{\"page\":\"counter\"}", SampleOwner.Name));
entry.Dispose();   // removes it from every window

Page rail. Every visible page and nothing else. The working pages scroll: Welcome, the application's pages, the plugins' pages (with the plugin's name as badge); ties by Order. Below them the base pages form a fixed lower block that never scrolls away (data-test=rail-base; in the drawer it follows after a line): Messages, Jobs, Commands, Plugins, Settings, About. A page may name a rail group (PageDeclaration.Group, a LocalText; pages whose group reads the same in English share it): within each owner block (Welcome and the application's pages, then the plugins' pages) the pages without a group come first, then each group in the order of its first page, its heading (a small caption, no link) once above it, so a plugin's page never comes before an application's group; the collapsed rail shows a divider instead. ui.pages answers each page's group. The rail starts collapsed to icons (ui.menuCollapsed, on by default, per profile): each icon has its page title as tooltip, a count badge stays as a mark on the icon, and the collapse button in the rail's foot expands it; the choice is kept. A count badge (unseen errors and warnings on Messages, running jobs on Jobs) shows at most three digits: above 999 it reads 999+ in every language, its tooltip holds the exact count with digit groups (1 500), and the collapsed entry's accessible name keeps the exact count; the entry never grows. The drawer is never collapsed. Below the pages and the collapse button, set apart, stands only the Exit control; a page added while running lands above it. Base pages and where a person reaches them (Sync: BasePages):

Id Title Reached from ui.navigate before acceptance
welcome Welcome page rail, first entry no
messages, jobs, commands Messages, Jobs, Commands page rail, base block no
plugins, settings Plugins, Settings page rail, base block no
about About with the licenses (cannot be hidden) page rail, base block (last) yes
licenses alias: About at its licenses part (about?part=licenses); not on the rail links, ui.navigate yes

Before acceptance no window shows a page, only the license popup; the last column says which pages an agent's ui.navigate may make the shared page then (the window shows it after acceptance).

One home. Each function has one menu place. A second way to reach it is only a direct link to that place or a control that acts on what it sits on (the rail's collapse button); the status bar is information and links nowhere. Theme, UI scale, and language change only on the Settings page and by command. Adjacent menu entries, rail entries, and list rows are apart by a line.

builder.Pages.Add<CounterPage>(declaration);                 // a page and its view
builder.Pages.AddView<CounterPage>("counter-2");             // a view for a page added later with PageRegistry.TryAdd
builder.Pages.Hide("commands");                              // a base page the application does not offer
builder.Shell.AddMenuEntry(new AppMenuEntry("Sample/New counter", LocalText.Of<SampleTexts>(t => t.NewCounter), "ui.popup.open",
    "{\"type\":\"sample.counter.new\"}", SampleOwner.Name));  // the branch Sample; up to 8 submenus below it
builder.Shell.AddGuide("tour", LocalText.Of<SampleTexts>(t => t.GalleryTour), "ui.navigate", "{\"page\":\"gallery\"}");
builder.Shell.AddStatusItem("sample.counter", 400, () => new StatusValue(Invariant($"Counter {counter.Read()}")));
builder.Shell.SetWelcomeContent<SampleWelcome>();
builder.Shell.SetAboutContent<SampleAbout>();

A plugin builder offers AddMenuEntry (a path of up to 8 submenus and the entry inside the plugin's branch, for example Say hello), AddMenuSubmenu (the parts of a submenu inside its branch), AddStatusItem, and AddWelcomeContent; they appear when the plugin commits. A welcome or about item that throws while rendering, or a status item whose read throws, is left out in every window with one Error per item and run; a page that throws shows a card with the reason and Try again.

Top row. A page renders PageTopRow anywhere in its markup; the row shows in the shell's top row while the page shows, its faults are the page's, and it leaves with the page. Without one the top row shows the page title. The default form shows the title, then the page's Tools, then its ChildContent (a control that is no tool, such as the Dashboard's widget chooser); Custom="true" draws its ChildContent in the title's place, for example a MenuBar, and the tools follow. The row is one line at most 44 px high (2.75rem at 100 %). Two PageTopRow in one page: the last one rendered wins.

Tools. A page (and a widget view, § Dashboard and widgets) declares its actions as Tools, never as markup: an id, a label (the accessible name and the More-menu text), an icon (a name of Icons or an application icon; a malformed name is refused when the tool is built, a name no one added shows the neutral icon), a tooltip, a run, a priority (higher stays visible longer, default 0), an optional state check that answers a ToolState (enabled, the reason while disabled, the pressed state of a toggle), and destructive (the destructive color, default false). The base draws them with ToolRow: icon buttons whose tooltip is the tooltip, or the reason while disabled (a disabled tool stays focusable, runs nothing, and keeps its muted look under the pointer, like every disabled icon or text button of the base); a toggle carries aria-pressed. A tool without a label or tooltip is refused when it is built (Tool follow needs a tooltip.). When the row lacks room, the tools of the lowest priority (equal priorities: the later declared) hide, and the More button (⋮) at the row's end opens one menu that lists them with icon and label, highest priority first; nothing scrolls sideways. A state check that throws, or a disabled state without a reason, leaves that tool out with one Error per tool and row (Tool {id} of {owner} failed: …; in a top row the owner is the page title). A tool that opens a Popover gives the popover its own id: the popover sits at the tool, or at the More button while the tool is folded. Build the list in a property, so labels, tooltips, and states follow the language and the page's state on each render; a run re-renders the page when it is a method of the page. The base package and its unit tests alias Tool to this type in their GlobalUsings.cs, because ModelContextProtocol.Protocol.Tool has the same name; an application imports no MCP namespace.

<PageTopRow Tools="@_Tools" />
<PageTopRow Custom="true" Tools="@_Tools"><MenuBar Label="Gallery menu" Roots="@_Roots" /></PageTopRow>
@code {
    private IReadOnlyList<Tool> _Tools =>
    [
        new("counter-add-tool", T.Current.AddOne, Icons.Add, T.Current.AddOneTip, _AddAsync, priority: 2),
        new("counter-reset", T.Current.ResetCounter, Icons.Rotate, T.Current.ResetCounterTip, _ResetAsync, priority: 1,
            state: () => _Value == 0 ? new ToolState(false, T.Current.AlreadyZero) : new ToolState()),
    ];
}

Armed clear. A clear that needs a second press is an ArmedClear the page holds: its constructor takes the tool id, the label, the idle and armed tooltips as functions of the count, the Cancel label and tooltip, the reason shown while there is nothing to clear, the clear itself, and the page's render request. Tools(count) answers the tools of this render: with a count of 0 the clear tool disabled with the reason (and the clear disarmed); idle, the destructive clear tool with the idle tooltip (aria-pressed false); armed after the first press, the same tool pressed in the danger fill with the armed tooltip, followed by the Cancel tool {id}-cancel (Icons.Close). The second press disarms, then clears; Cancel and Disarm() disarm without clearing; the page calls Disarm() when it leaves. The texts are fixed at construction: create a new one on a language change. Not thread-safe: the page's circuit only.

_Clear = new ArmedClear("messages-clear", t.ClearAll, t.ClearMessagesIdle, t.ClearMessagesArmed, t.Cancel, t.ClearCancelTip,
    t.NoMessages, _ClearNowAsync, StateHasChanged);
IReadOnlyList<Tool> tools = [_CopyAllTool(), .. _Clear.Tools(count)];

Status bar. One line of application-wide information, never controls: each item is a declared value (StatusValue: a text, an optional icon (a name of Icons or an application icon), a StatusState dot, an optional tooltip), and nothing in the bar reacts to a click or a key. An item is focusable only so that its tooltip opens on keyboard focus as on hover. ShellBuilder.AddStatusItem(id, priority, read) and WebPluginBuilder.AddStatusItem declare one (types in NetworkInspector.BaseApp.Components.Shell): the id has 1 to 64 characters of [a-z0-9._-] and is unique (a second item of an id is refused, naming both owners); the priority is 0 to 1000 (higher shows further left and stays longer); read returns the value now, or null to hide the item. Every window reads its items on its dispatcher at most ten times per second: after Refresh() of the returned StatusItem (any thread, any rate, no allocation), a plugin commit, a change of the base items' sources, or a language change; the read runs in several windows at once, so it is thread-safe and cheap. A read that throws leaves its item out in every window for the run with one Error (Status item {id} failed: …, source the owner); an unknown icon shows the neutral icon with one Warning. Where the items do not fit, the lowest priorities leave first and the last kept one ends with an ellipsis; the bar never wraps.

The base items, each of which ShellBuilder.HideStatusItem(id) hides (ids in BaseStatusItems; an application's own items normally take priority 400):

Id Priority Shows
base.activity 900 busy while a job is pending or running, else idle, with its state dot
base.jobs 800 1 job, 2 jobs (pending and running); none at 0
base.agents 700 1 agent, 2 agents (listed and unlisted); the tooltip lists surface · name per client; none at 0
base.profile 600 the active profile's name
base.language 500 the language of the windows, upper-cased (EN, DE)
StatusItem counter = builder.Shell.AddStatusItem("sample.counter", 400,
    () => new StatusValue(Invariant($"Counter {service.Value}"), Icons.Hash, Tooltip: "The sample counter's value"));
service.Changed += (_, _) => counter.Refresh();
builder.Shell.HideStatusItem(BaseStatusItems.Language);

A page with typed parameters declares ParametersType and a component parameter [Parameter] public T? Parameters; a deep link /counter?instance=2 maps each query key to the camel-case property of that type and becomes ui.navigate, and every window's address follows the shared page.

Texts: inject ITexts<TTexts> and take [CascadingParameter] ShellView; a new ShellView (language, theme, UI scale) re-renders the views without re-creating them, so typed text stays when the language changes. Numbers and times on screen use DisplayFormat (12 345, 2026-11-16 14:05:09, 1:05); agent answers and editable values never do. A time on a list entry uses DisplayFormat.TimeOfDayOrFull(time, zone, now): the time of day alone (19:10:59) when it falls on the current local day, else date and time, so a phone card's facts fit their line; details and copy lines keep date and time.

Plugin files: GET /_plugins/<plugin name>/<path> serves wwwroot/ next to a loaded plugin's assembly, only after the licenses are accepted (before: 403 LicenseNotAccepted). GET /_base/alive answers 204 for the reconnect probe.

Script interop: ShellScript is the one caller of shell.js; shell.js and clipboard.js are imported by their _content/NetworkInspector.BaseApp/ address, never script-tagged a second time. A component that holds a module or a DotNetObjectReference disposes in this order, each step catching JSDisconnectedException: the module's dispose(), the module reference, then the object reference.

Components (public, in NetworkInspector.BaseApp.Components.Shared):

Component Parameters Notes
Popover Id, Label (required), Placement (Below), ChildContent opens through PopoverService.Toggle(Id); one per window; the trigger carries data-popover-trigger
Badge Kind (Plugin, Count, Owner), Text (required), Tip ellipsizes; full text as tooltip, or Tip as its tooltip when given (the exact count behind 999+)
Card Title, ChildContent a section labelled by its h2
Toolbar AccessibleName (required), ChildContent role="toolbar"; every control stays in the Tab order
PageTopRow Title, Custom, Tools, ChildContent the page's own top row (see Top row above)
ToolRow AccessibleName, Tools (required), Owner declared tools as icon buttons; folds what does not fit into its More menu (data-test="tools-more", menu data-test="tool-menu")
MenuBar Label (required), Roots (MenuBarItem list) a classic menu bar (WAI-ARIA keys); a leaf runs its command with origin ui

A popover opens at its trigger (the element with data-popover-trigger of its id) and moves to stay inside the window.

License popup

While the licenses wait, every window shows LicensePopup above everything (the shell below it is inert). From the top: the title Licenses of {display name}, the summary line (data-test=license-summary), for example 44 entries · MIT 38 · Apache-2.0 3 · custom 1 · ISC 1 · OFL-1.1 1 (the number of entries, then every license with its count, the most frequent first, equal counts by name; a long line wraps), the statement, the hash as sha256 with the short hash (once in the popup), and the entries in About's form: LicenseEntries without its filter, the same groups, a table with headings where it fits and a card per entry below that, each entry opening in place to its required by and text (§ Base pages). The summary counts the lines the list shows, plugin lines and not stated included. The entries scroll inside their region (data-test=license-list), so Accept stays in view at every size and the popup never scrolls sideways (also at 390 × 844). Accept is the popup's one action and has the focus; Escape and a press outside do nothing, and the shell below shows no page until acceptance (the rail is inert, an address such as /about opens no page). Accept runs license.accept (origin ui) and closes the popup in every window; a page addressed before then opens after acceptance. A broken inventory disables Accept (aria-disabled) with the reason as its tooltip, and the popup stays.

Context menus

ContextMenuService.Register(key, entries) gives elements with data-ctx="key" a context menu (right click, long press, the ContextMenu key, Shift+F10); ContextMenuService.RegisterSubject(subject, entries, key) gives an element the menu of the subject it stands for (§ Actions); ContextMenuService.Open(entries, x, y, focusId) opens computed entries; ToastService.Show(text, kind) shows one toast in the calling window. A ContextMenuEntry runs a command (origin ui) or a local action, carries a disabled reason (its tooltip), or opens Children, and takes these optional parts (Sync: ContextMenuEntry, ContextMenu.razor):

  • IsHeader: the header line that names what the menu is about (Row 7); no menu item, the arrow keys skip it.
  • TextBlock: a long value as a block of text that wraps within the menu width (line feeds kept); no menu item.
  • Icon (a name of Icons or an application icon; an unknown name shows the neutral icon), Detail (a short muted text at the end, already in the window language, 12 ch), and Tooltip (an enabled entry's tooltip; a disabled entry shows its reason instead).
  • Children: a submenu that opens on hover (after --tip-delay), ArrowRight, and a click. From 744 layout px it flies out to the right of its entry and flips to the left, and moves up, when it would leave the window; below 744 layout px it shows inline below its entry, indented. The menu itself moves left and up near the window edges.

The row menu of VirtualList starts with the header Row {n} and Copy ▸ Text; with NumberRowsInMenu="false" it starts with Copy ▸ Text, as every EntryList menu does (an entry names a thing by its text, not by its place). Text copies the selected rows, its detail is the character count of the one selected row's copy text (with that text as tooltip, bounded as every tooltip) or the row count of a larger selection. In the card form of a column list (narrower than its columns) every card shows a More button, and every entry of an EntryList shows one at every width (Icons.More, tooltip More actions); it opens the same menu as a right click; the list handles it with one delegated listener for [data-list-more], and its tooltip is the one data-more-tip text on the list root, so it costs nothing per row and no row carries a tooltip attribute (Sync: VirtualList.razor, wwwroot/shell.js tipOf).

Tooltips. One tooltip element per window (#ni-tip) serves every element with data-tip (that text) or data-tip-overflow (its own text while cut), and every text cut with an ellipsis without any mark: style it white-space: nowrap; overflow: hidden; text-overflow: ellipsis and the full text shows. The tooltip opens when the pointer rests (--tip-delay), on keyboard focus (at once), and on a long press (--long-press); Escape closes it. Focus that script moves after a pointer action (a closed drawer, popup, or menu hands it back to its trigger) opens none: only focus the browser shows as keyboard focus (:focus-visible) or focus that a press moved does. Its target is the nearest marked element, else the nearest of the element under the pointer and its next three ancestors whose computed text-overflow is ellipsis and whose content is wider than its box. Keyboard focus on an element without a tooltip of its own shows the tooltip of its active row (a list: its RowTooltip, else the row's first cut cell; Arrow keys move it along), else its first cut text (a menu entry); focus that a pointer press moves shows only the element's own tooltip. A tooltip that keys showed stays until focus leaves, Escape, or a real pointer move onto another target; a re-render under a resting pointer does not hide it. No element carries a handler or an attribute for it, so a list pays nothing per row.

A tooltip can tell the state at the moment it shows: TipSources (one per window, in NetworkInspector.BaseApp.Components.Shared next to ContextMenuService) registers a function, and the element carries the key in data-tip-source. The function runs on the window's dispatcher when the tooltip shows; an answer that arrives after the pointer left or focus moved is dropped. Null or empty shows nothing; a function that throws shows nothing and writes one Error per registration (Tooltip of {owner} failed: …, source Shell), and hovering goes on working. Dispose the registration with the component.

<span tabindex="0" data-tip-source="@_CounterTip?.Key">@T.Current.CurrentCounter</span>
@code {
    [Inject] private TipSources _Tips { get; set; } = null!;
    private TipSource? _CounterTip;
    protected override void OnInitialized() => _CounterTip = _Tips.Register(() => T.Current.CounterTip(_Counter.Read()), "Sample");
    public void Dispose() => _CounterTip?.Dispose();
}

Every tooltip shows at most 600 characters and 12 lines; a longer text ends with a line break and the note … the text continues. (BaseTexts.TooltipContinues, in the window's language). The text goes in as text only and keeps its line breaks, a long word breaks anywhere, and the box stays inside the window, at most --tip-width wide and half the window high. The bound is for reading only: a list row's copy stays whole (Sync: wwwroot/shell.js tipChars, tipLines; Components/Shared/TooltipBound.cs).

Popups

One popup stack is shared by every window and agent, and each popup belongs to a page (OpenPopup.Page): the page of ui.popup.open, else the page the window shows for a window's own open (origin ui) and the start page for an agent. A window shows the popups of the page it shows over that page's area only (top row, notice strip, page area); the page rail, the app menu, and the status bar stay usable, and a popup waits on its page while the person looks at another one (it stays rendered, so typed text and a file browser's folder survive). Only the top popup of the page is operable; the ones below stay visible, dimmed, and inert, and the top one shows a trail of the page's stack (New counter › Discard changes?; above four names … and the last three, the full list as its tooltip). Escape runs the top popup's cancel. A short dialog (the confirm, an option form) is a card centered on the page area from 744 layout px and fills the page area below; every other popup fills the page area. Removing a page cancels its popups. Popups block no command, job, or agent. ui.state lists each popup with its id as a plain number ("id":7), the number ui.popup.answer and ui.popup.cancel take; a widget id there is a plain number too ("widget":1).

A widget popup belongs to one widget (OpenPopup.WidgetId; the widget of ui.popup.open, a widget of the layout, else NotFound naming widget): it covers exactly that widget's frame from header to status line and makes only that frame inert, so the other widgets, the page rail, and the page stay usable. A widget shows at most one widget popup; a second open answers InvalidState (Widget 1 already shows popup 7 (sample.widgetRename).). It is a card that fills a frame narrower than 30rem and is centered, at most 30rem wide, in a wider one. It traps no focus; Escape runs its cancel while the focus is inside it. It shows in every window that shows the widget (in a detached widget's own window, not in its dashboard placeholder), follows the widget back, and is cancelled when the widget closes (widget.close, dashboard.reset). Agents read it in ui.state and answer it like a page popup; it counts toward ui.popupsOpen. A view opens one with OpenPopupAsync (§ Dashboard and widgets).

Application-wide gates stop the whole window: the license popup, the loading screen, and the close question. Only the base opens the close question as an application-wide popup (PopupService.TryAskToClose, which the desktop close flow uses): it has no page, covers every window (detached ones too), is a card from 744 layout px like the confirm (its content scrolls, the answers stay at its foot), and a second close request while it is open gets the same question (§ Desktop mode). An application or a plugin opens page popups only. Below 744 layout px the app-menu button and the drawer stay above page popups. The layer order, bottom to top: page and widget content, widget panels, widget popups, popovers and menus, page popups, the drawer, the gates, the context menu, tooltips, toasts, and the reconnect notice; a popover opened inside a popup draws in that popup's layer (one home: the --layer-* tokens of StyleValues.Values).

builder.Popups.Add<RenamePopup, RenameParameters, RenameResult>(SamplePopups.Rename);   // a type and its view
builder.Popups.AddOptionForm(SamplePopups.NewCounter);                                   // fields from setting declarations
public static PopupType<RenameParameters, RenameResult> Rename { get; } = new("sample.rename",
    LocalText.Of<SampleTexts>(t => t.Rename), SampleOwner.Name, ["Rename"], SamplePopupCommands.CounterRename);

A view derives from PopupView<TParameters, TResult>: Parameters, AnswerAsync(button, value) (returns the refusal sentence or null), CancelAsync(), OpenAsync(type, parameters) (another popup on top, awaited), and OnCancelRequestedAsync() (Escape and the close button; the option form asks before it discards edits). An accepted answer closes the popup, then the type's answer command runs with the answerer's origin. A plugin builder offers AddPopup and AddOptionForm.

Base popups: BasePopups.Confirm (ConfirmPopup: Cancel has the focus; a destructive confirm is marked) and BasePopups.FileBrowser (FileBrowser: open files, save one, or choose a folder; typed path, parent folder, filter, multi-select in one folder; it lists with files.list; answers pass the agent file rule). A file browser that serves a setting takes its key (FileBrowserParameters.ForSetting): the head names it (Choose a file for plugins.paths, Choose a folder for plugins.paths; the key shown as text). While a filter hides files of the shown folder, a line under the path says how many (3 files are hidden by the type filter *.dll, from the filteredOut count of files.list; folders and hidden or system files never count). The details of a list entry are no popup: they open in the panel at the bottom of the page (DetailsPanel, § Lists). OptionFormType<TResult> declares its fields with a SettingsRegistrar, as real settings, on a fresh in-memory manager; the key's last segment is the result property. SettingEditor (public) edits one SettingRow: switch, choice, text (committed on change), or an ordered list (path lists add through the file browser for their key, § Settings page).

Lists

VirtualList<TItem> shows a RowSource<TItem> from empty to 2^63 − 1 rows. It owns its scrolling: no element grows with the count, so 10^10 rows scroll by wheel, touch, thumb, and keys like 1,000.

<VirtualList TItem="SampleRow" Source="_Synthetic" AccessibleName="Rows" CopyText="row => row.CopyLine"
             ContextMenu="_RowMenu" SelectionChanged="_OnSelectionChanged">
    <RowTemplate Context="row"><span>@row.Info</span></RowTemplate>
</VirtualList>
<PasteButton Pasted="_OnPastedAsync" />

Built in: reads by ranges with read-ahead around the view, placeholders while a range is read, Could not read rows: … with Retry on the rows of a failed range (a failed block is split until single rows fail), growth that follows the end or keeps the shown rows, a replace that keeps every selected item where RowSource.TryFind finds it (a selection of all rows stays all rows; selected rows whose items are gone or were never read leave the selection, and the list's bar says {n} selected rows left the list until the next selection), 64-bit range selection (click, Shift, Ctrl or Cmd, Space, Ctrl+A, tap; Ctrl+Shift with a click or the arrow keys adds the span from the anchor to the selection, Shift alone replaces the selection by it) with the count {n} selected in the list's bar from two selected rows, row numbers with go-to where the owner asks for them (ShowRowNumbers, below), copy of the selection as lines of CopyText, and the row menu (right click, long press, Shift+F10, the context menu key, the More button of a card; § Context menus): the header Row {n} (left out with NumberRowsInMenu="false", for rows that are things named by their text rather than numbered rows), the base Copy ▸ Text, then the owner's ContextMenu entries. OnEnter receives the selection when Enter is pressed on the focused list with a keyboard row or a row is double-clicked; without a handler the list leaves Enter and the double click alone. Head (a RenderFragment, lists without columns) renders an owner's heading row inside the grid as its first rowgroup, above the scrolling view, so its columnheader cells reach assistive technology with the rows and never scroll; a press on it neither selects nor scrolls. Heights takes an IRowHeights; without one every row is one --list-row high (24 px with a mouse, 36 px with touch; § Style values). RowTooltip (Func<TItem, string?>) gives each row a tooltip computed when the pointer rests on the row, or when keys move the active row of the focused list; the list carries one attribute (data-tip-rows) and its rows none, and the function runs only for a row that is read. A cut cell under the pointer shows its own full text instead; null or empty shows nothing; a function that throws shows nothing and writes one Error per list (Tooltip of list {name} failed: …).

ShowRowNumbers="true" makes each row show its 1-based number in digit groups (9 999 999 999, .ni-list-number, placeholders and failed rows included) and adds the go-to input to the list's bar (Go to row, data-test="list-goto"): 1-based numbers with or without separators (9,999,999,999 accepted); a number outside the list says Enter a row from 1 to {count}. beside the input, and a number inside it shows that row at the top, selected and the keyboard row. A list with columns gets a leading column # in its table form and the number as the first line of each card. The number column is as wide as the widest number of the list (--list-number-width on the root, in ch from the count), so it widens as the list grows and never cuts a digit. Without it (the default) the list shows neither numbers nor the go-to input, because a number to go to that no row shows is unusable; the entry list and the base pages never show them.

DetailsPanel<TItem> puts a list and the details of its selected entry together, in one pattern for every list: the details open in a panel at the bottom, closed by default. The page opens it with OpenAsync (from the list's OnEnter, which also fires on a double click on a row, and from a row menu entry Details) or ToggleAsync (a Details tool); OpenAsync runs after the next render, so a page that sets its selection first opens that entry, and without a selection nothing opens. Escape inside the list or the panel, or the panel's close tool, closes it and puts the focus back on the list; OpenChanged reports each change and IsOpen the state. At every width, a phone included, the panel opens below the list and the list stays visible and usable above it: the panel takes half of the height at first (DetailsShareRules.Default, 0.5), the list keeps at least --list-min, the panel at least --details-min (its header and one line), and a divider between them (role=separator, aria-valuenow in percent) changes the panel's share of the height by drag (mouse or finger) or ArrowUp and ArrowDown, from 15 % to 85 %. The divider draws a grip, a short muted bar in its middle, at every width and pointer, so a finger finds it without hover; hover and keyboard focus turn it to the accent. Maximize in the panel's head, before its close tool (data-test=details-maximize, Use the whole height for the details, aria-pressed), gives the panel the whole list area: the root carries data-maximized="true", the list keeps its place in the document with no room, and the divider goes; the same tool then reads Give the list its space back (Restore) and returns to the stored share, which a maximized panel leaves untouched. Opening leaves the focus where it was. The open state belongs to the window and the page (a reload starts closed); so does the maximized state, which also outlives a close (the next open is maximized again) and a reload (the tab's session storage, ni.details.maximized.{PageId}; another window never sees it). The share is shared by every window and kept in ui-state.json: the UI state part ui.detailsShares (CoreComposition.DetailsShares), changed only by ui.details.resize, which the panel runs once per finished drag or arrow key; the maximized state is not part of the file. While open, the panel shows the details of Selected; with a null Selected, it says This entry no longer exists. when the page passes Gone, else Select an entry to see its details.; it never shows another entry in place of a gone one. PageId, List, Details, and DetailsTitle are required (a missing one throws: a bug of the page). Only the selected entry's details render.

<DetailsPanel TItem="MessageEntry" @ref="_Details" PageId="messages" Selected="_Selected" Gone="_SelectedGone"
              DetailsTitle="_ => _T.MessageDetails" OpenChanged="_OnDetailsOpenChanged">
    <List><VirtualList … SelectionChanged="_OnSelectionAsync" OnEnter="_ => _Details!.OpenAsync()" /></List>
    <Details Context="entry"><DetailsFields Fields="DetailsOf(entry, _T, _Zone.Zone)" /></Details>
</DetailsPanel>

DetailsFields renders a list of DetailsField(Id, Label, Value, Long, Tip) as a dl.ni-details-fields, one field below the other, each its dt label over its dd[data-field] value (values wrap anywhere, texts render as text), so the details scroll only up and down at every width; a long field (Long: true) keeps its lines in a scroll area of its own (pre.ni-details-pre, at most twelve rows, up and down only) beside a Copy tool (data-test=details-copy) that writes the whole value to the clipboard and confirms with a toast. A label that does not explain itself carries Tip, what the value means: the dt gets it as its tooltip (data-tip) and takes the keyboard focus (tabindex="0"), so the shell's tooltip shows it on hover, on focus, and on a long press; a null or empty Tip gives neither. DetailsField.Text shows DetailsField.Absent (—) for a null or empty value. The base pages use the panel the same way (§ Base pages) and take their tips from BaseTexts.FieldTip(page, field): Messages Count, First, Last, Source, Instance, Exception, Stack trace; Jobs Owner, Count, Rate; Commands Origin, Target, Outcome, Duration; Plugins Requires host, Origin, Faults.

JsonTree shows a JSON text as a structure with folds (<JsonTree Json="@entry.ParametersJson" />, OpenDepth 2 by default): one property per line, the children of an object or array indented below its line, names in the accent text colour, string values in the text colour, numbers, booleans, null, and array indexes muted. Each object and array leads its line with a fold button (data-test=json-fold, aria-expanded, Fold {name} / Unfold {name}, the chevron pair Icons.Expand / Icons.Collapse); a click, Enter, or Space folds or unfolds it, ArrowRight unfolds and ArrowLeft folds; a closed one shows its child count ({3}, [12]). The two outermost levels are open at first, as far as 2,000 lines reach: walking the document in its order, an object or array whose shown children no longer fit starts closed, and so does every later one, so 500 arrays of 500 items open fast; each opens by hand, and a fold the person made stays. Folds start over when Json or OpenDepth changes. A string over 200 characters gets a scroll area of its own (up and down only); at most 500 children of one node render, then a line {n} more — Copy holds the full text; only open nodes render, so a large document costs what shows. A text that is no JSON, or deeper than 64 levels, shows as it is (pre.ni-details-pre, data-test=json-text). Every name and value renders as text, never as markup.

Columns: declare ListColumn<TItem> components inside Columns (id, title, Text, optional Cell, WidthRem, MinWidthRem, Align, Sortable, Sort). The list renders a header and cells where all column minimums fit and cards (label and value pairs) where they do not, decided by a container query on the list's own width, so the page never scrolls sideways. A column is widened by dragging its header edge or with the arrow keys on the focused edge (Home and End: narrowest and widest); a click on a sortable header raises SortRequested (ListSortRequest: column id, ascending first, then alternating) and the owner sorts its source and sets Sort; in card form a Sort by choice replaces the headers. Rows of different heights: pass a MeasuredRowHeights; the browser reports the heights of rendered rows and the list positions by them (exact up to 100,000 rows, the average above). Accessibility: role="grid" with the name, aria-rowcount (-1 above 2,147,483,647), aria-rowindex per row (left out above it), columnheader with aria-sort, and the keyboard row's position as aria-description; the focus ring is a pseudo-element owner styles on rows cannot remove.

EntryList<TItem> is the list for things with a state (jobs, messages, commands, plugins), built on VirtualList<TItem>. Entry turns an item into an EntryView: an EntryTone (Info, Idle, Running, Done, Warning, Failed) that colors the entry's stripe (--accent-text, --muted, --busy, --ok-line, --busy, --bad-line), the state word beside it (required: the color never carries the state alone), the main line (required, cut with an ellipsis and whole in its tooltip), an optional muted second line (its tooltip is its own text where it is cut, or detailTip, which shows also where the line fits, such as a full path), an optional note below it (an EntryNote: a muted line of its own, cut with its text as tooltip, with an optional data-test hook Test; in the card it is one more line below the second), trailing facts, and the entry's tools (Tool, drawn by ToolRow). The state word takes the tone's color too; each tone color reaches 4.5:1 on the list's --panel in both themes, and on a selected row the word, the mark, the second line, and every enabled entry tool take the selection's text color (a hovered tool keeps the hover colors, a disabled one stays muted). After the main line an entry may show an InstanceBadge (instance, a TargetInstanceId) and a mark chip (mark, a short word such as new, with its tooltip markTip; data-test="entry-mark"); the main line cuts first, badge and mark keep their room. A mark is a muted chip, or, with markTone (an EntryTone), takes that tone's color for its text and frame (data-tone on the chip): an outcome such as failed reads in the failed color, and its word still names it. progress (an EntryProgress) draws after the facts: with a Fraction from 0 to 1 a bar (progress, value in whole percent) and its Text (42 %), without one the BusyPulse and its Text (no total) with the tooltip Tip; the text is never cut (data-test="entry-progress", .ni-entry-progress-text). In the one-line form the progress stands between the main line and the facts, in the card at the end of the facts' line. factColors gives one data palette color per fact position (1 to 10, --data-n, or null for the plain color), for a fact of a closed set that should read at a glance, such as the origin on Commands: the fact carries data-color and shows its value in that color (its name stays muted, and on a selected row it takes the selection's text color); the value names it, so the color never carries it alone. Give a NarrowChoice of the same value the same Color, so the chips read as the list's legend. An empty state word or main line, an undeclared tone or mark tone, a null fact or tool, an empty mark (The mark of an entry is empty.), a mark tip without a mark (The mark tip of an entry needs a mark.), a mark tone without a mark (The mark tone of an entry needs a mark.), or a default progress (The progress of an entry has no text.), a detail tip without a second line (The detail tip of an entry needs a detail.), a default note (The note of an entry has no text.), or fact colors of another count than the facts (The entry has 2 fact colors but 3 facts.) throws ArgumentException (ArgumentOutOfRangeException for a tone and for a fact color outside the palette: A fact color of an entry is no data palette color.) at construction; EntryProgress refuses a fraction outside 0 to 1 or NaN (ArgumentOutOfRangeException) and an empty text (ArgumentException); EntryNote refuses an empty text (The note of an entry is empty.) and a hook that is no plain word of ASCII letters, digits, and - (The data-test value of an entry note is no plain hook word.).

NarrowBar is the filter bar of an entry list in one window: a field Filter that filters after 150 ms without a keystroke, with a mode button (data-tool="filter-mode", tooltip Filter mode: Contains) whose menu picks how the text matches, case ignored: Contains (the default), Starts with, Ends with, or Pattern (a regular expression matched in linear time; its entry's tooltip says so). The modes are those of the agent reads' match (TextMatcher), so the page and messages.list, jobs.list, and commands.log filter alike. The field takes at most 1,000 characters in the literal modes (the bound of the agent reads' text) and, in Pattern mode, one past the live limit ui.filterPatternSize (default 1,024; no bound while it is off), so a longer pattern is named rather than cut. A text that cannot match (an invalid pattern, a construct the linear-time engine refuses, a pattern over the limit with the limit's hit sentence) shows its sentence under the field (p.ni-filter-problem, role="alert", data-test="filter-problem") and hides nothing. Then one chip group per NarrowFacet (Id, Label, Choices, Multiple; each NarrowChoice with Value, Label, and Count, the entries that pass every other active narrowing, and an optional Color (1 to 10: the chip's text in --data-n, data-color on the chip; a pressed chip keeps the pressed fill's text color and a hovered one the plain chip color, because the palette is made for the panel, not for those fills); at most 20 chips per group: over that a group shows its pressed chips and the highest counts, in the facet's order, and a line {n} more — filter to reach them, because the field reaches every value the cap leaves out), the hidden count (6 hidden, from Hidden, only while something is filtered), and one clear tool (Clear filter, disabled with Nothing is filtered; it clears the text and the chips and keeps the mode). A chip toggles its value; in a facet with Multiple: false it replaces the pressed one. Below 744 layout px the field and the chips fold behind the bar's Filter tool; the hidden count and the clear tool stay, and the opened tool shows no tooltip, so its tip never covers the field it opened. The page owns the matching: NarrowChanged raises a NarrowState (Text, Picked per facet id, Mode, Matcher, IsEmpty, Has(facet, value)) after each change. Match the entry's shown texts with Matcher (built once per change of text or mode; null when the text hides nothing) and render the text as text. The filter lives in the tab's session storage under ni.narrow.{PageId} ({"text":…,"match":"pattern","picked":{…}}; an absent or unknown match restores as Contains): a reload of the window keeps text, mode, and chips, another window never sees it, and refused storage only means no persistence. On its first interactive render the bar restores it, keeping only facets and values the facets offer and a literal text within the bound (a longer one restores empty, never cut; a stored pattern goes through the same check as a typed one), and raises NarrowChanged once. Duplicate facet ids or choice values, an empty id, value, or label, a negative count, a color outside 1 to 10, or a negative Hidden throw (a bug of the page).

<NarrowBar PageId="@BasePages.MessagesId" Facets="_Facets" Hidden="_Source.Hidden" NarrowChanged="_OnNarrowAsync" />

FactNames gives one name per fact position (["Count", "First · latest"]), in the window language. The card shows each name before its value (Count 4, .ni-entry-fact-name), so a number on a phone says what it counts; the one-line form shows the value alone and uses the name as the fact's tooltip. FactTips gives one tooltip per fact position ([null, "First · latest arrival"]: the second fact of every entry shows it); a position's own tooltip wins over its name. The names are by position: a name past an entry's last fact shows nowhere, a fact past the last name shows without one. The list writes the tooltips once on its root as a JSON array (data-fact-tips) and each fact carries only its position (data-fact-index), so no row repeats a tooltip text; a fact cut by an ellipsis shows its own text first. The JSON is built again only when FactTips or FactNames is another list instance, so keep one list of each per language. An empty fact shows nothing and keeps its position, so an entry that lacks a value gives it as "" and the facts after it keep their names (Plugins does so for a missing kind, license, summary, or load time).

Table (an EntryTable) gives the list a table form, as the four base pages do: where the list's own width holds all columns, one heading row (.ni-entry-headrow, role="columnheader" on each titled cell, in the grid's head slot) stands above the entries and every entry lies on the same track list, so each column starts at one x in every row. The columns are the stripe, the expand control (with Expanded), the state (StateTitle, StateWidthRem, default 6), the main line (MainTitle, at least MainMinRem, default 14, and all the width the others leave; the second line and the note stay under it), one column per fact (FactWidthsRem in rem, headed by FactNames), the progress (ProgressTitle and ProgressWidthRem, default 10; without a title the progress stands below the main line), and More. A value longer than its column ends in an ellipsis and shows whole in its tooltip; the entry's own tools stay in its menu, as in the card. The table shows from the sum of the columns, the gaps, and the frame (a container query on the list's root that the list writes once per table, counting More at its touch size); below that width each entry is the card, and a list with a table never takes the one-line form. With a table FactNames is required and holds one name per width; another count (The table has 3 fact widths but the list has 2 fact names; …), a null title or width list, or a width that is not a finite number above 0 throws at parameter set (a bug of the page). The style is built again only for another table instance, so keep one per language.

<EntryList TItem="CommandLogEntry" Source="_Source" AccessibleName="Commands" Entry="_EntryOf" FactNames="_FactNames"
           Table="@(new EntryTable(_T.Column("state"), _T.Column("command"), [7, 6, 6]))" />
<EntryList TItem="JobRow" Source="@_Jobs" AccessibleName="Jobs" EmptyText="No jobs."
           Entry="@(job => new EntryView(EntryTone.Running, "running", job.Name, job.Status, [job.Elapsed],
                     [new Tool("cancel", "Cancel", Icons.Stop, "Cancel this job", () => CancelAsync(job))]))">
    <Expanded Context="job"><pre>@job.Log</pre></Expanded>
</EntryList>

Entry runs once per rendered row and render, never for rows outside the view; one that throws (or answers null) shows that row as failed / This entry could not be shown. and writes one Error per list (Entry list {name}: …). With Expanded each entry has an expand button (Show details / Hide details, aria-expanded, the chevron pair Icons.Expand / Icons.Collapse) first in its line, right after the stripe, as every control of the base that opens something in place; an entry without Expanded gets no column for it. The expanded part renders below the entry's lines in the same row, and the rows have measured heights, so the next entry moves down. Expansion is kept per item by the item type's equality (a record read again stays expanded) and is dropped when Source changes. A one-line entry with its gap to the next card is one --list-row high (the icon buttons' target floor permitting), one with a second line --list-entry. Where the list's own width is below 36rem, or below its table's width with a Table (a container query, never the window width), each entry is a card of at most three lines: state word, main line, and More; the second line; the named facts and the progress. Every tool of the entry hides in the card, so the main line keeps its room on a phone: give each tool an entry in the list's ContextMenu, which More opens. More ends the main line at every width (in the one-line form after the entry's tools), and its menu opens without the header Row {n}; the base pages give their entries no tools, so each action shows once, in the menu (§ Base pages). Without rows the list shows EmptyText in place of the rows (without it, the base No rows). CopyText, ContextMenu, RowTooltip, SelectionChanged, and OnEnter pass through to the virtual list. In card form the badge and the mark stay on the main line. In both forms every entry is a set-apart card: a frame in the line colour with rounded corners (--radius-5) whose left edge is the stripe, a gap of --space-4 to the next card, and a selected entry fills its card, not the gap, with the selection colour. On the base pages Jobs aligns its state words at 5.5rem and Messages its types at 4.5rem; in the table form each page's columns align them (§ Base pages).

PasteButton reads the clipboard only inside its own click by the person; a timer or page script gets The clipboard is read only when you click Paste., and an empty clipboard gives The clipboard holds no text. without a paste. Copies write through the one base clipboard module.

Limits (read live): ui.copyRows (a larger selection copies nothing and shows the hit sentence), ui.clipboardReadSize (a larger paste is refused with the hit sentence), ui.listReadsParallel (reads of one list at a time; further reads wait).

Instances

An instance is one of several things of a kind the application defines (a counter of the sample, a session of Network Inspector); see UI terms § Instance. Its id (counter:1) never changes; its face, a display name and a palette color (InstanceFace), may change while it lives, and every window that shows it follows at once.

builder.Core.Commands.AddTargetKind("counter", LocalText.Of<SampleTexts>(static t => t.CounterKind), "Sample");   // UI name Counter
composition.Targets.TryAdd(new TargetInstanceId("counter", "1"), new InstanceFace("Front door", 4), out string? problem);
composition.Targets.TrySetName(new TargetInstanceId("counter", "1"), "Back door", out problem);
composition.Targets.Changed += (_, id) => { /* read TryGetFace(id, …) and re-render */ };
  • Name rule (InstanceName.TryCheck, the same on every surface): 1 to 64 letters, digits, spaces, and . _ - ( ) #, no space at either end, unique within its kind (ordinal, ignoring case). A refused name changes nothing and answers one sentence: An instance name needs 1 to 64 characters., An instance name may not start or end with a space., An instance name may hold letters, digits, spaces, and . _ - ( ) # only., or An instance name must be unique within its kind; counter:2 has the name Workshop. Tür 1 (Süd) #2 passes; markup, line breaks, control and direction characters, emoji, and combining marks do not.

  • Color: 1 to 10 of the data palette (§ Style values), or none. DataPalette.NameOf names it (orange).

  • Default face: TryAdd(id, out problem) gives no color and names the instance by its instance text clipped to 64 characters; when that name is taken in the kind (ignoring case), the first free {text} (2), {text} (3), … (the text clipped so the whole stays at 64). It never refuses an id the id rule allows.

  • Jobs and messages: a job names its instance with JobRequest.Instance (kind:instance; the jobs library checks only the form), a message with Emit(type, source, text, instance, exception = null). jobs.list and messages.list answer instance and instanceName (the display name at the read; null once the instance ended, while instance stays) and narrow to one with instance (exact match; a malformed text answers InvalidParameters; a cursor belongs to its filter). The sample's counting job (sample.job.count with counter) and its message name counter:{n}; the Counter page starts it for its counter.

  • Commands: instances.list (paged like jobs.list: pageSize, cursor; kind, kind UI name in English, name, color, color name), instances.rename, and instances.setColor; see docs/agents.md § Instances.

  • Badge (InstanceBadge, <InstanceBadge Instance="id" />): the id in a pill of the instance color (ni-swatch-cN, so it equals a widget edge of the same color in both themes), the display name beside it from 744 layout px (cut with an ellipsis at --instance-name-max), and the tooltip {kind name} {id} · {name} (Counter 1 · Front door). It follows a rename or a color change in every window within one refresh (at most ten per second). An instance that ended shows its id in a neutral pill with the tooltip {kind name} {id}. The base shows it on the Settings tab of an instance scope (the tab reads 1 Front door and carries the badge's tooltip, so keyboard focus and a phone still name the instance) and as the target of a Commands page entry.

The sample names counter 1 Front door (color 4) and counter 2 Workshop (color 7); its Counter page shows the name with a dot in the color.

Actions

An action is one thing a person can do with a subject of one kind; a subject is what an element stands for, a kind and a value (counter:1); see UI terms § Action and subject. The base, the application, and plugins define actions (ActionDefinition); the start checks them, and agents read them with actions.list.

builder.Actions.AddAction(new ActionDefinition("sample.counter.reset", LocalText.Of<SampleTexts>(static t => t.ResetToZero), Icons.Rotate,
    LocalText.Of<SampleTexts>(static t => t.ResetThisCounterTip), "counter", "sample.counter.reset",
    static subject => JsonSerializer.Serialize(new CounterResetParameters(subject.Value), BaseJson.Options),
    subject => counter.Read() == 0 ? new ActionState(false, LocalText.Of<SampleTexts>(static t => t.AlreadyZero)) : new ActionState()));
builder.Actions.AddSubjectKind("packet", LocalText.Of<MyTexts>(static t => t.PacketKind));   // a kind of the application
  • Definition: id (the rule of a command name, unique), label and tooltip (LocalText), icon or none (1 to 64 of a-z0-9- in parts joined by dots; a bundled or an application icon), the subject kind or none, the command it runs, the parameters of that command built from the subject (write them with a JSON writer: the value is data, and the command checks it like any other call), and a check that answers ActionState (enabled, or disabled with a reason, a LocalText each window shows in its own language) or none for always. new ActionState() is enabled.
  • Base actions: base.jobs.clearEnded (Clear ended jobs, tooltip Removes the jobs that have ended, no subject kind) runs jobs.clearEnded; it is disabled with No job has ended while no job has ended.
  • Subject kinds: the base declares message, job, command, plugin, and widget; every target kind (§ Instances) is a subject kind; the application (builder.Actions.AddSubjectKind) and plugins (AddSubjectKind on the plugin builder) declare more.
  • Owner: Base, the application's display name, or the plugin's UI name. The order is the base's and the application's actions in registration order, then each plugin's in load order.
  • Checked at the start: a second definition of an id, or a kind declared twice, names both owners (The action sample.counter.reset of Duplicate Action Plugin is defined already by Sample Application.); an undeclared kind answers Subject kind nosuch is not declared.; a command that does not exist is named. The application's start is refused (exit 1); a plugin is failed with that reason and none of its contributions stay.
  • Plugins: builder.AddAction(…) on the plugin builder; its command may be one the plugin adds. Its parameters and check functions run through the plugin containment: one that throws leaves the action out and is reported once.
  • Reads: ActionRegistry.ForSubject(subject) answers the actions of the subject's kind (SubjectAction: definition, owner, plugin UI name, state, parameters JSON, and target) and runs the functions guarded (a throwing function, or a disabled state without a reason, leaves the action out with one Error per action and run); ForAction(id, subject) answers one action for a menu entry or a tool; Find(id) answers a definition. An undeclared kind answers nothing and writes one Warning per kind.
  • Target: when the action's command declares the subject's kind as its target kind, the subject is the call's target (counter:1): the command runs on that instance's queue, and the command log names it.
  • Agents: actions.list (paged like instances.list: kind, pageSize, cursor) answers id, English label and tooltip, command, owner, and subject kind; an undeclared kind is NotFound naming it. See docs/agents.md § Actions.

Subjects and their menus. An element declares the subject it stands for through the window's context menus: string key = menus.RegisterSubject(new Subject("counter", "1"), () => ownerEntries, key), then data-ctx="@key"; remove it with Unregister(key) when the element goes. Each registration has its own key (pass the previous one back on each render); the browser sends only that key, never the subject, so a forged key opens nothing (Sync: ContextMenuService). The menu, built when it opens, holds the owner's entries, then the application's (and the base's) actions for the kind, then one submenu per plugin, named after the plugin, in load order; a kind without actions shows the owner's entries only, never an empty submenu. A disabled action shows its reason in the window language and runs nothing; an action that ran shows a toast with the first text of its result (Hello, counter 1), else {label}: done. A widget declares its subject with WidgetView.Subject; the frame's header then opens the subject's menu.

Base pages. Each row of Messages stands for message:{id} (the id messages.list names). Its menu is built only when it opens: the list's Copy, the page's Delete, the actions for message with one submenu per plugin, then Details, which stays last (§ Base pages). The browser names only the row number; the page takes the subject from the entry it read itself (Sync: MessagesPage.SubjectKind, MessagesPage.RowMenuOf). The base defines no message action itself.

Menu entries and tools. AppMenuEntry { Action = "sample.counter.reset", Subject = new("counter", "1") } and Tool.ForAction("sample.counter.reset", new Subject("counter", "1"), priority) take the label, icon, tooltip, state, command, parameters, and target from the action each time they show, so an entry and a tool never drift apart. The start refuses an app menu entry that names an action that does not exist, or one with a subject of another kind (The app menu entry Sample/Ghost names the action sample.ghost.run, which does not exist.); a plugin's entry refuses that plugin. A tool whose action answers nothing is left out of its row with one Error.

The sample defines sample.counter.reset (Reset to 0, disabled at 0 with Already 0, German Bereits 0) for counter; its plugin defines sample.plugin.greet (Say hello to this counter, command sampleplugin.greet, which runs on its counter as target) for the same kind. The Counter page lists the counters (Counter 1 · Front door), each row standing for counter:{n}; a counter widget whose state names a counter ({"value":0,"counter":"1"}) shows the sample counter, stands for that counter in its header, and its Reset tool is the action, the same as the app menu entry Reset counter 1.

Settings page

The base page Settings (settings; parameters SettingsPageParameters(Tab, Search, Group), for example /settings?tab=profile&search=theme) shows one tab per scope: Profile first, then Application, and one per live instance scope (counter:1, shown as its instance badge § Instances); a tab goes when its instance ends. Settings opens on the Profile tab, the first, with its Appearance group first and open (every other group starts closed), so theme, UI scale, and language are in view at once; a shown instance tab that ends falls back to Profile. The page fills the page area (ni-page-fill): the tabs stay at the top, the settings scroll in the middle, and the Apply bar stays at the lower edge at every scroll position, width, and UI scale; a setting that gets the focus scrolls into the middle part, so the bar never covers it. Only when tabs and bar need more height than the window has (a phone with its keyboard open) does the page area scroll. An instance scope may live in a settings manager of the application (SettingsService.AddInstanceManager); its tab works the same, and the sample keeps counter 2 that way. A link opens its target: the address /settings?tab=counter:1&group=counter&search=step, ui.navigate with the same parameters, and the Plugins page's Plugin paths show the tab, open only that group (a group key: a settings group, limits, or plugin:{UI name}) with its first shown row scrolled into view, and set the search. A tab no scope has shows the first tab (Profile) and There is no settings tab "nope".; a group the tab does not have closes every group and shows There is no settings group "nothing". (each text shown as text, cut to 64 characters and …). ui.navigate refuses an unknown tab (docs/agents.md); the address opens Settings without it in every window, and the window of the address names it. A tab whose scope holds values waiting for Apply carries a count mark with the tooltip 2 edits waiting for Apply, in every window (the pending values are shared, SettingsService.EditedCount). Under the search a hint names the groups (8 groups) or, while searching, the hits and their groups (3 hits in 2 groups); a search without a hit says No setting matches "zzz"., with the search as text. Groups (Sync: SettingsPageModel): every limit row goes to Limits, in one part per owner (the base first, then the application, then the plugins by UI name); any other row owned by a plugin goes to the group named after the plugin; every other row to its settings group; the order is settings groups, Limits, plugin groups. Each group head counts its rows (1 setting, 12 settings); each group is framed and its head has a background of its own (--panel2), with a line under the head of an open group, so groups stand apart in both themes and a head never reads as a row. Every setting is one column at every width and scale: one compact row below the other, at most a form width (40 rem, --form-width) wide, with Restore default next to the name, the description cut to one line, the shared SettingEditor (Compact), and the key and type, stacked; a state chip (edited, waiting for restart, waiting for reset, set for this run; invalid only in the window that typed the refused text). After the chip, before any edit, a setting that does not take effect at once says when it does (SettingRow.Activation, read from its declaration): Takes effect after a restart (plugins.paths); on the tab of an instance whose kind declares a reset, the action the reset notice offers (Takes effect after Reset counter 1); otherwise Takes effect at the next reset. A setting that takes effect at once (theme, UI scale, language) has no mark. A closed set is a choice list: an enumeration in declaration order and ui.language by its registered codes; each option shows its name in the window language and sends the value (ui.theme reads Dark and Light, German Dunkel and Hell; a language its native name, English and Deutsch; any other choice its value, 120 %; SettingChoiceLabels). The description's tooltip holds the full description, Default: 0, and Range: 0 to 1 000 000 where the setting has a range (a limit's hard range, or the bounds of a number). A refused text shows its refusal followed by Apply keeps the old value. A limit row adds its facts below (value with unit, range, default, scope, the off effect, help texts). A list setting edits its entries in order: Move up of the first entry and Move down of the last stay focusable, disabled with Already the first entry and Already the last entry as their tooltips. A path list (plugins.paths, access.agentReadFolders, access.agentWriteFolders) adds a field with the placeholder Type a path or choose one and the buttons Folder… (Add a folder) and File… (Add a file), which open the file browser for the key (§ Popups); the one of plugins.paths starts with the type filter *.dll (All files stays in its filter list). The Apply bar acts on the shown tab only (1 edited in this tab, Discard, Apply). After Apply, the values that take effect later become window notices in the notice strip above the page (SettingsNotices, one per window): one for every value that waits for a restart (plugins.paths take effect after a restart.) and one per scope for the values that wait for a reset (sample.counter.resetValue take effect after a reset of counter 1., the instance named by kind and instance). The reset notice of an instance whose kind declares a reset (AddTargetKind(…, resetCommand: …), § Instances) carries the button Reset counter 1, which runs that command with origin Ui and the instance as target; a kind without a reset gets no button, and values of the application or the profile that wait for a reset read … take effect at their next reset. A value that takes effect at once makes no notice. A notice stays across tabs and pages until the person closes it, its reset answers ok, or none of its values waits any more (a reset by an agent or another window, a profile switch, an ended instance); a later Apply adds its values to the notice that is still shown. While access.requireToken is on, the token row shows the token masked with Show, Copy, and Rotate (Rotate keeps this window's session); the window that turns the check on gets a session through a one-time start link, so it stays in after a reload. The Profile tab manages profiles: one line per profile with the name (cut with an ellipsis, its full text in the tooltip), the current chip on the active one, and three icon tools whose tooltips name the action and the profile: Switch (Switch to profile work; disabled on the active profile with This profile is active), Rename (Rename profile work: a field holding the name takes its place, Enter renames, Escape or leaving the field closes it and keeps the name, and a refusal keeps it open with the sentence below it), and Delete (Delete profile work, after a confirmation); below them the create row (name, Copy from, Create). The Profiles branch of the app menu switches them, and a switch that dropped pending values says so in every window.

Base pages

The list pages use the shared VirtualList (columns, cards below the width of their columns, selection, copy, row menu) inside DetailsPanel (§ Lists); Messages, Jobs, Commands, and Plugins use the EntryList on it, and no entry of these pages opens in place (EntryList.Expanded stays for applications' own lists). Every action is a command with origin ui, so an agent can do the same.

Page Rows (newest first) Actions
Messages one entry per message: type as stripe and word, text over its source, instance badge, mark new, count, first · latest; a repeat raises count and latest in place Details, Copy all, Clear all (two presses); per entry in its menu: Copy, Delete, Details; filter by text, type, source, instance
Jobs one entry per job (pending and running first by creation, then ended newest first): state as stripe and word, kind · name, instance badge, status text (the failure reason of a failed job), a bar with its percent or a pulse with no total, duration; re-read every 250 ms while a job runs Details, Clear ended (two presses); per entry in its menu: Copy, Cancel, Remove, Details; filter by text, state, instance
Commands one entry per call: outcome as stripe and word, command name, target as instance badge, the error code of a refused or failed call, time, origin, duration Details; per entry in its menu: Copy, Details; Copy of the parameters in the details; filter by text, origin, outcome, instance
Plugins (load order) one entry per row plugins.list answers: state as stripe and word, UI name and version over the path, the reason of a failed or skipped plugin as a line of its own, kinds, license, contribution summary (1 page · 4 commands), load time Details, Plugin paths; per entry in its menu: Copy, Details

An entry of these four pages shows one button, More (data-test="list-more"), at every width and no other action button. More, a right click, a long press, Shift+F10, and the context menu key open the same menu, which lists each action of the entry once, each with its tooltip (a disabled one with its reason): the list's Copy ▸ Text, the page's actions, and Details last. The menu names no row number: an entry names a thing by its text (EntryList passes NumberRowsInMenu="false", § Lists).

Table form: where all columns fit, Messages, Jobs, Commands, and Plugins read as tables with a heading row (EntryList.Table, § Lists); below that width their entries are cards. The columns in rem: Messages Type 6, Message, Count 5, First · latest 11; Jobs State 6, Job, Duration 7, Progress 9.5 (empty for a job without progress); Commands State 6, Command, Time 7, Origin 6, Duration 6; Plugins State 6, Plugin, Kinds 8, License 8, Contributions 12, Load time 6 (the cards of Plugins name their facts with the same words). The main column takes the rest, at least 14rem; More ends every row.

Details: on Messages, Jobs, Commands, and Plugins the selected entry shows every field in full, the same way: in the details panel at the bottom of the page (DetailsPanel, page ids BasePages.MessagesId, JobsId, CommandsId, PluginsId). Enter or a double click on a row, the row menu entry Details (the last entry of every row menu, tooltip Show the details of this entry, which selects that entry), or the top-row tool Details (data-tool=details: pressed while the panel is open, disabled with Select an entry first without a selection) opens it; Escape, the panel's close tool, or the Details tool closes it. The panel follows the selection; an entry that leaves the list while it is selected (deleted, removed, dropped by the log) shows This entry no longer exists., never a neighbour. A field name that does not explain itself carries a tooltip that says what its value means (Messages Count: Counts the arrivals of equal messages: …), shown on hover, keyboard focus, and long press (BaseTexts.FieldTip, § Lists); Text and Name carry none. Messages add the instance (as its badge's tooltip names it), the exception, and its stack trace (kept only while Settings › Messages Keep stack traces, messages.stackTraces, is on; off by default, so the field shows —); Jobs the description, the end reason, the created, start, and end times, the count, the status text, and the failure reason (each up to jobs.textLength characters; a longer one shows its mark shortened · 2 000 of 1 000 000 characters kept · jobs.textLength as its first line); Commands the parameters as a JsonTree (the stored text when it is no JSON); Plugins the contributions in groups before the fields. An absent value shows —.

Page Fields of the details
Messages type, count, first, last, source, instance, text, exception, stack trace
Jobs name, description, owner, state, end reason, created, started, ended, count, rate, status, failure
Commands No., time, origin, target (as its instance badge), command, outcome, duration, parameters
Plugins the contributions by kind, then name, required host, origin, faults, reason

About opens after the licenses are accepted (before, the license popup shows the same list) and shows, from the top: the program card, the application's own license, and the components. The program card lists version, application name, display name, runtime, operating system and architecture, start mode, the license state with sha256 and the short hash once (and a link to the components), the plugin counts, one indented row per plugin with its UI name, its state, and the reason of a failed or skipped plugin, then the application's about content (builder.Shell.SetAboutContent). Below it the summary What is copied keeps the sentence Never copied: paths, user and machine names, tokens. in view and opens the preview (data-test=copy-preview): exactly the text Copy program information writes, one name: value line per row, plugin lines indented by two spaces. The copy is built from that fixed row list only; a plugin's reason has every absolute path (a drive path, a UNC path, a Unix path) reduced to its file name, so a pasted report carries no folder, user name, settings path, token, start key, or session id. The license card (data-test=about-license, License · {license}) shows the text of the inventory's first application entry as paragraphs.

About holds the licenses at its part licenses (id="licenses"; the address /licenses and ui.navigate to licenses open About there and scroll the part to the top once per request): the component list LicenseEntries, no list page. Per group (application, components, runtime, assets, plugins; a group without entries is left out) each entry shows its name, version, license, copyright holder, and link (a plugin shows its UI name with its package id as tooltip; its private dependencies stand indented right under it; a plugin without inventory shows license not stated). Where these columns fit (a container query on the list at 37 rem, the sum of the column minimums) the list is a table: one heading row Name · Version · License · Copyright holder · Link (data-test=license-headrow, role=columnheader) and one track list for every entry, so each column has the same edges in all entries; a cut value ends in an ellipsis and shows in full as tooltip. Narrower (a phone, the popup at 390 px) each entry is a card: the name in full as its title, then Version 12.1.6 License MIT, then Holder … and the link, each value cut with an ellipsis below the title, so a closed card is never taller than its name and two lines. The expander Show details at the line's start (aria-expanded) opens the entry in place: its line shows every value in full and wrapped, and below it stand Required by and the license text as paragraphs wrapped to the width (hard-wrapped lines joined; list items and indented lines keep their line). An absent value shows —; a link shows its host name and opens in a new tab without opener or referrer (only an http or https address becomes a link). Above the groups a text box filters the list after a short quiet time to the entries whose name, version, license, or holder holds the text (literally, ignoring case): groups without a match leave, a line says {n} of {m} entries match, a text without match shows No entry matches "{text}"., and the clear tool shows every entry again.

The Messages page refreshes at most ten times per second whatever the message rate, reads only the visible rows, and marks the messages seen at most once per second while it shows (a trailing mark catches the last Warning of a burst); a note says how many older messages the ring removed (messages.entries). Counts and the latest arrival follow within one second while the page shows (the hub reports a repeat only at the powers of two, so the page also refreshes every half second while its window is visible). A hint line above the list states the order and counting rules (data-test=messages-hint). The arrival fact shows one time when first and latest arrival are the same instant, else first · latest, with the tooltip First · latest arrival; a time of the current local day shows as its time of day (19:10:58 · 19:10:59), an older one with its date, on the Commands page's time too. An entry whose message arrived again after a delete carries the mark new (MessageEntry.Returned). Copy and Copy all write one tab-separated line per message (type, count, first, last, source, text; Copy all newest first) and toast Copied or {n} lines copied; Delete toasts that the next equal message starts a new entry; Clear all arms on its first press and clears on the second (ArmedClear, Cancel beside it while armed; leaving the page disarms it). An empty list says what appears there; Copy all and Clear all are then disabled with No messages. A text of only white space shows — as its main line. The filter bar (NarrowBar, Lists) above the hint filters Messages by its text in its mode in the text, the source, and the exception text (ignoring case, the same match as the text and match of messages.list) and by chips: type (Error, Warning, Info, several at once), source, and instance (one at a time each; an instance chip reads as its badge's tooltip). Each chip shows how many entries pass every other active filter (Error 3); every source and instance of the list has a chip, also at 0, and a pressed one the list no longer holds stays at 0 until it is released. While something is filtered the bar shows {n} hidden; a filter that hides every entry says No messages match; clear the filter to see all., and a new matching message shows with the next refresh. Copy all and Clear all still act on every message. The filter stays in the window after a reload and never reaches another window (the tab's session storage). The source and instance chips of a list without a filter follow within about a second; a filtered list scans the ring once per change of the list or of the filter. The rail badges count unseen Errors and Warnings (Messages) and pending and running jobs (Jobs); a badge at 0 is gone. The busy pulse (BusyPulse, parameter Label) is the only animation of the base; reduced motion stops it.

The Jobs page shows each job as an entry: pending and running jobs first in the order they were created, then ended jobs newest first. The entry carries the state as stripe and word (running in the running colour, completed done, failed failed, pending and cancelled idle), kind · name, the instance badge, the job's status text (JobProgress.SetStatus; a failed job shows its failure reason instead), a bar with its percent (100 % never cut) or, while a job runs without a total, the pulse with no total and the tooltip The job does not know how much is left, and the duration. Cancel on the entry (jobs.cancel, tooltip Cancel this job; its partial result is dropped) is disabled with The job has ended once it ended; Remove (jobs.remove) is disabled with The job is still running while it is pending or running. Both are destructive tools: Cancel (Icons.Stop, the stop square) and Remove show in the destructive colour while they can act and muted while disabled. A hint line (data-test=jobs-hint) states the order and that progress follows every quarter second. Clear ended arms on its first press and removes every ended job on the second (jobs.clearEnded, Cancel beside it while armed; leaving the page disarms it; running jobs stay); it is disabled with No ended jobs while none has ended. An empty list says that started jobs appear there and that the Jobs entry of the page rail counts the running ones. The filter bar filters Jobs by its text in its mode in the name, kind, status text, and failure reason (the text and match of jobs.list) and by chips: state (all five, several at once) and instance (one at a time), each with its count; Clear ended still acts on every ended job. A status text or failure reason longer than jobs.textLength (default 2,000 characters) shows its first characters on the entry, in the copy line, and in the details (there after its mark), and the filter matches only that shown part, as the agent answers do; the page cuts a text once per job and change, so a job that reports a megabyte ten thousand times a second costs the window no more than a short one.

The Commands page shows each call of the command log as an entry, newest first. The entry carries the outcome as stripe and word, in the form the Jobs and Messages pages give their state (ok done, refused warning, failed failed, cancelled idle), the command name, the target as its instance badge (a target text that names no instance shows only in the details), the error code of a refused or failed call as its second line (InvalidParameters), and as facts the time, the origin (its value as commands.log names it in every language: ui, rest, mcp, cli, plugin, replay), and the duration (whole milliseconds). Each origin shows in a fixed color of the data palette, the same on its filter chip, so the origins read apart at a glance and the chips read as the legend: ui 1 (blue), rest 2 (green), mcp 3 (yellow), cli 4 (orange), plugin 5 (red), replay 6 (purple); the word stays, and an origin without a color (one a later version adds) shows in the plain color. No entry opens in place. The details show the parameters as a JsonTree (§ Lists; the stored text when it is no JSON, for example a shortened entry), as characters, with Copy (data-tool=command-copy-parameters), which copies the stored compact text exactly and toasts Copied. An entry whose parameters the log shortened (ParametersShortened) says so above them in the details: shortened · 4 KiB of 10 KiB kept · The command ran with its full parameters. (the size commands.logEntrySize keeps now and the size before the cut, both in the unit form of the limit). A hint line (data-test=commands-hint) reads Newest first · keeps the last 1 000 calls, 4 KiB each · {n} now with the current values of commands.logEntries and commands.logEntrySize and the calls the log holds. The filter bar filters Commands by its text in its mode in the name, target, stored parameters, and error code name (the text and match of commands.log) and by chips: origin (all six) and outcome (all four), several at once, and instance (one at a time, the targets that name an instance), each with its count. The selected call is kept by its sequence number, so calls that arrive on top never move the details to another call.

The Plugins page shows each row of plugins.list as an entry, in load order (PluginHost.Rows, so page and agents never disagree). The entry carries the state as stripe and word (loaded done, starting and waiting running, failed failed, skipped idle), the UI name and version (a file the scan could not read shows its file name), the path as its second line with the full path as its tooltip, for a failed or skipped plugin its reason on a line of its own below the path (one line, data-test=plugin-reason), and as facts its kinds, its license, a contribution summary in words, and its load time. The summary names up to four kinds with their count in the singular or plural, pages first, then commands, popups, widgets, setting groups, status fields, status items, menu entries, actions, subject kinds, close lines, pieces of closing work, Welcome content, and text sets (1 page · 4 commands · 1 setting group · 1 menu entry · +2 more), or no contributions; a waiting plugin has none yet. No entry opens in place: the details panel (PluginDetails; Enter, a double click, Details in the row menu, or the top-row Details tool) shows the contributions in one group per kind, each set apart from the one before by a line and space and headed by a button first in its line (Commands · 4, data-test=contribution-kind-toggle with aria-expanded, the chevron pair Icons.Expand / Icons.Collapse) that closes or opens that group alone; a closed group stays closed while the person moves from plugin to plugin on the page. Each contribution shows its name over its full description, both wrapped. Then follow the fields the entry leaves out: name, required host, origin (Built in, Application, Setting), faults, and the full reason with Copy. The open details follow the selected plugin while its state and faults change. Names, descriptions, and reasons are plugin text: they show as characters; the entry's reason line is one line whose tooltip shows at most 600 characters and … the text continues. (the shell's tooltip bound); the details show every text complete. The pre-scan summary (data-test=prescan-summary) stands above the list.

The base's status items (activity, running jobs, connected agents, profile, language) are information only; see Shell (Status bar).

Welcome. The display name, one card per welcome content (the application's first, then each plugin's), and the agent card: the loopback address, the REST, OpenAPI, and MCP addresses, the command-line form, a line when the access token is required (never the token), and the connected agent clients (Connected agents), oldest first, each with surface, name, connected since, last request, and requests. The list follows a connect or a close within a tenth of a second and is re-read once a second while the page shows; it reads the client list in process, so it adds nothing to the command log. A name is untrusted text: one line with an ellipsis, the whole name as tooltip. At most 20 rows show (a display rule); a line names how many more agents.list lists, another the connections over agent.clientsListed; with no client the card says No agent is connected.

The tools of the list pages sit in their top row: Messages (Details, Copy all, Clear all, and Cancel while Clear all is armed; Copy and Delete sit on each entry), Jobs (Details, Clear ended, and Cancel while Clear ended is armed; Cancel and Remove sit on each entry), Commands (Details; Copy of the parameters sits in the details), Plugins (Details, and Plugin paths, data-tool=plugin-paths, which runs ui.navigate to Settings with the Application tab, the group plugins, and the search plugins.paths, § Settings page); the Dashboard's add-widget control, menu (Reset layout), and widget chooser sit in the Dashboard's top row.

Time: BaseApplicationBuilder.Time (a TimeProvider, default TimeProvider.System) is the clock of messages, jobs, and the command log; DisplayTimeZone (default the local zone) is the zone of times on screen. Both refuse null and are fixed after Build. Agent answers write every time as UTC in ISO 8601 with Z (2026-11-16T13:05:09Z) and read any ISO offset form.

builder.Time = clock;                                          // a fixed clock in tests
builder.DisplayTimeZone = TimeZoneInfo.FindSystemTimeZoneById("Europe/Berlin");

Dashboard and widgets

An application gets one dashboard page: one row of widget columns, each with a width share and its type's minimum width. A widget type is a WidgetType<TState> (id, title, minimum width in rem, default state, owner, an optional creation popup, and hasStatusLine, default true) plus a view that derives from WidgetView<TState>:

builder.Widgets.Add<CounterWidget, CounterWidgetState>(SampleWidgets.Counter);   // a plugin: builder.AddWidget<…>(type)
builder.Widgets.DefaultLayout = SampleWidgets.DefaultLayout;                     // a fresh folder and dashboard.reset
builder.Widgets.DashboardPageId = "dashboard";                                   // null (default): no dashboard

Plain and persistent widgets. The type decides whether a widget's state outlives the application. A WidgetType<TState> is a plain widget: its state lives while the application runs (every window shows a change), is never written to ui-state.json, and a restart starts it with the default state; the sample's clock is one. A PersistentWidgetType<TState> stores the state with the layout and owns its version (stateVersion, 1 or more; less throws ArgumentOutOfRangeException) and its restore; the sample's counter is one, and its value returns after a restart:

builder.Widgets.Add<CounterWidget, CounterWidgetState>(new PersistentWidgetType<CounterWidgetState>(
    "sample.counter", title, 18, new CounterWidgetState(0), owner, stateVersion: 2)
{
    Restore = stored => stored.Version <= 2 && CounterWidgetState.TryRead(stored.Json, out CounterWidgetState? state)
        ? WidgetRestore.Ok(state)
        : WidgetRestore.Refused<CounterWidgetState>("not a counter state"),
});

The restore contract: at the start the base hands each stored state to its type as StoredWidgetState(Version, Json); a state stored without a version is version 1, and a version newer than StateVersion is refused before the type sees it. Restore checks the text as untrusted input (a person can edit the file), converts an older version, and answers WidgetRestore.Ok(state) or WidgetRestore.Refused<TState>(reason). Without Restore the current version is read strictly and an older one is refused. A refusal, or an exception from Restore, gives that widget its default state at its place and one Warning that names the widget and the reason (The state of widget 2 (sample.counter) was refused: not a counter state. Its default state is used.); the other widgets are unchanged and the start goes on. Export (optional) leaves parts of the state out of a layout export. The file format is in the Core README § UI state, pages, popups, widgets.

The view gets Widget and State; it changes its state only with SetStateAsync (one widget.setState, so every window shows it), sets its status line with SetStatus(WidgetStatus) (see Status line below), and blocks itself with SetBlock(reason) (the frame offers Close). It asks a question about itself with OpenPopupAsync(type, parameters, cancellation): a widget popup over this widget only (§ Popups), awaited; the outcome is not answered on Cancel, Escape, the widget's close, or a refused open (shown as a toast). The sample's counter widget renames itself that way:

PopupOutcome<RenameResult> outcome = await OpenPopupAsync(SampleWidgets.Rename, new RenameParameters(_Name), CancellationToken.None);
if (outcome is { Answered: true, Button: "Rename", Value: { } value })
{
    await SetStateAsync(State with { Name = value.Name });
}

Header tools. A view declares its header actions by overriding protected virtual IReadOnlyList<Tool> Tools (none by default; § Shell, Tools): the frame draws them in its header as icon buttons with tooltips, folds them by priority, and reads them again after each render of the view, so a run that changes the state updates the header. A tool whose state check throws is left out with one Error (Tool {id} of {owner} failed: …, the owner being the type's) while the body and the other tools keep working; Retry on the failure panel checks every tool again (one new Error for a tool that still fails). A view that throws shows the failure panel with Retry and one Error; the other widgets and the page keep working.

protected override IReadOnlyList<Tool> Tools =>
[
    new("counter-widget-rename", _T.Current.Rename, Icons.Hash, _T.Current.RenameCounterTip, _RenameAsync),
    new("counter-widget-reset", _T.Current.ResetToZero, Icons.Rotate, _T.Current.ResetThisCounterTip, _ResetAsync,
        state: () => State.Value == 0 ? new ToolState(false, _T.Current.AlreadyZero) : new ToolState()),
];

Status line. A WidgetStatus is a StatusState (none, idle, busy, live, ok, warning, error; drawn as a dot and a word, none draws neither) and text parts in order (WidgetStatusPart(text, tooltip)), joined by · in one row of a fixed height: a line wider than its row ends with an ellipsis and its tooltip is the whole line; a part with a tooltip shows it on hover and keyboard focus. The texts are text only, never markup; nothing in the line reacts to a click or a key. The view sets it with SetStatus; the application and its services set it by widget id with WidgetStatuses.TrySet(widget, status, out problem) (injectable, and builder.Widgets.Statuses at build), from any thread at any rate; agents with widget.setStatus ({"widget":1,"state":"busy","parts":[{"text":"counting"},{"text":"3 of 10","tooltip":"Steps"}]}) and read it as status per widget in dashboard.read. The latest set wins; every window that shows the widget repaints only the line, at most ten times per second, never the body. A set for a widget that does not exist (The widget 3 does not exist: it was closed or never created., NotFound for agents) or of a type without a line (… has no status line., InvalidState) is refused. A type declared with hasStatusLine: false draws no line, and its body takes the space. A widget that never set a status shows an empty line; a widget that leaves the dashboard (widget.close, the header's Close, dashboard.reset) drops its line.

SetStatus(new WidgetStatus(StatusState.Live, [new(time, "Local time")]));                     // the view
statuses.TrySet(widget, new WidgetStatus(StatusState.Busy, [new("counting"), new("3 of 10", "Steps counted so far")]), out _);

Each frame shows grip, title, owner badge, the view's tools, the palette, move left and right, detach, and close, then the body and the status line. The owner badge shows only when the type's owner is not the application (a plugin's UI name). The title keeps its room first: below 24 rem of header width the view's tools move into the header menu (⋯, one entry per tool with icon and name, closed by Escape, a press outside, or a click on one of them; a popover a tool opens sits at the menu's button), and the badge shortens before the title; move, detach, and close stay at every width. The palette (a swatch of the current color) offers Blue, Green, Yellow, Orange, Red, Purple, Teal, Gray, and None; the color marks the frame's top edge in every window and theme and is stored with the layout. Every action is a command with origin ui:

Gesture Command
Header drag (pointer, pen, touch), move buttons dashboard.move (one per finished gesture; Escape cancels a drag)
Divider drag, ArrowLeft/ArrowRight on a divider (24 px a press) dashboard.resize (one per press or finished drag; never below a minimum)
Double click on a divider dashboard.resize (one; both neighbors get the same share of their pair)
Palette color (ten, by name) or None widget.setColor ({"widget":3,"color":3}; 1 to 10, null for none; dashboard.read reports color)
(no gesture: the view or the application sets it) widget.setStatus (dashboard.read reports status)
Add widget (creation popup when the type has one), View ▸ Add widget widget.create (up to ui.widgets)
Close (asks first, see below), Detach, Return, Dashboard menu ▸ Reset layout (confirmed) widget.close, widget.detach, widget.return, dashboard.reset
Dashboard menu ▸ Export to file, Copy layout dashboard.export (with the chosen path; without one for the clipboard)
Dashboard menu ▸ Import from file, Paste layout (confirmed) dashboard.import (a dry run for the question, then with confirm)
Dashboard menu ▸ Undo import dashboard.importUndo

The Dashboard menu passes the layout on as one document (Core README § Layout document): Export to file saves it through the file browser (suggested name {application}.layout.json, filter *.json) and the toast names the file (Layout exported to C:\layouts\team.layout.json.); Copy layout puts the same text on the clipboard (Layout copied.). When the document is larger than ui.layoutImportSize, the toast adds that an import would refuse it. A write that fails shows its reason and leaves no file. Import from file and Paste layout (the base's paste button, so the clipboard is read only from its click and only up to ui.clipboardReadSize; an empty clipboard says The clipboard holds no text.) first check the document: a refused document shows its sentence and nothing changes. Otherwise a question names what changes (4 widgets go, 3 come, 1 cannot be shown.), and on Import the layout of every window is replaced; the toast counts the Warnings written to the Messages page (a widget of a plugin that is not loaded, a refused state). Undo import shows in the menu of the window that imported while the dashboard is still that layout, and brings the replaced layout back in every window; any later change of the dashboard ends it. A detached widget that the import removed shows the closed notice in its window, and comes back with the Undo.

While a header is dragged, a bar marks where the widget lands: the left edge of the column under the pointer over its left half, the right edge over its right half, none over the dragged widget itself. A press on a divider that moves less than 2 px sends nothing, so a double click logs only its own resize.

The header's Close asks in a widget popup over that widget (Close Counter?, the destructive Close Counter, and Cancel) and closes only on its confirm; the other widgets stay usable meanwhile. The profile setting widgets.confirmClose (group Dashboard, on by default) turns the question off, and the header's Close then removes the widget at once. The block panel's Close, an agent's widget.close, and every other command never ask.

Each window shows the longest prefix of the column order whose minimum widths (scaled by the UI scale) fit; below 744 layout px one widget shows. At every width the widget chooser in the top row (data-test=dash-chooser) shows the widgets icon and how many widgets show of how many (3/4, tooltip 3 of 4 widgets shown). Its list names every widget in column order with its color swatch (an empty ring for none), its title (one line; a cut title shows whole as its tooltip), Detached on a detached widget, and a check on those that show; it scrolls when the widgets do not fit the window, and the arrow keys and Enter walk and choose. Choosing a hidden widget brings it to the front of this window only (on a phone it becomes the one widget shown); a widget that shows already stays where it is. With no widget the chooser is disabled with the tooltip No widget on the dashboard. A column of a type that is not loaded is neither counted nor listed. Columns of a type that is not loaded (a missing plugin) stay in the layout and show again with their plugin. The layout is saved with the UI state (ui-state.json, each widget's color as the optional member color) and returns after a restart; a stored color outside 1 to 10 restores as none with one Warning (Widget 1: stored color 11 is not in the palette; shown without color.). The palette is the data palette of Style values: color n draws the frame's top edge with --data-n.

Detach (widget.detach) opens the widget in its own browser window (/detached/{id}) from the window whose person clicked it: the widget alone with its title, own controls, Return, and status line, following the shared theme, UI scale, and language. Its column shows a placeholder with the live status (Detached · idle · 6 counts), Show window, and Return. Closing the window returns the widget when the window's circuit ends (at once on unload; after the disconnected-circuit retention when the window dies), so a reload can return it: the reloaded window then says so and offers Detach again. An agent's widget.detach opens no window; Show window opens it. A browser that blocks the window returns the widget and says why. In desktop mode the widget opens in a desktop window of its own size titled <display name> - widget <id>, and closing that window returns it.

Desktop mode

With the desktop package (NetworkInspector.BaseApp.Desktop) and builder.UseDesktop(), --desktop shows the application in its own maximized window instead of the browser. RunAsync then blocks the calling thread for the whole run (the windows need it; on macOS it must be the main thread), so call it from Main before any await, as the quickstart does. Without a usable WebView the run continues in the default browser with one Warning that names the runtime to install. Closing the main window asks the close question (popup type base.closeQuestion, over every window) from the same read as the dry run of app.exit (docs/agents.md): one card per affected kind with its count and what happens (1 running job with the job's name and instance, cancelled; 1 agent with its client, its connection closes; 1 other window; each close line of the application and its plugins under its group), a section "would be lost" with one line per Settings tab of unapplied edits (2 unapplied edits on Profile) and a Review button each, and the list of what is saved and restored at the next start; with nothing affected it says Nothing else is affected. Keep open has the focus and changes nothing; Close is destructive and ends through app.exit; Review keeps the run and opens Settings on that tab in every window with the tab's first edited key as the search (a tab that is gone by then opens the first tab, and its sentence becomes one Warning). A question the popup limit refuses still closes, with one Warning. The window keeps to the application's own pages: other links open in the default browser, browser keys (reload, find, back, zoom) and the browser context menu do nothing, and copy and paste go through the system clipboard.

Style values

The base look is one set of CSS custom properties (Sync: StyleValues), served as /_base/tokens.css (dark in :root, light in :root[data-theme="light"]), and one component sheet /_base/base.css inside @layer ni-base, so every unlayered rule of the application wins (decision). Lengths are rem and follow the UI scale (90 to 200 % in steps of 10); borders, the focus ring, and the touch floors (24 px, 40 px under a coarse pointer) are px and do not scale.

The layout bands follow the UI scale: a window lays out for its width in layout px, its width divided by the scale it shows, so at 200 % a 1280 px window gets the phone layout. The bands start at 744 (tablet), 1280 (notebook), 1920 (desktop), and 2560 (ultrawide) layout px. body is the size container ni-window, and each band is a container query in rem against it (@container ni-window (min-width: 46.5rem) for 744; rem in a container query is the root font size, which the scale sets). A window narrower than 320 layout px at the chosen scale shows the largest step of 10 % that keeps 320 (at least 90 %), only in that window: a 390 px phone with a profile at 200 % shows 120 %, and the UI scale row on the Settings page says This window shows 120 % because it is too narrow for 200 %. The stored scale stays. html[data-band] names the band of the window (phone, tablet, notebook, desktop, ultrawide) for scripts, tests, and agents, and the window raises the event ni:band when it changes.

An application sheet that switches its layout at a band writes @container ni-window (min-width: …rem) (the px value ÷ 16), so its band follows the scale; @media (min-width: 744px) still works at 100 % but ignores the scale. Name every container of your own (container: my-panel / inline-size and @container my-panel (…)): an unnamed @container query binds to the nearest container, which is the window on body when no nearer one exists. The container on body also makes body the containing block of position: fixed; body fills the window at (0, 0), so fixed layers keep their place.

The sizes follow one compact scale chosen by the pointer, never by the window width: the media rule (pointer: coarse) switches the touch values in, so a phone with a mouse gets the mouse sizes and a touch notebook the touch sizes. The last block of /_base/tokens.css (StyleSheetWriter.CoarsePointerBlock) switches --list-row and --list-entry; the base sheet (Styles/foundation.css) switches --target. Values at UI scale 100 %:

Token Mouse (fine) Touch (coarse)
--list-row (one-line row, list header) 1.5rem (24 px) --list-row-coarse 2.25rem (36 px)
--list-entry (entry with a second line) 2.5rem (40 px) --list-entry-coarse 3rem (48 px)
--control (buttons, inputs) 1.75rem (28 px) at least --target
--menu-entry (app menu, page rail) 1.75rem (28 px) at least --target
--target (hit-area floor) --target-fine 24px --target-coarse 40px
--font-base / --font-micro 0.78125rem (12.5 px) / 0.625rem (10 px) the same

Body text is --font-base; no text is below --font-small (11 px) except count badges in --font-micro. A smaller icon keeps its drawn size inside a hit area of its button's box. To change a touch value, override its coarse token (list-row-coarse), not list-row: the coarse block comes after the :root blocks and wins on a coarse pointer.

Token Role Dark Light
--bg Background #1f1f1f #f8f8f8
--panel Surface #181818 #ffffff
--panel2 Surface #252525 #f3f3f3
--panel3 Surface #2d2d2d #e8e8e8
--hover Surface #333333 #e4e4e4
--line Line #3a3a3a #d4d4d4
--text Text #cccccc #1f1f1f
--muted Text #9d9d9d #5f5f5f
--strong Text #ffffff #000000
--accent Accent #0078d4 #005fb8
--accent-text Text #75b0e6 #005fb8
--focus-ring FocusRing #75b0e6 #005fb8
--sel-bg Surface #04395e #0060c0
--sel-fg Text #ffffff #ffffff
--ok-bg State #16331f #e6f4ea
--ok-line Line #4f9461 #2e8647
--bad-bg State #3b1719 #fde7e9
--bad-line Line #cc5e5e #c72e3b
--bad-text Text #e57f7f #a1192b
--busy Text #d7ba7d #7d6300
--idle Text #89d185 #1a7f37
--danger Fill #c72e3b #c72e3b
--on-fill Text #ffffff #ffffff
--tip-bg Overlay #252525 #ffffff
--tip-line Line #454545 #c8c8c8
--scrim Overlay rgba(0, 0, 0, 0.5) rgba(0, 0, 0, 0.5)
--shadow Overlay 0 0.5rem 1.5rem rgba(0, 0, 0, 0.45) 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15)
--data-1 … --data-10 Mark the data palette below the data palette below

Data palette. Ten named colors for marks, badges, series, instances, and widgets: color n is the custom property --data-n, so a mark drawn with var(--data-3) follows a theme switch. PaletteColors.All lists them for application code (number, name, both values, Variable); the core's DataPalette.Count is the number of colors (a widget or instance color is 1 to 10 or none) and DataPalette.NameOf holds the names.

Token (name) Dark Light
--data-1 (blue) #7cb7e8 #1f63a6
--data-2 (green) #7fc48a #2e7d3c
--data-3 (yellow) #d6c06a #7a6400
--data-4 (orange) #e0a06a #a35400
--data-5 (red) #e48a8a #b03a3a
--data-6 (purple) #b89ae6 #7a4cc0
--data-7 (teal) #6cc4c0 #00777a
--data-8 (gray) #a8a8a8 #636363
--data-9 (pink) #e08ab8 #a8357a
--data-10 (olive) #b4c86e #5b6e14

A Mark token stands at least 3:1 against --bg and --panel in both themes. In the dark theme every data color, every state color (--ok-line, --bad-line, --bad-text, --busy, --idle), and --accent-text is muted: a channel spread (the largest minus the smallest of red, green, and blue) of at most 128 and a contrast to --panel from 4.5:1 to 13:1; in the light theme each reaches 4.5:1 on --panel. An application runs the same check on its own colors:

string? problem = PaletteColors.CheckMuted("#4da3ff", PaletteColors.DarkPanel);
// "#4da3ff: channel spread 178, at most 128 allowed (the largest minus the smallest of red, green, and blue)."

CheckMuted(color, panel) takes #rgb or #rrggbb and returns null for a muted color, else one sentence naming the bound it misses; any other text is answered with a sentence, never an exception. The bounds are PaletteColors.MaxChannelSpread, MinContrast, and MaxContrast. PaletteColors.ChannelSpread(color) and PaletteColors.Contrast(color, panel) return the two numbers the check bounds (unrounded; null for a text that is no color), for example to show them, as the sample's Gallery does.

Lengths, durations, and layers (--space-*, --font-*, --control, --layer-*, …) are listed in StyleValues.Values.

A page root that should fill the page (a list or a dashboard) carries the class ni-page-fill; it grows or shrinks to the height between the top row and the status bar, never below its content's minimum size, so a page whose fixed parts need more still scrolls. Parts that scroll themselves (lists, widget bodies) take the rest, so a tall widget scrolls inside its body. The base list pages, Settings (its scroll part between the tabs and the Apply bar), and the dashboard use it. Put it on the root element of the page component; on a nested element it has no effect (Sync: Styles/shell.css .ni-page-area, .ni-page-fill).

builder.Shell.Style:

  • Override(token, dark, light) replaces one token (the sample sets accent); a value has 1 to 200 characters without ; { } < >, a comment, or a line break.
  • AddStylesheet(path) links an unlayered sheet of the application after the base sheet (the sample adds sample.css).
  • ReplaceStylesheet(path) links the application's sheet instead of /_base/base.css; the token sheet stays.

Icons: the bundled set is every icon of Lucide 1.73.0 (2,359 drawings), named by its Lucide name, for the application and its plugins alike: a page, an app-menu entry, a tool, or a status item names plug or flask-conical without adding an icon. Find a name on lucide.dev/icons, in Icons.Names (every name, in ordinal order), or in the sample's Gallery (card Icons, with a search and Copy name). The base itself uses these constants (Icons, Sync: Icons.cs): Menu (menu), Close (x), Home (house), About (info), Licenses (scroll-text), Messages (message-square), Jobs (list-checks), Commands (terminal), Plugins (puzzle), Settings (settings), Light (sun), Dark (moon), Profile (user), Expand (chevron-right), Collapse (chevron-down), PanelCollapse (panel-left-close), PanelExpand (panel-left-open), Check (check), Copy (copy), Delete (trash-2), Stop (square), Retry (rotate-ccw), Folder (folder), FolderUp (folder-up), File (file), Search (search), Add (plus), Remove (minus), MoveUp (arrow-up), MoveDown (arrow-down), Show (eye), Hide (eye-off), Rotate (refresh-cw), Warning (triangle-alert), Error (circle-x), Info (circle-alert), More (ellipsis-vertical), Hash (hash), Paste (clipboard-paste), List (list), Dashboard (layout-dashboard), Grip (grip-vertical), MoveLeft (chevron-left), MoveRight (chevron-right, the drawing of Expand), Detach (external-link), Columns (columns-3), Switch (arrow-right-left), Rename (pencil), Exit (power), TextSearch (text-search). IconView draws one by name, a bundled or an application icon, and the neutral icon (File) for a name no one added; IconButton is an icon-only button whose label is its accessible name and its tooltip (see Shell, Tooltips).

Application icons

An application adds its own icons by name before Build, and names them wherever the base takes an icon: rail pages, app menu entries and submenus, tools, status items, and context menus. An added icon draws inline in the text colour of its place in both themes, like a bundled one, and needs no network. Plugins add no icons; they name the bundled ones or the application's.

builder.Shell.AddIcon("sample.flask", "<svg viewBox=\"0 0 24 24\"><path d=\"M9 3h6\"/>"
    + "<path d=\"M10 3v6L4.5 19a1.5 1.5 0 0 0 1.3 2h12.4a1.5 1.5 0 0 0 1.3-2L14 9V3\"/><path d=\"M7 15h10\"/></svg>");
builder.Pages.Add<CounterPage>(new PageDeclaration("counter", title, "sample.flask", MenuPlace.Application, 100, …));
  • Name: lower-case letters, digits, and dashes in parts joined by dots, 1 to 64 characters; by convention the application's prefix first (sample.flask). Page and action icon names follow the same rule. A bundled name (any Lucide name, such as flask-conical) or one added before is refused: The icon menu is taken: a base icon., The icon sample.flask is taken: added before.
  • SVG: one svg element (its viewBox, else 0 0 24 24) holding only g, path, circle, ellipse, line, polyline, polygon, rect, and title, with only the attributes d, cx, cy, r, rx, ry, x, y, x1, y1, x2, y2, points, width, height, transform, opacity, fill, stroke, stroke-width, stroke-linecap, stroke-linejoin, fill-rule, clip-rule, and xmlns of the SVG namespace. fill and stroke are none or currentColor; the shell's icon element strokes in currentColor by default. The root's width and height are dropped (the shell sizes the icon), its other attributes apply to the whole drawing. Comments and the XML declaration are dropped; a DOCTYPE is refused.
  • Refusal: AddIcon throws ArgumentException with The icon {name} {reason}., the reasons checked in this order: is not one SVG image, holds a script element; an icon may hold drawing elements only, holds the event attribute {attribute}, links an external reference {value} (any href, also a local one), embeds a document ({element}) (foreignObject, iframe, object, embed), holds element {name}, which an icon may not use (also attribute, text, processing instruction), uses the colour {value}; icons draw in currentColor. A refused icon stops the start; nothing of it reaches a page.
  • Markup: the icon is parsed without a DTD or a resolver and written again from what passed the list, with every value escaped; the original text never reaches a page (Sync: ApplicationIconCheck).
  • Unknown names: a name no one added shows the neutral icon (file) at every place, with one Warning per name and run where the place reports one (page rail, app menu, status bar); a malformed name is refused where it is declared (a page, an action, a tool).

Bundled assets

Vendored once (decision); listed in the license inventory as kind Asset.

File Source License SHA-256
wwwroot/fonts/JetBrainsMono-Regular.woff2 JetBrains Mono 2.304 OFL-1.1 a9cb1cd82332b23a47e3a1239d25d13c86d16c4220695e34b243effa999f45f2
wwwroot/fonts/JetBrainsMono-Bold.woff2 JetBrains Mono 2.304 OFL-1.1 c503cc5ec5f8b2c7666b7ecda1adf44bd45f2e6579b2eba0fc292150416588a2
Licenses/JetBrainsMono-OFL.txt JetBrains Mono 2.304 OFL.txt OFL-1.1 30f0c136e3c88e422d0791acd97238870f9054a9729bc34cf2ff0d4ed8cac4ad
Components/Shared/Icons/lucide-1.73.0.json (2,359 drawings, embedded) lucide-static 1.73.0 icons/*.svg ISC 8f400c16c6bbe4cad112342f8e7a0d45176fbcabf299423e52f85f8bb4a28db2 (archive be3b73fa4fc10727c1c2c21dc11bd8d91a36012ce3aa9436eda4c2020021f4d1)
Licenses/Lucide-LICENSE.txt lucide-static 1.73.0 LICENSE ISC b495047bd93a9b06913511076f504daba17d5bbeb3e0650f3bb53a4220329c57

Logging

log.level (off, error, warning by default, information, debug) sets the lowest level of framework and application ILogger lines in the core's log file; log.fileEnabled turns the file off. Both apply at once, without a restart. The token and every start key are masked (***) in every line, including the request lines the framework writes after a start link was used.

Shutdown

app.exit (agents need confirm=true), Ctrl+C or Ctrl+Break, SIGTERM, or the confirmed close of the desktop main window or of the Exit control at the foot of the rail all run the same shutdown. First the closing work of the application and its plugins runs, one piece after another, each bounded by app.closingWait (5 s by default, 1 s to 10 min, or off); then the window connections are closed, agent requests finish within agent.requestTime, the plugin start ends, and the core shuts down (UI state, jobs within jobs.stopWait, plugins, journal, log, settings). Closing work runs while the jobs, the settings, the UI state, and the commands are still usable:

builder.Core.Closing.Add("sample.flush", async cancel => await log.FlushAsync(cancel), SampleOwner.Name);

A plugin adds its own with AddClosingWork(name, work) on its builder. A piece that does not end within the limit is left and named in one Warning with the limit and its key; a piece that throws is named in one Error; the shutdown goes on in both cases. The sample's closing work sample.flush writes Sample Application closed cleanly (…) to the log.

The first stop signal (Ctrl+C, Ctrl+Break, SIGTERM) writes one line to standard error and the log and starts this shutdown:

Sample Application is stopping.

An application that ends at once shows nothing more. When the shutdown still waits one second later (a display rule, not a setting), one more line on standard error and in the log names the step it waits for and offers the way out:

Sample Application is still stopping while waiting for jobs: Demo (job 3). Press Ctrl+C again to end it at once.

Before the shutdown names its first step the line reads Sample Application is still stopping. Press Ctrl+C again to end it at once.

A second signal while the application is stopping (also after app.exit or the window's close started it) ends the process within a second with exit code 130, after one line on standard error and in the log that names the step it interrupted:

Sample Application ended at once while waiting for jobs: Demo (job 3).

Other steps read running the closing work sample.flush, stopping the web host, saving the UI state, stopping the plugins, flushing the log, and so on. Files the shutdown writes (the UI state, settings) are replaced in one move, so after such an end each holds its old or its new content; the next start deletes the temporary file of an interrupted UI state save without a Warning.

UI test hooks

An application's browser tests find the base's controls by these attributes, which stay stable across releases:

Attribute Marks
data-test a control of a base component or page (data-test="list-goto", data-test="tools-more")
data-page, data-menu a rail entry by page id; an app-menu node by its key (profiles/:manage)
data-tool a declared tool by its id, in its row and in the More menu (data-tool="messages-copy-all")
data-widget-id a dashboard widget's frame by widget id
data-popover, data-popover-trigger a popover and the element that opens it, by the same id
data-field, data-label a fact of a license entry by name (data-field="license"); a cell's column title (lists)

Class names (ni-…) and every other attribute are not a contract and may change in any release. The list's probe output (data-pending, the ni-list-ack event) is off in an application: only the base's own UI tests turn it on, in code.

Build and test

dotnet build NetworkInspector.BaseApp/NetworkInspector.BaseApp.csproj -c Release
dotnet test --project NetworkInspector.BaseApp.Tests/NetworkInspector.BaseApp.Tests.csproj -c Release
dotnet test --project NetworkInspector.BaseApp.UiTest/NetworkInspector.BaseApp.UiTest.csproj -c Release

The UI tests drive the installed Edge (Windows) or Chrome, headless and without the GPU; the test parameters browser-channel (chrome, msedge, bundled, …) and browser-executable (an approved browser's path) choose another one: dotnet test --project NetworkInspector.BaseApp.UiTest/NetworkInspector.BaseApp.UiTest.csproj -c Release --test-parameter browser-channel=chrome. --test-parameter platform-address=<printed address> runs ExternalInstanceTests against an instance elsewhere (for example under WSL 2).

Documentation

License

MIT; see LICENSE. The bundled font and icons keep their own licenses (§ Bundled assets).

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on NetworkInspector.BaseApp:

Package Downloads
NetworkInspector.BaseApp.Desktop

Desktop window for applications on NetworkInspector.BaseApp: the same UI in an Avalonia window with the operating system's WebView (WebView2, WKWebView, WebKitGTK).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.23.0 0 11/26/2026