Skip to content

Serenity 10.8.0 Release Notes (2026-11-26)

These release notes detail the changes made in Serenity and StartSharp from version 10.7.0 to 10.8.0. For a complete list of changes, please refer to the Serenity Change Log.

There were no skipped versions between the two, so everything below is new in 10.8.0. Three threads run through the release:

  • Less is sent to the browser. Form and columns scripts, local texts and the ES modules of the application can require a permission, so a visitor who has not logged in, or a user without that permission, gets only the part of the application they can use. The templates turn this on, along with a rate limiter for the account actions.
  • A grid that behaves like a table and reads like one. Row and cell states each get a visual channel of their own, a list gets a row cursor, a row shows a single edit link, grouped grids keep their stripes and can show their totals on the group row, pinned columns no longer look like separate panes, and every view shares one pager.
  • A UI that is easier to reach and to read. Select editors became checklists with their items declared on the attribute, a property can bring a view of its own record (a hover card, or the card of a row), quick filters fold behind a Filters button on a phone, dialogs keep their place, months and days are written in the user's language, and themes became families with light and dark schemes (StartSharp).

Along the way, reports can be structured and exported as a whole, the Translations and Languages pages were rewritten, the texts in code can be written in a language other than English, and the Northwind samples got a Pro page for every entity, built from the new PageKit components and ClientGrid (StartSharp).

Themes With Light and Dark Schemes (StartSharp)

A StartSharp theme is now a family with a light and/or a dark scheme, instead of a single fixed look. Users pick a theme and a scheme (light, dark or "system", which follows the operating system) from the theme menu in the sidebar.

  • Azure has a light scheme (the former Azure theme) and a dark scheme (the former Cosmos theme).
  • Glassy has a light scheme (the former Glassy theme, redone) and a new dark scheme. Its cards, grids, panels, dialogs and sidebar are frosted glass over a photo: translucent, blurring what is behind them, with a light edge. Users who ask their system for less transparency get solid surfaces.
  • Carbon is new. It is a flat, neutral black and white theme with light and dark schemes, the Inter font, rounded controls and soft accent highlights in the navigation.
  • Slate is new. It is a variant of Carbon with the colors of the GitHub Light Default and Dark Default themes for VS Code and the corner radii of VS Code's UI. Its primary buttons take GitHub's blue instead of its green, which reads as a success action in an application.
  • Studio is new. It is a variant of Carbon with the colors and corner radii of VS Code's 2026 Light and 2026 Dark themes.
  • Ember is new. It is a warm variant of Carbon based on the Gruvbox palette: warm off-white or warm gray surfaces, brown text and a muted blue accent.
  • Tide is new. It is a cool variant of Carbon based on the Monokai Snow and Monokai Storm themes for VS Code: blue-gray surfaces with cyan and teal highlights.
  • Lilac is new. It is a pastel variant of Carbon based on Catppuccin Latte and Mocha: soft lavender-gray surfaces with a mauve accent.

The Carbon theme in its light scheme, with the theme menu of the sidebar open

The Carbon theme in its dark scheme

The dark scheme of Glassy, with frosted panels over a photo

The Lilac, Ember and Tide themes side by side

The selected theme and scheme are stored in the ProTheme and ProThemeScheme cookies. A theme chosen with an earlier version (the ProThemeSelection cookie) is still recognized, so users keep their choice after the upgrade. The page is rendered with the right scheme from the start, so there is no flash of the wrong colors, even for "system".

Configuring the Themes

Themes are configured in the Theme section of appsettings.json. All settings are optional:

{
  "Theme": {
    "DefaultTheme": "slate",
    "DefaultScheme": "auto",
    "ExcludedThemes": [ "glassy" ]
  }
}
  • DefaultTheme is the theme of users who did not choose one (default carbon).
  • DefaultScheme is light (default), dark or auto (follows the operating system).
  • ExcludedThemes removes built-in themes from the menu.
  • Themes adds your own themes, see below. A theme with the same Id as a built-in one replaces it.

The theme menu adapts to what is configured. With several themes it lists every theme and its schemes. With a single theme that has both schemes, the menu button becomes a light / dark / system toggle. When there is nothing to choose, the button is hidden.

Theme titles can be translated with the Controls.ThemeSelection.Themes.{Title} keys, for example Controls.ThemeSelection.Themes.Carbon.

Design Tokens

Colors, fonts, sizes and spacing of the Serene and StartSharp themes come from CSS variables (tokens) with the --s- prefix, plus Bootstrap's own --bs- variables. Their default values are in tokens.css of Serenity.Extensions, which is shared by Serene and StartSharp, and the theme files now contain nothing but token values.

This means you can adjust an existing theme from your own site CSS, without copying its rules:

:root.theme-carbon {
    --bs-primary: #7c3aed;
    --bs-primary-rgb: 124, 58, 237;
}

:root.theme-carbon[data-bs-theme=dark] {
    --bs-primary: #a78bfa;
    --bs-primary-rgb: 167, 139, 250;
}

The comments in tokens.css (and in _vars.css of Serenity.Pro.Extensions for StartSharp-only tokens) describe the optional tokens. These have no value by default, but a theme can set them, for example --s-sidebar-link-active-bg for the background of the current page in the navigation, --s-stat-card-body-bg for the small statistic cards on the dashboard, or --s-page-backdrop and --s-glass-filter for a background (gradients or an image) behind blurred, translucent surfaces like in Glassy.

Your Own Themes

To add a theme, register it in the settings and give it a token block for each scheme in your site CSS:

{
  "Theme": {
    "Themes": [ { "Id": "corporate", "Title": "Corporate", "SupportsLight": true, "SupportsDark": true } ]
  }
}
:root.theme-corporate {
    --bs-body-bg: #f7f7f2;
    --bs-primary: #00695c;
    --bs-primary-rgb: 0, 105, 92;
    /* ... */
}

:root.theme-corporate[data-bs-theme=dark] {
    --bs-body-bg: #10201e;
    /* ... */
}

The html element gets the theme-{id} class and data-bs-theme="light" or "dark". Copying the token blocks of azure-light.css, cosmos-dark.css, glassy.css or carbon.css is a good starting point, since they list the tokens a theme is expected to set.

To make a color variant of an existing theme, set its BaseTheme, e.g. { "Id": "brand", "Title": "Brand", "BaseTheme": "carbon", "SupportsDark": true }. The page then gets both the theme-brand and the theme-carbon classes, so the variant's CSS only has to override the colors, as slate.css does. Load it after the base theme's CSS, and repeat the light values that differ in the dark block, since :root.theme-brand also matches in the dark scheme.

Site Logo per Background

Themes now decide which version of the site logo they show: the white logo on dark or brand colored backgrounds (Azure, Cosmos, Glassy, Carbon dark), or the colored logo on light backgrounds (Carbon light). The application provides both images in style.site.css, see the upgrade steps below.

Other Visual Changes

These apply to all themes, including Serene:

  • Select2 dropdowns are now exactly as tall as text inputs. Before, they were 2px taller and looked misaligned next to them.

  • The background of select2 fields now follows the inner curve of their rounded border, so corners no longer show small gaps.

  • The sidebar band (the narrow column with the group icons and the logo) is narrower, and the navigation pane gets the freed space. The sidebar itself keeps its width. To restore the previous band width, set --s-sidebar-band-width: 4rem on :root in your site CSS.

  • The total rows of grid groups have dark colors in dark themes. Their colors come from the --s-group-totals-bg, --s-group-totals-border and --s-group-totals-text tokens.

  • The footer row of a grid, e.g. one with totals, is a band of its own: it is a bit shorter than a data row (26px, used to be 30px), takes the background of the column headers and has a line above and below, so the totals read as a row of the grid instead of a floating number under it. It follows the header chrome, so a plain grid (--s-header-chrome: 0 or slick-plain-table) gets neither the background nor the line below it. The lines come from --s-footer-row-border (default --bs-border-color), the background from --s-footer-row-bg, and the totals use the header color with tabular numbers, so they line up under their columns.

  • In grouped grids, group header rows have their own background (--s-group-row-bg) instead of the odd / even row colors, and the rows of each group are striped from the group header, so the first row of every group looks like the first row of the grid. Before, the stripes continued across groups, so a group could start with either row style, and expanding or collapsing a group changed the stripes of all the groups below it. If your CSS targets .slick-group.odd or .slick-group.even, use .slick-group instead. The stripes come from a new optional getRowStripe(row) method of SleekGrid's IDataView, which RemoteView and StartSharp's VirtualScrollView implement; other data views keep striping rows by their index.

  • The auto column width of a grid now measures the footer row too, e.g. a column of totals, so a total that is wider than the cells of its column is no longer cut off. A grid that doesn't show its footer row is not affected, and the new ignoreFooters option (true, or a number that caps the width the footer adds) turns it off.

  • Grid rows can have a hover highlight, from the optional --s-row-hover-bg token, which Carbon and the themes based on it set. It covers the whole row, including pinned columns, and is a layer over the fill of whatever state the row is in, see Grid Row and Cell States. Carbon-based themes have no row stripes by default, while Azure, Glassy and Serene keep them. The new --s-stripes variable (1 or 0) turns them on or off, for the whole page or for a single grid, whatever the theme:

    /* stripes in every grid */
    :root {
        --s-stripes: 1;
    }
    
    /* but not in this one */
    .s-OrderGrid {
        --s-stripes: 0;
    }
    

    Themes set --s-stripes-default instead, so a value you set for --s-stripes always wins. The stripe color still comes from --s-alt-row-bg. The existing slick-no-odd-even class now just sets --s-stripes: 0 on its element, so it still turns the stripes off for a grid, even when they are turned on for the page.

  • In the same way, --s-cell-borders (1 or 0) shows or hides the lines between grid rows for the page or a grid, and themes set --s-cell-borders-default. Hidden lines are transparent, so rows keep their height. The existing slick-no-cell-border class now sets --s-cell-borders: 0 on its element and still removes the header column borders.

  • --s-header-chrome (1 or 0) and the new slick-no-header-chrome class turn off the background, top border, shadow, column separators and always visible menu buttons of StartSharp grid headers. The new slick-plain-table class turns all three switches off, so a grid looks like a plain table. A grid class can also return a GridStyle (flags: NoStripes, NoCellBorders, NoHeaderChrome, and the shortcuts Lines and Plain) from the new getInitialGridStyle() method of DataGrid, and the dashboard table widget has a Table Style option that picks the same flags (Enterprise). See Grid Appearance for all the switches, classes and grid colors.

  • Outline secondary buttons (btn-outline-secondary) take the body text color and the border color of inputs instead of Bootstrap's secondary color, which made them look disabled.

  • The colors of the Conditional Formatting sample follow the color scheme, so they are readable in dark themes too.

  • Glassy's former component rules (panel backgrounds, the page background image, opaque dialogs) are replaced by tokens. If your site CSS overrode them with .theme-glassy-light ... rules, check the result, as surfaces are now translucent with a blur.

