[FEATURE] Add panel-level repeat variable support - #2
Conversation
b611f9c to
23fe7b8
Compare
9a6a842 to
b83e228
Compare
7891364 to
e32d1fe
Compare
05dc32e to
fe39dc3
Compare
Signed-off-by: Adrian Sepiół <a.sepiol@sap.com>
…tainer is narrower than combined gaps, and consolidate VariableDefinitionGroup to plugin-system model Signed-off-by: Adrian Sepiół <a.sepiol@sap.com>
…ndered panels per repeat variable Signed-off-by: Adrian Sepiół <a.sepiol@sap.com>
Signed-off-by: Adrian Sepiół <a.sepiol@sap.com>
fe39dc3 to
184c638
Compare
|
React Doctor found 20 new issues in 18 files · 20 warnings · score 72 / 100 (Needs work) · 1 fixed · vs 20 warnings
Reviewed by React Doctor for commit |
| import { PanelGroupId } from '@perses-dev/plugin-system'; | ||
| import { ReactElement } from 'react'; | ||
|
|
||
| import { DEFAULT_MARGIN } from '../../constants'; |
There was a problem hiding this comment.
React Doctor · react-doctor/no-barrel-import (warning)
This ships extra code to your users & slows page load. Import directly from "../../constants/grid-layout-config".
Fix → Import from the direct path: import { Button } from './components/Button' instead of ./components
| <VariableContext.Provider | ||
| key={`${repeatVariableName}-${value}`} | ||
| value={{ state: { ...variables, [repeatVariableName]: { value, loading: false } } }} | ||
| value={{ |
There was a problem hiding this comment.
React Doctor · react-doctor/jsx-no-constructed-context-values (warning)
Every reader of this context redraws on each render because you build its value inline.
Fix → Wrap the context value in useMemo or move it outside the component so consumers do not redraw every render.
| return ( | ||
| <VariableContext.Provider | ||
| key={`${repeatVariableName}-${value}`} | ||
| value={{ |
There was a problem hiding this comment.
React Doctor · react-doctor/jsx-no-constructed-context-values (warning)
Every reader of this context redraws on each render because you build its value inline.
Fix → Wrap the context value in useMemo or move it outside the component so consumers do not redraw every render.
| import { Layout, Layouts, Responsive, WidthProvider } from 'react-grid-layout'; | ||
|
|
||
| import { GRID_LAYOUT_COLS, GRID_LAYOUT_SMALL_BREAKPOINT } from '../../constants'; | ||
| import { DEFAULT_MARGIN, GRID_LAYOUT_COLS, GRID_LAYOUT_SMALL_BREAKPOINT, ROW_HEIGHT } from '../../constants'; |
There was a problem hiding this comment.
React Doctor · react-doctor/no-barrel-import (warning)
This ships extra code to your users & slows page load. Import directly from "../../constants/grid-layout-config".
Fix → Import from the direct path: import { Button } from './components/Button' instead of ./components
| import { Control } from 'react-hook-form'; | ||
| import { Control, useWatch } from 'react-hook-form'; | ||
|
|
||
| import { useListPanelGroups } from '../../context'; |
There was a problem hiding this comment.
React Doctor · react-doctor/no-barrel-import (warning)
This ships extra code to your users & slows page load. Import directly from "../../context/DashboardProvider/dashboard-provider-api".
Fix → Import from the direct path: import { Button } from './components/Button' instead of ./components
|
|
||
| import { PanelGroupItemId } from '../../model'; | ||
| import { generatePanelKey, insertPanelInLayout, UnpositionedPanelGroupItemLayout } from '../../utils/panelUtils'; | ||
| import { generatePanelKey, insertPanelInLayout, UnpositionedPanelGroupItemLayout } from '../../utils'; |
There was a problem hiding this comment.
React Doctor · react-doctor/no-barrel-import (warning)
This ships extra code to your users & slows page load. Import directly from "../../utils/panelUtils".
Fix → Import from the direct path: import { Button } from './components/Button' instead of ./components
| import { DEFAULT_MAX_PER_ROW, DEFAULT_REPEAT_ALIGNMENT, VariableStateMap } from '@perses-dev/plugin-system'; | ||
| import { Layout, Layouts } from 'react-grid-layout'; | ||
|
|
||
| import { DEFAULT_MARGIN, ROW_HEIGHT } from '../constants'; |
There was a problem hiding this comment.
React Doctor · react-doctor/no-barrel-import (warning)
This ships extra code to your users & slows page load. Import directly from "../constants/grid-layout-config".
Fix → Import from the direct path: import { Button } from './components/Button' instead of ./components
| import { ReactElement, useMemo } from 'react'; | ||
| import { Control, Controller, useFormContext, useWatch } from 'react-hook-form'; | ||
|
|
||
| import { DEFAULT_MAX_PER_ROW, DEFAULT_REPEAT_ALIGNMENT } from '../../constants'; |
There was a problem hiding this comment.
React Doctor · react-doctor/no-barrel-import (warning)
This ships extra code to your users & slows page load. Import directly from "../../constants/repeat".
Fix → Import from the direct path: import { Button } from './components/Button' instead of ./components
| import { ReactElement, useCallback } from 'react'; | ||
| import { ControllerRenderProps, FieldErrors } from 'react-hook-form'; | ||
|
|
||
| import { DEFAULT_MAX_PER_ROW, DEFAULT_REPEAT_ALIGNMENT } from '../../constants'; |
There was a problem hiding this comment.
React Doctor · react-doctor/no-barrel-import (warning)
This ships extra code to your users & slows page load. Import directly from "../../constants/repeat".
Fix → Import from the direct path: import { Button } from './components/Button' instead of ./components
| @@ -18,6 +18,7 @@ import { Control, Controller } from 'react-hook-form'; | |||
|
|
|||
| import { PanelEditorValues, PanelPlugin } from '../../model'; | |||
| import { useDataQueriesContext, usePlugin } from '../../runtime'; | |||
There was a problem hiding this comment.
React Doctor · react-doctor/no-barrel-import (warning)
This ships extra code to your users & slows page load. Import directly from: "../../runtime/DataQueriesProvider/DataQueriesProvider", "../../runtime/plugin-registry".
Fix → Import from the direct path: import { Button } from './components/Button' instead of ./components
Closes:
Needs:
Description
Adds support for repeat panel based on variable. Has 2 modes 'all' and 'selected'. In 'all' panel is repeated based on all available options. In 'selected' only selected values from dropdown are used.
Screenshots
In below recording you can notice that width of panel is expanded when you select repeat variable and height is used for single tile. If you don't fill 'Max per row' all tiles will be fitted into single row.
Screen.Recording.2026-06-01.at.19.01.28.mov
In this one you can see how the panel will behave in selected mode when the amount of selected values will change. You can enter edit mode only with first panel.
Screen.Recording.2026-06-01.at.19.09.07.mov
It is one tile so you resize, move it as one.
Screen.Recording.2026-06-01.at.19.12.56.mov
Group repeat has priority over panel repeat.
Screen.Recording.2026-06-01.at.19.14.58.mov
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes
See e2e docs for more details. Common issues include: