Skip to content

Palette & gradient style controls + new docs site - #3217

Merged
texodus merged 14 commits into
masterfrom
palette-x
Aug 25, 2026
Merged

Palette & gradient style controls + new docs site#3217
texodus merged 14 commits into
masterfrom
palette-x

Conversation

@texodus

@texodus texodus commented Aug 25, 2026

Copy link
Copy Markdown
Member

This PR adds two new declarative control types, Palette and GradientStops, replacing single-color and two-stop gradient pickers where plugins declare them.

A multi-stop gradient selector with draggable stops, double-click to insert a stop sampled from the gradient, and a discrete mode that pins exactly two stops (end colors locked, shown with a lock affordance). Loading a longer named gradient into a discrete control fits it to a two-stop pair.


Screenshot 2026-08-22 at 8 54 33 PM

A palette selector with swatch editing, one-click add (opens the native color picker on the new swatch), and pointer-drag reordering with a live preview of the resulting order.


Screenshot 2026-08-22 at 11 01 49 PM

User-selected colors, palettes, and gradients are persisted through the existing per-column config maps — no new top-level config fields per control:

  • Each value lives in columns_config under the plugin-declared key for that control (e.g. color, palette, gradient), keyed by column name — in the ViewerConfig emitted by a panel's save(), and per-panel inside WorkspaceConfig.panels from saveWorkspace(). These values' shape is defined by the active plugin's column_config_schema().
  • The wire format is a canonical CSS string: colors as #rrggbb, palettes as linear-gradient(to right, #rrggbb, …) (positions forbidden), and gradients as linear-gradient(to right, #rrggbb 0%, …).
  • Instead of a literal, a value may be a named-scale reference - var(--var-name) - pointing at a scale defined by the active theme's CSS, so a config can follow the theme rather than freeze literal colors.
  • Values that match the plugin's declared default (compared after canonicalization) are stripped on save, so configs carry only user deviations and un-styled columns keep tracking theme defaults across theme switches.
  • WorkspaceConfig additionally gains a top-level palette map - named color-scale definitions (--psp-user--<kind>-<name> -> canonical CSS value) shared by every panel.

New docs site. docs/ is rebuilt as a single-page demo application, and examples/blocks is deleted with its examples ported into the site's project corpus (~127 projects):

  • Multi-panel <perspective-viewer> stage with a sidebar, project gallery (modal + deep links via ?project=<id>), and a theme toggle.
  • A "Create Data Source" modal crossing source (Fetch / File / S3) with engine (perspective-server WASM / DuckDB-WASM), including an in-browser AWS SigV4 implementation so any S3-compatible store (AWS, R2, MinIO, …) works as a bucket browser with presigned-URL reads.
  • A DuckDB SQL drawer/REPL whose results open as viewer panels, and an agent configuration dialog over the viewer's agent API.
  • Streaming demos (market simulation on a fixed-size keyed ring, webcam) and a screenshot/collage build pipeline that generates gallery thumbnails and the README collage per theme.
  • New viewer events perspective-layout-update and perspective-active-panel-update, emitted once per settled batch of workspace mutations.

Fixes

  • Engine (C++)
    • sum aggregate no longer accumulates incorrectly when updates flip values to or from null (Fixes Handling null updates in sum aggregate #1256).
    • Expression validation no longer crashes on malformed ExprTk input (infinite loops and a buffer overflow in computed_expression.cpp).
    • column_paths / viewport off-by-one in view.cpp that corrupted region copy and windowed reads (Fixes region copy not working #3216).
  • Virtual servers: window/column handling fixes in the generic SQL model (table_make_view), applied across the JS and Python DuckDB and ClickHouse adapters.
  • Viewer
    • Partial-restore race between settings toggling and render tasks; restore({settings}) no longer poisons the settings flag.
    • Initial/default theme selection, settings-via-restore behavior, and missing stack frames in viewer error reports.
    • Column pin regression in panel presizing/snapshots.
  • Datagrid: bar and label-bar render glitch; profile-driven scrolling optimizations across the style-handler pipeline.
  • Charts: type-coercion bugs in candlestick, heatmap, series, and tick layout; rendering now composites on a worker thread via an extended renderer transport protocol.

@texodus texodus added the enhancement Feature requests or improvements label Aug 25, 2026
texodus added 12 commits August 25, 2026 00:08
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>
Signed-off-by: Andrew Stein <steinlink@gmail.com>
Signed-off-by: Andrew Stein <steinlink@gmail.com>
…g stack frames in viewer errors

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>
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 d7c56f0 into master Aug 25, 2026
6 of 7 checks passed
@texodus
texodus deleted the palette-x branch August 25, 2026 05:08
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.

region copy not working Handling null updates in sum aggregate

1 participant