Grid Column Persistence

When a grid restores a user's personal settings from storage, newly added columns that are visible by default now appear relative to their default neighbors. The user's visibility and order choices for columns already in the saved settings are kept. Columns hidden by default remain hidden. Older snapshots without persistence flags keep their previous behavior, since they cannot be identified as complete column snapshots.

A direct restore, such as loading a saved view, remains an exact snapshot by default. A grid can change the automatic behavior through gridPersistenceFlags():

protected override gridPersistenceFlags(): GridPersistenceFlags {
    return {
        ...super.gridPersistenceFlags(),
        restoreOptions: {
            newVisibleColumns: false,
            onRevisionMismatch: "merge"
        }
    };
}

newVisibleColumns: false keeps the saved visibility instead of adding new columns. onRevisionMismatch: "merge" keeps the saved layout when the columns revision changes. These restore-only options can also be supplied explicitly to a restore; they are not saved with the grid settings.

Column Revisions

Set a positive Revision on a columns class when a change makes older personal column layouts incompatible:

[ColumnsScript("Northwind.Order", Revision = 1)]
public class OrderColumns
{
    // ...
}

When the current revision differs from the saved one, including when the saved settings have no revision, an automatic restore resets the enabled column layout settings to their initial order, visibility, widths and pinning. Saved sorting and filters are still restored. Increment the revision for a later incompatible change; the default of 0 disables revision checking. The revision travels with the property items and is saved with the column settings.

The automatic default for onRevisionMismatch is "reset". A direct restore defaults to "merge", preserving the saved view, but either behavior can be requested explicitly. The newVisibleColumns option is independent of the revision policy.

Persistence Events

DataGrid.onPersistence now notifies handlers before and after capturing settings, as well as before and after restoring them. A before-capture handler can adjust flagsToUse to decide what is saved. columnResized identifies a save triggered by a column resize; automaticRestore identifies a personal restore from storage. After an automatic restore, flagsToUse contains the resolved restore options; after any restore, columnLayoutReset tells whether a revision mismatch discarded the saved layout, and columnWidthsRestored tells whether any saved width was applied.

Auto Size All (StartSharp)

For a grid with auto-size-on-load enabled, choosing Auto Size All from a column header menu or Ctrl+double-clicking a resize handle now saves that mode without the old column widths. On reopening the page, the grid sizes its columns from the loaded data instead of returning to the earlier widths. By default, a manual resize disables auto-sizing on load and saves the widths; set disableIfUserResize: false to keep auto-sizing after a resize. A revision reset also re-enables auto-sizing when width restoration is enabled, provided autoSizeOnLoad is not disabled in the options.

One Pager for Every View (StartSharp)

SlickPager now also serves the views that show a range of the rows instead of a page of them, so InfiniteScrollView and VirtualScrollView no longer need pagers of their own. InfiniteScrollPager, VirtualScrollPager and the ScrollLoadingView interface are removed, which makes the pager part of corelib instead of Pro.Extensions.

A view tells the pager how to show its rows through two new optional fields of PagingInfo:

  • pagingMode is "pages" (the default) or "rows". It is set even before there are any rows, so a pager knows its layout from the start, and a view with no rows at all does not show page navigation either.
  • rowRange is the rows to tell of when the mode is "rows", as { from, to, total? }. total is left out while it is not known, e.g. while more rows can still be loaded. InfiniteScrollView reports the rows it has loaded, and VirtualScrollView reports the rows in the viewport, by their numbers among all the rows of the dataset, so the status follows the scroll instead of the page.

A pager that is given a grid (the new PagerOptions.grid option) also binds a view that implements the new IGridBoundView interface to it, which is how the scroll views learn to load the next rows as the grid is scrolled. DataGrid.createPager() sets the grid, so a grid that uses a scroll view only needs to override createView():

protected override createView() {
    return new VirtualScrollView<MyRow>(this.getViewOptions());
}

A page view has compact bordered buttons for the previous and next pages, which keep their place and look disabled at the first and last page, and no longer shows the buttons that go to the first and last pages by default, as the page box, which no longer has a "Page" label before it since the number and the page count tell what it is, takes a number anyway; set the new showFirstLast option of the pager, or SlickPager.defaults.showFirstLast for all pagers, to bring them back. A range view gets no page navigation at all, no page box and no page count. It keeps the rows-per-page selector, which is the chunk size of the scroll views, the reload button and the status, which tells "1 to 20 of 500" or only "1 to 20" while the total is not known.

Upgrading

Replace a removed pager with SlickPager, or with the one of the base grid:

// before
protected override createPager() {
    new VirtualScrollPager({
        view: this.view as VirtualScrollView, grid: this.sleekGrid,
        element: el => this.domNode.append(el)
    });
}

// after, as DataGrid already passes the grid and the view
protected override createPager() {
    super.createPager();
}

The s-InfiniteScrollPager and s-VirtualScrollPager CSS classes are gone with them, while s-SlickPager remains. A custom view can use the same mechanism by returning pagingMode and rowRange from getPagingInfo(), and implementing bindToGrid if it needs the grid.

Grid Row and Cell States

A grid does not have one "selected" state but several, each with its own meaning. Before, they competed for the same background, so e.g. a checked row under the cursor looked like neither. Now each state has its own visual channel, in both the Serene and StartSharp themes:

State CSS class Look
hover slick-row hover a translucent layer over the fill of the row (--s-row-hover-bg, set by Carbon-based themes)
cell cursor slick-cell active a ring around the cell (--s-cell-active-ring), no fill
current row slick-row active a light neutral fill (--s-row-active-bg), only with the new highlightActiveRow option
checked slick-row checked-row a fill (--s-row-checked-bg) and a band at the start edge of the row (--s-row-checked-accent)
row cursor slick-row active in a slick-row-navigation grid the fill of a selection (--s-row-cursor-bg), no ring, see Row Cursor
selected slick-cell selected a primary colored fill (--s-cell-selected-bg), from a selection model
being edited slick-row active with inline editing a light green fill (--s-row-editing-bg)

A row has one fill, from the state with the highest priority: stripe < current row < checked < row cursor < selected < being edited. A fill replaces the stripe instead of being mixed with it, so a checked or selected row is not striped. The hover layer goes over the fill, the band tells a checked row apart from a selected one, and the ring shows a cell cursor in any of them. A cell that the grid flashes, e.g. after a change, takes --s-cell-flash-bg over all of them.

Some of these are fixes of what you may have seen before:

  • A grid row is no longer tinted just because one of its cells is the active one, which happened as soon as a cell was clicked in a grid with cell navigation. A grid that wants the row of the cursor highlighted, e.g. one edited a row at a time, sets the new highlightActiveRow option, as the GridEditController of StartSharp does.
  • The cells that a selection model selects are filled with the primary color, so a RowSelectionModel is no longer invisible. RowSelectionModel also selects the clicked row in a grid without cell navigation, where it used to select nothing.
  • SelectableEntityGrid uses the selected class of the grid again, so its selected rows are styled.

The new Selection States sample in Advanced Samples / Grids shows all the states side by side, with toggles for the cursor mode, the current row highlight, the row selection model, inline editing, stripes and a hover cue (StartSharp).

Row Cursor

