Skip to content

New Summary plugin - #3296

Merged
texodus merged 4 commits into
masterfrom
summary-plugin
Nov 23, 2026
Merged

texodus merged 4 commits into
masterfrom
summary-plugin

Conversation

@texodus

@texodus texodus commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

This PR adds a new plugin Summary, hard-coded to group_rollup_mode: "total", which shows datagrid-like cells arranged in a flex-wrap grid of full-content sized text. In order to support this new plugin as well as future feature work, this PR also moves formatting to Rust (ICU4X, from native browser Intl), and shared plugin code to plugin_utils.

The Datagrid, Charts and the new Summary plugin used to each carry their own formatting and color code, built on Intl and copied between packages. That code is now owned by the viewer and exposed to plugins as plugin_utils, the element class's static, which also works inside the Charts worker.

  • Numbers and datetimes are formatted in Rust with ICU4X, in rust/perspective-viewer/src/rust/format/. Nothing in the viewer or the plugins formats values with Intl any more.
  • Plugins hold Formatter handles from plugin_utils.formatter(type, format?, defaults?). A whole column is formatted in one call with format_strings, so the Datagrid crosses into wasm once per column instead of once per cell.
  • To keep the wasm small, time zone offsets (from Temporal where the browser has it), zone names, currency symbols and unit names come from the browser. The baked-locale-data feature uses ICU4X's own data instead, for builds outside a browser.
  • The format/ module depends on nothing from wasm-bindgen, web-sys or Yew, so it can later become a separate crate usable from Python.
  • Native exports (Rust):
    • formatter, source_column;
    • colour parsing, as wrappers over the client's css.rs: parse_css_color, parse_css_gradient, parse_css_palette, css_gradient, css_palette;
    • has_date_format_shape, date_format_modifiers.
  • TypeScript, in the viewer bundle: format, color, column_style, theme_style, cell_style (including the pulse CSS) and schema.
Screenshot 2026-11-20 at 9 08 54 AM Screenshot 2026-11-21 at 2 23 46 PM

@texodus texodus added the enhancement Feature requests or improvements label Nov 20, 2026
@timkpaine

Copy link
Copy Markdown
Member
vince-mcmahon-excited

@texodus
texodus force-pushed the summary-plugin branch 2 times, most recently from 0671985 to c988de6 Compare November 21, 2026 03:24
Signed-off-by: Andrew Stein <steinlink@gmail.com>
Signed-off-by: Andrew Stein <steinlink@gmail.com>
Signed-off-by: Andrew Stein <steinlink@gmail.com>
Signed-off-by: Andrew Stein <steinlink@gmail.com>
@texodus
texodus merged commit b9ee91f into master Nov 23, 2026
2 checks passed
@texodus
texodus deleted the summary-plugin branch November 23, 2026 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Feature requests or improvements

Development

Successfully merging this pull request may close these issues.

2 participants