mirror of
https://github.com/olehomelchenko/astrolabe.git
synced 2026-08-08 10:12:34 +00:00
Chart builder: data-aware defaults, one-click hint fixes, canvas preview, fullscreen modal
This commit is contained in:
@@ -42,6 +42,12 @@ export interface ModalConfig {
|
||||
getState?: () => Record<string, unknown> | null;
|
||||
/** Whether the modal is reflected in the URL hash (navigable). */
|
||||
isUrlNavigable?: boolean;
|
||||
/**
|
||||
* Whether a backdrop (click-outside) closes the modal. Defaults to `true`. Set
|
||||
* `false` for modals holding in-progress work an accidental click shouldn't
|
||||
* discard (the Chart Builder) — Escape and the close button still dismiss.
|
||||
*/
|
||||
dismissOnBackdrop?: boolean;
|
||||
}
|
||||
|
||||
export const MODAL_REGISTRY: Partial<Record<ModalName, ModalConfig>> = {
|
||||
@@ -71,11 +77,14 @@ export const MODAL_REGISTRY: Partial<Record<ModalName, ModalConfig>> = {
|
||||
// Opened from a selected dataset's "Build Chart" action; `arg` is its id. Loads
|
||||
// the dataset and pre-populates a smart default config (§06). Applies on Create
|
||||
// (a new snippet), so there is nothing transient to lose on close — no getState.
|
||||
// Backdrop dismissal is off: the config is real in-progress work, and a stray
|
||||
// click outside this large surface shouldn't throw it away (Escape/× still close).
|
||||
chartBuilder: {
|
||||
name: 'chartBuilder',
|
||||
title: 'Chart Builder',
|
||||
component: ChartBuilderModal,
|
||||
isUrlNavigable: true,
|
||||
dismissOnBackdrop: false,
|
||||
init: (datasetId) => useChartBuilderStore.getState().init(datasetId ? Number(datasetId) : null),
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user