A list whose rows open a dialog, like most entity grids, has no use for a cell cursor, but a keyboard user still needs a way to move between the rows and open one. SleekGrid's enableCellNavigation option now also takes "row", which makes the active cell a row cursor:

  • The row is filled like a selection, without the ring of a cell cursor.
  • Up, Down, Page Up, Page Down, Home and End move it between the rows. Left and Right scroll the columns, and Tab leaves the grid.
  • A click on a row puts it there, and Down or Up in a grid without a cursor starts it at the first or last row.
  • Enter opens the dialog of the row in an EntityGrid that is not edited inline.
  • Space or X checks the row, in a grid with the check boxes of GridRowSelectionMixin.
protected override getSlickOptions() {
    const opt = super.getSlickOptions();
    opt.enableCellNavigation = "row";
    return opt;
}

The grid container gets the slick-row-navigation class. A grid class can handle more keys with the new protected onKeyDown(e, row, cell) method of DataGrid, which is called before the grid handles the key; calling preventDefault() and stopImmediatePropagation() on the event keeps the grid from handling it too.

The EditLink attribute is often put on several columns that open the same record, e.g. the ID, the customer and the date of an order. Each of them as a link looks busy, as the row repeats the same link. A grid can now show a single link per row:

DataGrid.defaultOptions.editLinks = "primary";

Only the first visible column with a link to the record of its row is then a link. The others are quiet links (the s-EditLink-quiet class): they look like the text of their cell until the row is hovered or the link has the focus, and they still open the record when clicked. When the first one is hidden or moved, e.g. with the column picker, the next one becomes the link. Links to records of other types, e.g. an EditLink with an ItemType, are not affected.

The default stays "all", as before, while StartSharp sets "primary". To keep every link in StartSharp, set DataGrid.defaultOptions.editLinks = "all" in your script init. A grid can also override getEditLinks(), or pick its link with getPrimaryEditLinkColumn(columns). The color of a quiet link comes from the optional --s-edit-link-quiet-color token, the text color of the cell by default.

The new Quiet option of the attribute decides for a column, whatever the option of the grid:

[EditLink, AlignRight]
public string OrderID { get; set; }

[EditLink(Quiet = true)]   // always quiet, and never the link of the row
public string CustomerCompanyName { get; set; }

[EditLink(Quiet = false)]  // always a link
public string ShipName { get; set; }

Without Quiet, the grid decides. A column that is a full link by its attribute is the link of the row when it comes first, so the ones after it are quiet.

Grouped Grids

  • Indented rows. The data rows of a group are indented under their group row, so nested groups line up with what they summarize. The indentation comes from the slick-group-level-N classes and the --sg-group-indent variable instead of inline styles, so grouping works under a content security policy that disallows inline styles, and it stops at 8 levels. The new indentDataRows option of RemoteView (passed from the DataGrid options) turns it off, and groupIndentation of the provider is kept but deprecated.
  • Totals on the group row. displayTotalsRow now takes boolean | "groupheader", for a grouping level and for the DataGrid.defaultOptions of the levels that do not set it, so the aggregates of a group can be shown on the row of the group itself, in its summary columns, instead of on a totals row under it, which is what a grid of totals or a dashboard table prefers. The group cell of such a row spans up to the first summary column, so the other cells keep their own formatter, e.g. the one of the check boxes. This replaces the groupRowTotals option of GroupItemMetadataProvider, see Breaking Changes. The StartSharp template turns it on for all of its grids in the new grouping-init.ts, see the upgrade steps.
  • One check box for a group. In a grid with the check boxes of GridRowSelectionMixin, the check box of a group row checks or clears the rows of the group, and shows the partial state of a group where only some of its rows are checked (selectGroups, on by default). It is hidden in the views that do not have the rows of a group on the client, e.g. a virtual scroll view, as the ids of the rows are not known there.
  • The keyboard. Space and + / - toggle the group of the focused row on its group cell, and Left and Right collapse and expand it at the first and last cell of the row that can be focused, where they would not go to another cell anyway (the ends are swapped in a right-to-left grid). The arrow keys are left to the grid when they can move to another cell.
  • The select column, the row number and the summary columns are kept in front of the group cell, and the new skipGroupCell column flag leaves a column out of it, which the selection columns set.

A grouped grid with the rows of each group indented and the totals of the group on its row

Select Editors

The editors that show a list of values, i.e. the select, lookup, service lookup and enum editors, got options that make them behave like a regular select, or like a checklist, along with the way to give them their items on the attribute of a field.

Checklists

A multiple editor shows a choice of its own for each selected item, which grows as the selection grows. With the new checkList option, it keeps its results in a list instead:

[DisplayName("Shippers"), LookupEditor(typeof(ShipperRow), CheckList = true)]
public List<int> Shippers { get; set; }
  • Each result has a check box, and a result that is selected stays in the list, so a click unchecks it instead of opening it again.
  • The first item selects all the results that are shown, or clears them when they are all selected. Its text says what it acts on: Select all, Select all matching while something is typed, and Select shown for a source whose results come in pages, e.g. a list service. SelectAll = false leaves the item out, and a checklist of an asynchronous source leaves it out on its own.
  • The selection is a single summary in place of a choice for each item: Beverages, Condiments, Confections (3). MaxSummaryItems decides how many names it gives: unset names them all, with the count of the selection after them, and the styles cut what does not fit; a positive number names that many and counts the rest, e.g. Beverages, Condiments +2; zero names none of them, e.g. 3 selected.
  • PlaceholderIcon gives the empty control the icon of its field or of its filter, e.g. fa fa-truck. CheckList implies the multiple option, as neither a checklist nor a delimited value means anything without it, and an editor with checkList on a property that cannot hold more than one value, e.g. a single enum, is reported as an error when the property items are built.

The empty item of these editors, i.e. the placeholder of a select, no longer has a text by default, so an editor looks like a regular select, which shows only the icon of its placeholder. A site that prefers the earlier --select-- text sets it once, and a text that is not one of the framework's own texts can be a local text:

ComboboxEditor.defaults.emptyItemText = () => SelectEditorTexts.EmptyItemText;

The Combobox Styles sample of Advanced Samples / UI Elements / Editors tries the options of the three editors, one by one and in a playground that rebuilds an editor from the options that are picked, with the code they amount to, on the client and on the attribute of a field.

A lookup editor as a checklist, with Select all and a summary of the checked items

Items on the Attribute

A field can give the items of a select editor with SelectItem attributes, so it neither needs an editor of its own nor an item list in code:

[DisplayName("Priority")]
[SelectItem("low", Text = "Low", TextKey = "Controls.Priority.Low", Icon = "fa fa-angle-down", Order = 1)]
[SelectItem("high", Text = "High", TextKey = "Controls.Priority.High", Icon = "fa fa-angle-up", Order = 2)]
public string Priority { get; set; }

The items imply the editor, as a checklist implies a multiple one, and SelectEditor is only needed to declare the editor without items. An item has a Value, a Text, a TextKey, an Icon and a CssClass, and the items keep the order of their Order, as the order of the attributes of a property is not guaranteed. An item with a text but no key of its own takes the key its form implies for it, e.g. Forms.….Priority_SelectItem_low, which is registered with the text as its default, so the items can be translated without a change to the form. An item that should not be translated, e.g. one whose text is the name of a company, gives LocalText.Literal as its TextKey, which is an empty key, and leaves the text as it is:

[SelectItem("acme", Text = "Acme Corporation", TextKey = LocalText.Literal)]

An empty TextKey means "not a local text key" for every attribute that takes one, not only for the items of a select editor. The text is shown as it is, and it is neither used as a key nor registered under the key that its type implies for it, e.g. Forms.….Field for a display text or …_Placeholder for a placeholder:

[DisplayText("Acme Corporation", TextKey = LocalText.Literal)]
[Placeholder("Choose a company", TextKey = LocalText.Literal)]
public string CompanyName { get; set; }

Leaving the key out is different: the text then takes the implied key, so it can be translated without a change to the code, e.g. Forms.….CompanyName. Before, an empty key fell back to the implied one, so there was no way to keep a text out of the local texts; an empty key is now what opts out. As the attributes are the only place a key can be set, an empty one is always deliberate. A member of an enum, a StringEnum included, follows the same rule: the client gets the key that the member declares, or its literal text, along with the enum. That also fixes a member with a key of its own, which used to be registered but never read, since the client only knew the key that the enum implies. A property with another editor, or two items with the same value, is reported as an error instead of being ignored.

An item is localized or brought a CSS class only when the editor is told where they are, with the new textKeyField and cssClassField options, which a lookup script and the attributes of the lookup editors give as well, next to iconField. This keeps the texts of a lookup or a list service as they are, as they are data, and may look like keys:

new SelectEditor({ items, textKeyField: "textKey", cssClassField: "cssClass" });

An item with a CssClass of text-danger is shown in red in the results, e.g. for a severity. A service lookup infers the three fields from its item type or its row, from properties or fields named IconClass or Icon, TextKey or LocalTextKey, and CssClass, CssClasses or CssClassName, unless the attribute gives them.

The Select Items sample of Advanced Samples / UI Elements / Editors shows the items of a field with their keys, icons and classes, and the same editors in a form.

Items That Depend on Another Field

Two additions make it easy to drive the items of an editor from the value of another field:

  • SelectEditor.setItems(items) replaces the items of a select editor. It keeps the value while it is one of the new items, and clears it otherwise.
  • The new itemFilter option of ComboboxEditor narrows the items an editor offers, e.g. the fallback languages that would not make a loop. The value of the editor still shows when it does not pass the filter, as only the offered items are filtered. It applies to editors with their items in place, such as a select or lookup editor, not to ones that search on the server.
const fallback = new SelectEditor({ items: languages, itemFilter: item => item.id !== this.languageId });

A service lookup also loads the page size it is given now: it used to ask its endpoint for 100 rows whatever pageSize said, as the option never reached the combobox, and ServiceLookupEditorBaseAttribute.PageSize is an int instead of an int?, since the value an attribute gave could never be set on a nullable property and never reach the editor (breaking, see below).

Record Views

A property can now bring a view of its own record with it: a client side component that shows something about the record, e.g. the details of the customer of an order. The view is declared with an attribute on the property, and the grid opens it where the view says:

[DisplayName("Customer"), CustomerHoverCard, CustomerCompanyName]
public string CustomerCompanyName { get; set; }

CustomerHoverCard is the attribute that CustomerHoverCard.tsx generates for its class, with the options of the view as properties, so a project declares its views as attributes without writing any server side code. A property may have more than one view.

A view is shown:

  • On the value of the property (Placement = RecordViewPlacement.Trigger, the default), in a popup that opens when the value is hovered, focused with the keyboard, or long pressed on a touch screen. This is what a hover card is: HoverCard, the base class of the views of the sample, draws an avatar with the initials of the record in a color derived from its key, a title, a subtitle and a row of figures, e.g. the number of orders, the revenue and the last order date of a customer. The figures come from a service, since a plain retrieve cannot aggregate them, see NorthwindCardsEndpoint.

  • As the card of each row (Placement = RecordViewPlacement.Card, on a columns class), which is how a grid shows a list of cards on a narrow screen instead of its table:

    [ColumnsScript("NorthwindPro.Product")]
    [ProProductCardView(Below = "md", Default = true, SwitchPlacement = CardViewSwitchPlacement.Filters)]
    public class ProProductColumns
    {
        // ...
    }
    

    Below follows the width of the screen, a Bootstrap breakpoint ("sm", "md", "lg", "xl", "xxl") or a width in pixels, until the user chooses a view, which they keep. Without it, Default decides the view a grid opens with. HideSwitch hides the buttons that switch between the views, so the grid only follows the width, or keeps the default view.

The buttons that switch between the views sit as close to the table as the grid allows by default: at the end of the bar of its quick filters, else of its toolbar, else in the title bar. SwitchPlacement (Closest, Title, Filters, Toolbar) puts them in a part of the grid of your choice, and a grid that lacks that part puts them in the closest one it has. They open a menu of the views, with an Automatic entry that returns to following the width of the screen.

SleekGrid now measures the width of the viewport before it adjusts the limits of the columns pinned to the end, so a grid that hides them in a card view gets them back with its table, and it no longer throws when a view without a footer column updates the grand totals of the grid.

The views travel with the property items (PropertyItem.RecordViews) and with the columns scripts (PropertyItemsData.RecordViews, also in the compact scripts), so a grid class or an auto-registering mixin can find them. In StartSharp, GridRecordViewsMixin registers itself for a grid whose columns have a trigger view, wraps the formatter of the column, adds the id field of the view to the fields it loads, and opens the view; CardViewMixin does the same for a card view on a columns class, so a page neither creates the mixins nor lists the card fields in getIncludeColumns. A click elsewhere, a scroll, Escape or a resize closes the popup, which a screen reader reads as a tooltip.

The Northwind Pro samples of Advanced Samples use the views: the customer, employee and supplier columns of the orders grid open hover cards, and the products grid opens as cards on a narrow screen.

A hover card of the customer of an order in the orders grid

Selecting Rows With Check Boxes

A columns class can declare the column of the check boxes that select the rows, with [RowSelectionColumn] on a RowSelection property:

[RowSelectionColumn, PinToStart]
public string RowSelection { get; set; }

The client turns it into the column of GridRowSelectionMixin, and the grid creates the mixin itself, so a page no longer adds the column in createColumns() nor creates the mixin. The property must be named RowSelection, which the attribute checks, and the column keeps the __select__ id, so the grids that create it in code keep working with their saved column settings. isRowSelectionColumn() tells that column apart, e.g. for the column picker or an export that leaves it out.

The mixin also tells others about its selection: getSelectionState() returns the checked keys, how many of them are on the shown page, and how many rows of the page can be checked, and onSelectionChanged (a PubSub) is notified after every change, so a bar or a toolbar can enable and disable its buttons. GridRowSelectionMixin.tryGetInstance(grid) finds the mixin of a grid, and a widget can refer to the column through GridRowSelectionMixin.selectColumnId, without holding a reference to the mixin.

In StartSharp, a grid that has the check boxes shows the new CheckedRowActionsBar below its rows while some are checked. It tells how many are checked, has a button that clears them, and offers the actions of the grid, which a grid class gives by overriding autoRegisteringPlugin:

protected override autoRegisteringPlugin(args: AutoRegisterArgs<CheckedRowActionsBarOptions>) {
    super.autoRegisteringPlugin(args);
    if (args.pluginType !== CheckedRowActionsBar)
        return;

    args.options.actions = [{
        title: "Mark as shipped",
        icon: "fa-truck",
        kind: "primary",
        action: "mark-shipped",
        onClick: () => this.markShipped()
    }];
}

The site turns the bar on with CheckedRowActionsBar.enableAutoRegister, see the upgrade steps below.

A Menu of Actions in Each Row (StartSharp)

The new RowActionsMixin of Pro.Extensions gives each row of a grid a menu of actions, e.g. to open, ship or delete an order, instead of a column of icons per action or an inline dropdown. Each row gets a ⋯ button in a column of its own, which opens the menu of the row. There is a single menu, filled for the row when it opens, so the rows only hold a light button, and the menu is not clipped by the grid.

The menu of actions of a row in the Northwind orders grid

A grid class gives the actions in its autoRegisteringPlugin method, as it does for the bar of the checked rows:

protected override autoRegisteringPlugin(args: AutoRegisterArgs<any>) {
    super.autoRegisteringPlugin(args);
    if (args.pluginType !== RowActionsMixin)
        return;

    (args.options as RowActionsMixinOptions<OrderRow>).actions = [{
        title: "Open",
        icon: "fa-pencil",
        onClick: order => this.editItem(order.OrderID)
    }, {
        title: "Mark as shipped",
        icon: "fa-truck",
        visible: order => !order.ShippedDate,
        onClick: order => this.markShipped(order.OrderID)
    }, {
        title: "Delete…",
        icon: "fa-trash-o",
        kind: "danger",
        separator: true,
        onClick: order => this.deleteOrder(order.OrderID)
    }];
}

An action can also be disabled(item) for a row, have a hint, or a title that depends on the row, and getActions(item) returns the actions of a row for a menu that changes by the row. A page can also create the mixin itself, with new RowActionsMixin({ grid, actions }).

The menu opens:

  • with the ⋯ button of the row,
  • with a right click on the row, at the pointer (contextMenu). The menu of the browser is still shown on links, e.g. the edit links, on inputs and on selected text, and when Shift is held, e.g. to inspect the page,
  • with Shift+F10 or the context menu key on the active row (keyboard), e.g. after moving the row cursor to it,
  • with a long press on a touch screen (longPress, off by default), for the browsers that have no context menu on touch, like Safari on iOS.

The ⋯ buttons are always shown on a touch screen, and on hover, on the active row and while focused on the others (buttonVisibility: auto, always or hover). The icon of the button and its accessible label, which is "Actions for " by default, can be set as well. The menu has the keyboard of a menu: Up, Down, Home and End move between the items, Enter chooses one, and Escape closes it and gives the focus back to the button.

The defaults of the options are in RowActionsMixin.defaults, so that a site can change them for all its grids in its script init, e.g. to keep the menu of the browser on a right click:

RowActionsMixin.defaults.contextMenu = false;

The column of the buttons is added at the end of the grid and pinned there, or at the start with position: "start". To put it somewhere else, place it yourself, and the mixin uses it where it is: with RowActionsMixin.createActionsColumn() in createColumns, or in a columns class with the new RowActionsColumn attribute, on a property named RowActions:

[RowActionsColumn, PinToEnd]
public object RowActions { get; set; }

The column has the __actions__ id of a utility column, so the exports leave it out, and the column picker and the column header menu do not let it be hidden, though it can be pinned and moved like any column. The columns of the check boxes and of the radio buttons could be hidden in the column picker before, which is fixed too. Set column: false for a grid whose rows have no buttons, where the menu is only opened with a right click, a long press or the keyboard.

The menu itself is a GridPopupMenu, which is exported for other menus that pop up over a grid. The Actions Dropdown sample of Advanced Samples, and the Northwind orders of StartSharp, use the mixin.

Pinned Columns

A few changes make a grid with pinned columns, e.g. the column of the row actions, look like one table instead of separate panes:

  • The vertical scrollbar is at the far end of the grid. In a grid with columns pinned to the end, it used to sit between them and the scrolling columns. Now the pane of the pinned columns has it, after them, and the main pane reaches under it, so its own scrollbar is covered. The new endPaneScrollbar option of SleekGrid (on by default) turns it off, and the container of the grid gets the sg-vbar-end class while it applies. It does not apply to a grid with autoHeight.
  • The rows fill the width of the grid. When the columns are narrower than the grid, the rows used to end after the last column, leaving an empty band without lines before the pinned columns or the end of the grid. Now an empty slick-cell sg-fill cell fills the rest of each row, so the lines, the stripes and the fills of the row, e.g. hover and checked, reach across. It belongs to no column, so the grid leaves it out of the cells of the row; code that counts the .slick-cell elements of a row should leave it out too, with .slick-cell:not(.sg-fill). The new fillRows option (on by default) turns it off.
  • Shadows instead of dotted lines. The panes of the pinned columns cast a soft shadow over the columns that are scrolled under them, instead of the dotted line of before, and have no line at rest. The grid tells when there is something under them with the new sg-scrolled-start and sg-scrolled-end classes of its container. The --s-pinned-border, --s-pinned-border-style and --s-pinned-shadow tokens change them, e.g. --s-pinned-border-style: solid draws a line, dotted brings back the earlier look, and --s-pinned-shadow: transparent turns the shadow off.

If your site CSS sets the width or the margins of .slick-viewport.sg-end or .slick-viewport.sg-main, check the result: the end pane is now wider by the width of the scrollbar, and the main pane reaches under it.

Dialogs That Keep Their Place

A Bootstrap modal is centered by default, so it moves up and down whenever its content grows or shrinks, e.g. when an option shows more fields. Two changes let a dialog keep its place:

  • A modal that is not centered (centered: false in its dialog options) now starts at --s-modal-top (max(1.75rem, 8dvh)) instead of the top edge of the viewport, and grows downwards as its content grows. With scrollable: true, its body scrolls once it reaches the bottom of the viewport.
  • The new height option ("auto", "md", "lg" or "full") of DialogOptions gives a modal a fixed height, so it keeps its size as well, and its body scrolls. The heights come from the --s-modal-height-md (40rem) and --s-modal-height-lg (48rem) tokens and are capped to the viewport.
protected override getDialogOptions() {
    const opt = super.getDialogOptions();
    opt.centered = false;
    opt.scrollable = true;
    return opt;
}

Like the other dialog options, these can be set for all dialogs in Dialog.defaults, e.g. Dialog.defaults.centered = false. The scrollable option itself is fixed too: it used to add a modal-scrollable class, which does not exist in Bootstrap, instead of modal-dialog-scrollable. These options are for the Bootstrap modals; jQuery UI dialogs are not affected.

A panel, i.e. a dialog that takes the place of the content of the page instead of opening over it, as dialogs do on a phone, keeps the place of the user as well. It used to open scrolled down as far as the list that opened it was. Now the panel is scrolled into view when it opens, landing at the top of the page unless it starts below the first screen, and the scroll position of the page, saved before the content is hidden and the page gets shorter, is restored when it closes, so the user returns to the row that opened it. For that, a page that was scrolled sets history.scrollRestoration to manual on its history entry when the panel opens, as the router may add a history entry for the panel, and going back from it would otherwise restore the page as it was with its content hidden.

Northwind Orders With Pro Features (StartSharp)

Advanced Samples extends the order page of the Northwind sample at its usual address and menu item, to show what the features above add to an ordinary entity grid. It has a row cursor, the column of check boxes, and a bar for the checked orders with two actions:

  • Mark as shipped ships up to five orders right away, and opens the bulk edit dialog for more, to pick the date and the shipper.
  • Edit… opens a dialog that changes the shipper, the employee, the required date and the shipping state of the checked orders at once. It shows a preview from the server of the orders that would change, and of the ones that would be skipped, e.g. a shipped date before the order date, and saves each order through the save handler of the order, so the validation, permissions and audit log apply as usual.

The notification after a bulk update has an Undo button, which restores the previous values of the orders that have not changed again since.

The Northwind orders grid with check boxes, the bar of the checked orders and the status pills

The bulk edit dialog of the checked orders, with the preview of the changes

Each row has a menu of actions (open, mark as shipped, the invoice as a PDF, which replaces the column of its icon, copy link and delete), which a right click and a long press on the row open too, see A Menu of Actions in Each Row.

The columns of the grid tell the state of an order at a glance: a status pill (Not shipped, Late · 3d, Shipped, Shipped late) worked out from the shipped and required dates, the total of the order, dates without the year in the current one ("17 Nov"), and the time left to the required date of an order that is not shipped ("in 25 days", "Tomorrow", "3 days late"), marked when it is close or late. The total is a new Total field of the Northwind OrderRow, the sum of the order details from a grouped join, so it can be sorted, filtered and summed.

More Northwind Pages

Advanced Samples also replaces the customer, supplier, shipper, category, region and territory pages of Northwind at their usual addresses with pages that go beyond an entity grid:

  • Customers and Suppliers show a list of cards, or a table, beside the details of the selected record, in tabs: the overview, orders and notes of a customer, with a chart of its monthly revenue, and the products and performance of a supplier. The figures of the customer cards come from one grouped request for all the cards on the screen. On a narrow screen, the list and the details take turns.
  • Shippers have a card per carrier and a chart that compares them over the last six months, by freight and on-time rate, and the details of a carrier list its top destinations and its recent, late and open shipments.
  • Categories show the share of each category in the sales, with the products and the top customers of the selected one, for a period that can be switched.
  • Regions have a card for each region with its status against last year and a tile map of the states of its territories, and Territories group the territories by region, with their sales and orders, and assign or remove their reps.

The customers page with the cards on the left and the details of the selected customer

The regions page with the tile map of the states of a region

The shippers page comparing the carriers

The selected record is kept in the address, so the Back button returns to the list and a link can open a record, and refreshing a page with #edit/ALFKI opens the dialog of that record (see Page Routes). The pages are built from the PageKit components of Pro.Extensions (Card, StatList, MiniChart, Badge, Meter, formatters such as formatMoney, and DetailRoute), and their tables from the new ClientGrid, a grid for rows that the page already has, with sorting, filtering, quick search, responsive columns, empty states and a card style. Their controllers declare their layout with attributes derived from ModulePageLayout instead of the SampleGridPage / SamplePanelPage helper methods of the previous version, see Module Page Layouts.

The country flags come from a new emoji-flag class with per-country modifiers such as emoji-flag-us, which draws the flag from a ::before pseudo-element with the regional indicator pair of the country, for the widgets that take only a CSS class instead of markup, e.g. the icons of combobox items. The samples share the styles of their pages through unicode-emoji.css and the page CSS instead of copies.

Localized Month and Day Names

ScriptCulture, which the layout renders for the client, now also has the names of the months and days, the AM / PM designators, the time separator and the first day of the week of the current culture, from .NET's culture data. So formatDate writes localized names for the MMM, MMMM, ddd and dddd tokens, e.g. "17 Kas" in Turkish, instead of always the English ones, and Culture.firstDayOfWeek follows the culture. In StartSharp, this makes the This Week and Last Week ranges of the date range editor start on Monday in the cultures whose week starts on Monday.

In some languages, e.g. Polish, Russian or Greek, a month name takes another form next to a day number: "17 listopada", but "listopad 2026". The server sends these genitive names too, only for the cultures that have them, and formatDate uses them when its format has a day number (d or dd), like .NET does.

No change in the templates is needed, as _LayoutHead.cshtml already renders new ScriptCulture().

Structured Reports

A report could give its data for an Excel export, or have a design of its own for the page and the PDF. A structured report gives its result once, and the result is shown in a page, exported to Excel with a sheet for each table, to CSV with its main table, and to PDF (StartSharp), without a separate design for each:

[Report("Northwind.SalesByCategory"), CategoryName("Northwind/Sales"), DisplayText("Sales by category")]
[RequiredPermission(PermissionKeys.General)]
public class SalesByCategoryReport : IStructuredReport
{
    public object? GetData() => null;

    public async Task<StructuredReportResult> GetResultAsync(CancellationToken cancellationToken = default)
    {
        ...
        return new StructuredReportResult
        {
            Kpis = [new StructuredKpi { Label = "Revenue", Value = revenue, Kind = ReportValueKind.Money }],
            Chart = new StructuredChart { Type = StructuredChartType.Bars, Labels = names, Series = [...] },
            Tables = [new StructuredTable { Key = "categories", Title = "Categories", Columns = columns, Rows = items }]
        };
    }
}
  • A result has Kpis, an optional Chart (Columns, Bars, Line, Donut, Map or Segments), Tables and an EmptyText.
  • The new ReportColumnOptions attribute on a property of the rows tells how a column is shown and exported: its kind (Integer, Number, Money, Percent, Date, DateTime or Text), a Total (Sum or Average) for the totals row, a Link with placeholders such as ~/Northwind/Category#view/{CategoryID}, and a Tone.
  • [assembly: ReportCategory("Northwind/Sales", Title = ..., Description = ..., IconClass = ..., Order = ...)] describes a category of reports, and DescriptionText on a report class describes the report, for a page that lists the reports by category.
  • The report toolbar has a CSV button. Structured reports offer Excel and CSV, while the print and PDF buttons stay with the reports that have a design.

In StartSharp, services.AddStructuredReports() registers the renderers, and the ReportsPage of Pro.Extensions lists the reports by category, with favorites and recently run ones, and runs them in place: the parameters, KPIs, chart and tables of a report, which prints without the rest of the site. The PDF of a structured report is made by Puppeteer from a print page, which is requested through the pipeline of the application in memory, as the current user, so it needs neither the address of the site nor a cookie of the user. The browser is kept open between PDFs and closed when idle (PuppeteerHtmlToPdf:KeepBrowserOpen), so a PDF takes less than a second once it is warm. The Reports page of the Northwind samples in Advanced Samples has thirteen structured reports, from sales by period to the products to reorder.

The reports page listing the reports by category, with favorites

A structured report run in place, with its KPIs, chart and table

Rendering Asynchronously

Making a PDF drives a browser, which should neither block a request thread nor go on after the user leaves. IReportRenderer.RenderAsync, IReport.GetDataAsync, IHtmlToPdfConverter.ConvertAsync and IReportCallbackInterceptor.InterceptCallbackAsync are added next to the synchronous methods, with default implementations that call them, so existing implementations keep working. ReportController calls the asynchronous ones and passes RequestAborted, so a PDF that takes long is cancelled with the request. The names of the generated files now include the minutes and seconds (yyyyMMdd_HHmmss).

Page Routes

A page that is not a grid, e.g. a list of cards beside the details of the selected one, can keep its own state in the address with registerPageRoute. It owns the first segment of the hash, e.g. #view/12, and is told when it changes, while the dialogs keep their routes after it (#view/12/+/!1). The .route-handler element of a page, e.g. its entity grid, only gets the routes of the dialogs, as before.

A dialog that the user opens now adds an entry to the history of the browser, which closing it goes back to, so it leaves nothing behind for the Back button. The router tells the changes of the hash it makes itself apart from the user's, instead of ignoring the ones that follow it for a while.

panelPageInit now resolves the route of the address when the page is loaded, if the panel has a route handler, so refreshing #edit/ALFKI on a page that hosts an entity grid in a panel opens the dialog of that record again.

Module Page Layouts

The new ModulePageLayout attribute declares the layout of the pages of a controller, i.e. the ones it creates with GridPage, PanelPage or ModulePage, in one place:

[ModulePageLayout("~/Views/Shared/_LayoutNoNavigation.cshtml")]
public class ReportsPageController : Controller
{
    [Route("Reports")]
    public ActionResult Index() => this.GridPage<...>(...);
}

ModulePageExtensions reads the attribute from the controller type, including from a base class of it, and applies it only when the page model has no layout, so a layout a page sets itself still wins. A page that is not based on a view file, e.g. a panel page created from a module script only, has no other way to tell its layout. A project can derive an attribute that passes a layout of its own, as the samples do with [AdvancedSamplesLayout] and [ProNorthwindLayout], which replaced the SampleGridPage / SamplePanelPage helper methods of the previous version, and with [BasicSamplesLayout] of the basic samples.

Quick Filter Bar

  • Filters button. When a quick filter bar is narrower than QuickFilterBar.defaults.collapseWidth (768px), the filters that are not pinned collapse behind a Filters button at its start, which tells how many of them are applied and opens them one per row, so they stay usable on a phone. Pinned on QuickFilter attributes keeps the one or two filters that are used the most in sight. Filters with the hidden-xs class are collapsed instead of hidden, so they can still be reached.
  • Clear button. The bar shows a Clear button after its last filter while any filter is applied, which clears them all and reloads the grid once.
  • A single date. The new Range property of QuickFilter attributes makes the filter of a date column edit a single date, e.g. the orders of a day, instead of a range. When it is not set, the column keeps its range editor.
  • Defaults. QuickFilterBar.defaults has clearButton, dateRangeFilter, created and filterAdded, to change the bars and the filters of date columns of a whole site.
  • Checklists in a quick filter size their dropdown to fit the names of their items (dropdownAutoWidth), instead of wrapping them under their check boxes.

In StartSharp, the new quickfilters-init.ts of the template turns on two features of Pro.Extensions:

QuickFilterInlineLabels.enable();
QuickFilterBar.defaults.dateRangeFilter = DateRangeEditor.quickFilter;

QuickFilterInlineLabels shows the label of a filter inside its control, e.g. "Category: Beverages", which saves the row of the labels. DateRangeEditor.quickFilter edits the range of a date column in one input, along with named ranges such as This Month that follow the current date. The date range editor also has a clear button.

A quick filter bar collapsed behind the Filters button on a narrow screen

Quick filters with inline labels and the date range filter open

Base Language

The texts in the code of an application, e.g. its display names, were taken as English. They can now be in another language, which the new Localization settings name:

"Localization": {
  "BaseLanguage": "tr",
  "DefaultLanguage": null
}
  • BaseLanguage (en by default) is the language of the invariant texts, and the language that every other one falls back to last. Texts added for it, e.g. from site.texts.tr.json, are stored as invariant ones.
  • DefaultLanguage is the language of a user who has not picked one and whose browser asks for none of the languages of the site, and when it is not set, the base language.
  • The new LocalTextLanguage assembly attribute tells the language that the texts in the code of an assembly are written in, e.g. [assembly: LocalTextLanguage("en")]. The texts of an assembly in another language than the base one go to that language, which the invariant texts fall back to. So the English texts of Serenity and its features still show when the base language of an application is Turkish. The Serenity packages and features declare en, a project can set the LocalTextLanguage MSBuild property to stamp its own, and an assembly without the attribute is taken to be in the base language, as before.

Languages Page (StartSharp)

The Languages page lists the languages of the site with how much of each is translated, the date of the last change, the language it falls back to and the formats of its culture, and opens the translations of a language. A preview shows a sample page in the selected language, marking the texts that come from a fallback language.

The languages page with the translated share of each language and the preview of a sample page

The language table has three new columns: IsEnabled, to turn a language off without deleting it, FallbackLanguageId, e.g. Spanish for Portuguese, and Culture, the culture of the numbers and dates in the language, e.g. en-GB for English. A fallback is checked before it is saved, e.g. that it does not make a loop, and the texts are reloaded when a language or its fallback changes.

The language of a request comes from SiteCultureProvider of Pro.Extensions, which replaces the UserCultureProvider of the template. It takes the first enabled language from the language cookie, then the languages of the browser, then DefaultLanguage and BaseLanguage. The texts are in the language (CurrentUICulture) and the numbers and dates in its culture (CurrentCulture). The language menu leaves out the languages that are off.

services.AddSiteLanguages<AppServices.SiteLanguages>();
services.AddSiteLocalization(Configuration);

AppServices.SiteLanguages reads the language table. An application without one can register a fixed list instead, or an ISiteLanguages of its own:

services.AddSingleton<ISiteLanguages>(new StaticSiteLanguages(new("en"), new("de"), new("tr", Culture: "tr-TR")));

Translations Page (StartSharp)

The Translations page replaces the grid of translations. It shows the source and target texts side by side and edits them in place, and the changes stay unsaved until they are saved one by one or all at once. Enter or Tab goes to the next untranslated text, Ctrl+Enter saves the row and Esc reverts it.

The translations page editing German texts side by side with English

  • Filters for all, untranslated, translated, changed, custom and issue texts, a search over keys and texts, namespace chips, an assembly filter and pages.
  • A translation whose placeholders, e.g. {0}, differ from its source text is flagged.
  • A translation that the site has changed shows as custom, and can be reset to the built-in one, which the new BuiltInText of TranslationItem gives.
  • Export to JSON of the custom translations, like the user.texts file, or of all saved ones. Import from a JSON file shows what it would change, and applies it as unsaved changes to review before saving.
  • With AI translation on, a row or all untranslated texts can be translated. The Translation settings take extra Headers for a provider, and the x-opencode-session header that opencode.ai endpoints need is added for them. The client learns whether AI translation is on from the new AITranslation remote data script instead of a meta tag in the layout.
  • The base language is listed once, as e.g. English (base).
  • A save listed the texts without the target language, so the saved translations were compared with the custom texts of another language; the update handler of Pro.Extensions, and the TranslationRepository of Serene, now pass the target language.

Text Key Constants and JSON Texts

The new textkeys (te) command of sergen writes TextKeys.g.cs, a constant for each local text key of a project, so code can use the keys without string literals. The generated files now add global using ESM = ... and global using TextKeys = ... themselves, instead of the ESM alias in the project file.

json-texts (LocalTextJsonGenerator of the templates) rebuilds the *.texts.__.json template of a project from the texts in its assembly and updates its language files: it keeps the translations, resets the ones whose placeholders no longer match, keeps the translations of renamed keys, and writes the out of date ones to *.texts.__.stale.json for the translators.

A compact property items script with no items no longer writes an empty var ; statement, and dtsbundler renames symbols that collide with a number suffix (texts2, texts3) instead of appending the number again for each conflict (texts22), which the per-file local texts make it do more often. A change in the @serenity-is/tsbuild package of the workspace root, which the feature projects resolve it from, triggers their TypeScript build too.

Less for Anonymous Visitors to See

A visitor who has not logged in, e.g. an automated scanner, could learn a lot about an application from the login page alone: the names of the fields of every form and grid from the form and columns scripts, the pages and service addresses of the application from the ES modules under /esm/, and the captions of every entity and permission from the local texts. None of this lets them read or change data, which the services and pages check, but it maps the application for them. This release adds settings that limit what is sent to users, logged in or not, to what they need. The StartSharp and Serene templates turn them on, while existing applications are not affected until they do.

Form and Columns Scripts

FormScript and ColumnsScript attributes have a Permission, and when PublicByDefault is false, the other form and columns scripts require the ReadPermission of their BasedOnRow row, so users only get the forms and grids of the entities they can read:

"PropertyItemsScripts": {
  "PublicByDefault": false
}

A row without a ReadPermission denies, as it does for its services, and so does a form or columns class without a BasedOnRow, unless it has a Permission of its own or FallbackPermission is set. The membership forms of the templates and the features declare theirs, e.g. the login form is [FormScript("Membership.Login", Permission = SpecialPermissionKeys.Public)].

Local Texts

When LocalTextPermissions is enabled, the texts of the Site package only include what the user needs: the captions of the rows they can read, the texts of the forms and grids they can access, the enums those use, and the permission names for PermissionTextsPermission:

"LocalTextPermissions": {
  "Enabled": true,
  "PermissionTextsPermission": "Administration:Security"
}

The texts of a [NestedLocalTexts] class go to users with its new Permission, e.g. [NestedLocalTexts(Prefix = "Site.WorkLog.", Permission = "?")], and an enum with a [RequiredPermission] or [ReadPermission] sends its texts only to users with it. AlwaysInclude lists text prefixes that are always sent, and Restrict maps prefixes to permissions for texts that no class declares. To filter only for anonymous users, set "UnfilteredPermission": "?". In StartSharp, the texts sent to anonymous users went from 2345 to 1412 keys.

The generated ServerTypes/Texts.ts used to put every text key into the login page, as esbuild can only split code by file. Each texts class is now generated in a file of its own (e.g. Administration/UserDialogTexts.ts, or ServerTypes/Texts/<Name>.ts), and the Db.<Module>. keys that no class covers go to <Module>/DbTexts.ts. With "TextsMode": "Remaining", which defaults@10.8.0 sets, Texts.ts only has the keys that no other file covers.

ES Modules

The ESM access control serves the files of the esm folders of the application and of the feature packages only to users who may load a page that needs them, and a 404 to the others:

"EsmAccessControl": {
  "Enabled": true
}

Anonymous users get the pages that match AnonymousPaths (Modules/Common/ScriptInit.js;Modules/Membership/**;bundles/** by default) and the chunks those pages use, and logged-in users get the rest (DefaultPermission, ? by default). To also limit logged-in users, map path patterns to permissions:

"EsmAccessControl": {
  "Enabled": true,
  "Permissions": {
    "Modules/Administration/**": "Administration:General"
  }
}

Keep in mind that a page may load modules of another page, e.g. to open the dialog of another entity, which then fails for users without the permission of that page.

tsbuild writes a build.esm-manifest file next to the modules, with the chunks each page uses, which the access control reads. Static files never serve it, as its extension is unknown. A folder without it, e.g. of a package built with an earlier version, is served as before.

LayoutScriptFile and LayoutCssFile attributes have a Permission too, so a layout file can be left out for users without it, and the ESM access control uses the permission of a layout module. It is ? for script files and * for CSS files by default, so set Permission = "*" for a layout script that anonymous pages need.

Library code that every page uses, e.g. the @serenity-is/* packages, is still public, as the login page needs it too.

Logins, Uploads and Files

  • services.AddAccountRateLimiter() limits the login, forgot and reset password, sign up and elevate requests per IP address, 20 per minute by default. The AccountRateLimit settings change the limits, also per path. Users behind the same proxy share an IP address, so make sure forwarded headers are configured if there is one.
  • The temporary uploads of the template FilePage accepted anonymous requests. They now require UploadSettings:TemporaryUploadPermission, which is ? by default. Set it to * if anonymous users must upload files, e.g. on a public sign-up form.
  • StartSharp sets FileReadAccess:DefaultPermission to ?, so uploaded files without a [FileReadAccess] attribute are no longer public. Files that anonymous pages show need [FileReadAccess("*")] on their field (StartSharp).
  • TwoFactorEndpointBase of StartSharp has [ServiceAuthorize], so every two-factor endpoint that derives from it demands a logged-in, authorized user. Before, the base type carried only [ScriptInclude], and the per-action routes of the two-factor services were reachable without the standard service authorization check (StartSharp).

Permission Expressions

The permission service of the templates (BasePermissionService) accepts logical expressions with !, &, | and parentheses wherever a permission is expected, e.g. [ReadPermission("Northwind:General|Administration:General")]. A malformed expression, e.g. "A|", throws an exception with the expression in its message.

Dashboards (Enterprise)

  • Table style. The table widget of a dashboard has a Table Style option, a multi-select of the new GridStyle flags (NoStripes, NoCellBorders, NoHeaderChrome, and Lines / Plain as shortcuts), so a table can look like a plain table inside a dashboard instead of the grid of the theme. The option says what to hide from the look of the theme's grid, so a theme that changes the grid is still followed, and changing it rebuilds the grid of the widget.
  • Theme changes. The widgets redraw themselves when the theme changes, e.g. when the user switches between light and dark: DashboardWidgetBase listens to the themechange event of the document and has a themeChanged hook for its subclasses, and the chart and number widgets replay the arguments they were drawn with, so the colors they read in script are rebuilt for the new scheme instead of keeping the colors of the previous theme until the page is reloaded.
  • Titles in the local texts. The local text source of the dashboards is registered even when another dynamic text source is, so the navigation titles of the dashboards no longer go missing depending on the order in which the sources were registered; it fills in only the titles a translator has not entered.
  • Sample dashboards. A sample dashboard can give a NavigationOrder, which the migration of the samples uses to place each dashboard next to the Northwind page it belongs to, the Northwind Customer Details dashboard stays out of the navigation, as it is empty until a customer is selected, and the dashboard, data source and dataset texts only go to logged-in users, see Local Texts.

Users, Preferences and Elevation

Two fixes for the applications that configure their own user ids, both reported by users:

  • User preferences. UserPreferenceRepository converted the identifier of the current user with Convert.ToInt32 and compared it with the UserId field, so preferences were neither saved nor found in an application whose user id is a Guid, a 64-bit integer or a string; the type of the field converts the identifier now. The repository also throws a NotLoggedIn validation error on an update when the user has no identifier, e.g. on an anonymous request, instead of saving a preference that no user owns, returns an empty response on a retrieve instead of querying the rows of no one, and has a virtual GetUserId() for a subclass that resolves the id in another way (see #7434).
  • Elevation. DefaultElevationHandler stored the identifier of the user in the elevation token with Convert.ToInt32, so elevation failed for the applications that configure Guid, 64-bit or string user ids with UserEntityOptions. The token stores the identifier as a string now; a token issued before the change no longer validates, which does not matter as it expires in 15 minutes (see #7435).

Smaller Fixes

  • setSelectionModel of SleekGrid clears the cells that the model it replaces marked as selected, and turning enableCellNavigation off with setOptions clears the active cell, so neither is left marked.
  • The action of the column filter in the column header menu is hidden for a column that can not be filtered, e.g. one without a field or a utility column, and the header filters never apply to the utility columns (StartSharp).
  • GridEditController unsubscribes from the key and validation events of the grid when it is destroyed, so a grid that outlives it no longer calls a destroyed controller, e.g. when inline editing is turned off (StartSharp).
  • A data view has a destroy() method that aborts its pending request, and DataGrid.destroy() calls it, so rows that arrive after a grid is destroyed no longer reach listeners that are gone, e.g. from a callback the grid had not assigned itself.
  • A cell's CSS class is read from ColumnMetadata.cssClass, the SleekGrid field, instead of the deprecated cssClasses, which is still read when the former is not set.

Upgrading to 10.8.0

Steps 2 to 8 change the theme related files of the StartSharp template: apply either all of them, or none. Without them, your current themes keep working as they did, but the new theme menu, the Carbon theme and the theme settings are not available, and a mix of old and new theme files is not supported. The other steps are independent of each other, and most of them apply to Serene as well, as the code involved is shared; a step that only concerns StartSharp says so.

  1. Update NuGet and npm packages to 10.8.0. StartSharp packages use the four-part 10.8.0.0 version, which shows as 10.8.0.

  2. Layouts. In Views/Shared/_Layout.cshtml and _LayoutNoNavigation.cshtml, replace the ProThemeSelection cookie code with Html.CurrentTheme():

    @{
        var theme = Html.CurrentTheme();
        ...
    }
    <html lang="..." class="pro @theme.CssClass..." data-bs-theme="@theme.Scheme"...>
    
  3. Layout head. In Views/Shared/_LayoutHead.cshtml, add @Html.ThemeScript() after @Html.LayoutCssFiles(). It writes the theme settings and the script that applies the "system" scheme before the page is drawn.

  4. Sidebar. In Views/Shared/_Sidebar.cshtml, remove the hard-coded theme items from the s-theme-selection-menu list, which is now filled by the script, and wrap the theme menu <li> in @if (Html.CurrentTheme().HasChoices) { ... }.

  5. Fonts. In Modules/Common/bundles/style.base.css, add the Carbon fonts:

    @import "@serenity-is/assets/fonts/inter/inter.css";
    @import "@serenity-is/assets/fonts/geist-mono/geist-mono.css";
    
  6. Site logo. In Modules/Common/bundles/style.site.css, replace the .s-site-logo-img rule with both logo versions, so each theme can pick one:

    :root {
      --s-logo-on-dark: url(@serenity-is/assets/logo/white-128.png);
      --s-logo-on-light: url(@serenity-is/assets/logo/blue-128.png);
    }
    
    .s-site-logo-img {
      content: var(--s-logo, var(--s-logo-on-dark));
    }
    

    If you use your own logo, set both variables to your images. They can be completely different pictures, not only recolored ones.

  7. Your theme CSS. The theme-azure-light, theme-cosmos-dark and theme-glassy-light classes are still added to the page, so CSS that targets them keeps working. When you touch such rules, prefer setting tokens on :root.theme-azure-light and :root.theme-cosmos-dark (the light and dark schemes of Azure) over component rules, as a rule that names a theme has to be repeated for every theme and scheme.

  8. Default theme. Users who have not chosen a theme now get Carbon instead of Azure. Users who chose one before keep it. To stay with Azure, set it in appsettings.json: "Theme": { "DefaultTheme": "azure" }.

  9. Checked row actions bar. In Modules/Common/script-init/autoregister-init.ts, import CheckedRowActionsBar from @serenity-is/pro.extensions and turn it on for the grids that select their rows, like the other mixins:

    CheckedRowActionsBar.enableAutoRegister(args => {
        shouldAutoRegister(args);
    });
    
  10. Row actions, card views and record views. In Modules/Common/script-init/autoregister-init.ts, import RowActionsMixin from @serenity-is/pro.extensions and turn it on, like the other mixins, so that the grid classes that give actions get their menus:

    RowActionsMixin.enableAutoRegister(args => {
        shouldAutoRegister(args);
    });
    

    Turn CardViewMixin and GridRecordViewsMixin on the same way, without a check, as they are only made for a grid that has a card view on its columns class or a column with a record view, including the grid editors:

    CardViewMixin.enableAutoRegister(_args => { });
    GridRecordViewsMixin.enableAutoRegister(_args => { });
    
  11. Hardening settings. In appsettings.json, turn on the settings of Less for Anonymous Visitors to See (StartSharp and Serene). Leave out FileReadAccess in Serene:

    "FileReadAccess": {
      "DefaultPermission": "?"
    },
    "EsmAccessControl": {
      "Enabled": true
    },
    "PropertyItemsScripts": {
      "PublicByDefault": false
    },
    "LocalTextPermissions": {
      "Enabled": true,
      "PermissionTextsPermission": "Administration:Security"
    },
    

    Then check your own forms and grids: a form or columns class whose BasedOnRow row has no ReadPermission, or that has no BasedOnRow, needs a Permission on its FormScript / ColumnsScript attribute, or users can no longer open it.

  12. Membership forms. Add Permission = SpecialPermissionKeys.Public to the FormScript attributes of Modules/Membership/Account/Login/LoginRequest.cs and SignUp/SignUpForm.cs, as they are based on the user row, which anonymous users can not read.

  13. Startup. In Initialization/Startup.cs, add the rate limiter after services.AddAntiforgery(...), and the ESM access control before UseStaticFiles (after app.UseExceptionLogger() in StartSharp):

    services.AddAccountRateLimiter();
    ...
    app.UseEsmAccessControl();
    ...
    app.UseRouting();
    app.UseRateLimiter();
    
  14. File page. In Modules/Common/File/FilePage.cs, check UploadSettings.TemporaryUploadPermission in TemporaryUpload and TemporaryUploadCK, see the FilePage of the template.

  15. Texts imports. sergen.json extends defaults@10.8.0, which sets "TextsMode": "Remaining". Import the texts classes from their module barrels (e.g. import { UserDialogTexts } from "../../ServerTypes/Administration") or from ServerTypes/Texts/<Name>, instead of from ServerTypes/Texts.

  16. ESM alias. In the .csproj of the web project, remove <Using Include="StartSharp.MVC.ESM" Alias="ESM" />, as the generated files now add the alias, and two of them do not compile.

  17. Base language. In appsettings.json, add the Localization section, and add Initialization/AssemblyTextLanguage.cs with [assembly: LocalTextLanguage("en")], or the language your texts in code are written in, see Base Language:

    "Localization": {
      "BaseLanguage": "en",
      "DefaultLanguage": null
    },
    
  18. Site languages (StartSharp). In Initialization/Startup.cs, replace the services.Configure<RequestLocalizationOptions>(...) block that inserts UserCultureProvider with the following, then delete Modules/Common/AppServices/UserCultureProvider.cs and add SiteLanguages.cs from the template:

    services.AddSiteLanguages<AppServices.SiteLanguages>();
    services.AddSiteLocalization(Configuration);
    
  19. Languages page (StartSharp). Add the DefaultDB_20261125_1815_LanguageSettings migration and the IsEnabled, FallbackLanguageId and Culture fields to LanguageRow, LanguageForm and LanguageColumns. Take LanguagePage.cs, LanguagePage.ts, LanguageSaveHandler.cs and LanguageDeleteHandler.cs from the template, and add the LanguageSummary and LanguagePreview actions to TranslationEndpoint.cs.

  20. Translations page (StartSharp). In Modules/Administration/Translation/TranslationPage.cs, return a PanelPage with baseLanguage from LocalizationSettings, and in TranslationPage.ts, use panelPageInit(TranslationsPage, options) and import @serenity-is/pro.extensions/pages/translations.css, see the template.

  21. AI translation (StartSharp). In Views/Shared/_LayoutHead.cshtml, remove the ai-translation-enabled meta tag, and in Modules/Common/script-init/languages-init.ts, turn the translate buttons on from the AITranslation remote data:

    getRemoteDataAsync<AITranslationScriptData>("AITranslation").then(data => {
        if (data?.Enabled)
            TranslationConfig.translateTexts = req => serviceRequest<TranslateTextResponse>("Administration/Translation/TranslateText", req);
    });
    
  22. Structured reports (StartSharp). In Initialization/Startup.cs, add .AddStructuredReports() after services.AddPuppeteerHtmlToPdf(). Optionally, set "PuppeteerHtmlToPdf": { "KeepBrowserOpen": false } in appsettings.Development.json, so the browser does not stay open while you debug.

  23. Quick filters and grouping (StartSharp). Add quickfilters-init.ts (see Quick Filter Bar) and grouping-init.ts, which shows the totals of a group on its header row (DataGrid.defaultOptions.displayTotalsRow = "groupheader"), to Modules/Common/script-init, and import both in its index.ts.

Breaking Changes

These apply even if you do not apply the template changes above:

  • Custom dynamic scripts. IDynamicScript.CheckRights() is replaced by bool HasPermission(IPermissionService permissions). A script based on DynamicScript only needs its Permission set. IDynamicScriptManager.CheckScriptRights is replaced by HasScriptPermission and GetScriptCacheSuffix, and ConcatenatedScript takes ConcatenatedScriptParts, or a list of functions as before. ICacheSuffix moved to Serenity.Net.Core, with the same namespace.
  • Custom permission services. BasePermissionService.HasPermission is no longer virtual. Override HasPermissionKey instead, which gets the single keys of an expression.
  • Layout script files. A LayoutScriptFile without a Permission is now only included for logged-in users. Set Permission = "*" for one that the login page needs.
  • Report controller. The Render and Download actions of ReportController return Task<ActionResult>. Code that calls them, e.g. a test, has to await them.
  • Grouped grids. GroupInfo.displayTotalsRow takes boolean | "groupheader" instead of a boolean, and the groupRowTotals option of GroupItemMetadataProvider is gone, replaced by displayTotalsRow on a grouping level. A grid that set groupRowTotals: false sets displayTotalsRow: false on its grouping levels, or DataGrid.defaultOptions.displayTotalsRow once.
  • Radio selection column. The column of GridRadioSelectionMixin has the __radio__ id instead of __select__, which it shared with the column of the check boxes, and its header is (o) instead of [×], so the two can be told apart in the column picker and in an export. A saved column setting with the old id, and code that finds the column by it, needs the new one; GridRadioSelectionMixin.radioColumnId gives it.
  • Service lookup page size. ServiceLookupEditorBaseAttribute.PageSize is an int instead of an int?. Code that reads it as a nullable one, or an assembly compiled against the old one, needs a rebuild.