Skip to content

[FEATURE] Add panel-level repeat variable support - #149

Open
adrianSepiol wants to merge 4 commits into
perses:mainfrom
adrianSepiol:feature/panel-level-repeat
Open

[FEATURE] Add panel-level repeat variable support#149
adrianSepiol wants to merge 4 commits into
perses:mainfrom
adrianSepiol:feature/panel-level-repeat

Conversation

@adrianSepiol

@adrianSepiol adrianSepiol commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Closes: perses/perses#2936

Needs: perses/spec#32

Description

Adds support for repeat panel based on variable. Uses 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.

layout-editor.mov

In this one you can see how the panel will behave when the amount of selected values will change. You can enter edit mode only with first panel.

Screen.Recording.2026-06-10.at.09.00.11.mov

Group repeat has priority over panel repeat.

Screen.Recording.2026-06-01.at.19.14.58.mov

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

UI Changes

  • Changes that impact the UI include screenshots and/or screencasts of the relevant changes.
  • Code follows the UI guidelines.
  • E2E tests are stable and unlikely to be flaky.
    See e2e docs for more details. Common issues include:
    • Is the data inconsistent? You need to mock API requests.
    • Does the time change? You need to use consistent time values or mock time utilities.
    • Does it have loading states? You need to wait for loading to complete.

@adrianSepiol
adrianSepiol requested a review from a team as a code owner June 1, 2026 17:22
@shahrokni

Copy link
Copy Markdown
Contributor

@adrianSepiol
Could you please check the two following pipelines. It seems they are failing. ci/build and ci/type-check`` And please before that, rebase` with main.

@adrianSepiol

Copy link
Copy Markdown
Contributor Author

@adrianSepiol Could you please check the two following pipelines. It seems they are failing. ci/build and ci/type-check And please before that, ``rebase` with main.

@shahrokni Pipelines are failing because of PR mentioned in description that needs to be merged for this to work: perses/spec#32

@adrianSepiol
adrianSepiol force-pushed the feature/panel-level-repeat branch 2 times, most recently from c42f663 to b611f9c Compare June 10, 2026 06:53
@adrianSepiol

Copy link
Copy Markdown
Contributor Author

Removed "mode" option after comments from @AntoineThebaud in perses/perses#2936. I've updated description of PR.

@adrianSepiol
adrianSepiol force-pushed the feature/panel-level-repeat branch from b611f9c to 23fe7b8 Compare June 11, 2026 10:16
@adrianSepiol
adrianSepiol marked this pull request as draft July 10, 2026 07:20
@adrianSepiol
adrianSepiol force-pushed the feature/panel-level-repeat branch 11 times, most recently from 9a6a842 to b83e228 Compare July 20, 2026 12:49
@adrianSepiol
adrianSepiol marked this pull request as ready for review July 20, 2026 12:58
@adrianSepiol

Copy link
Copy Markdown
Contributor Author

Hi @jgbernalp @Gladorme, I've moved this pr to ready for review with new Layout tab that we have discussed.

Comment thread plugin-system/src/model/panels.ts
Comment thread plugin-system/src/components/LayoutEditor/index.ts
Comment thread dashboards/src/context/DashboardProvider/panel-editor-slice.ts Outdated
Comment thread dashboards/src/context/DashboardProvider/panel-editor-slice.ts Outdated
Comment thread dashboards/src/components/GridLayout/GridItemRenderer.tsx Outdated
Comment thread dashboards/src/components/GridLayout/GridItemContent.tsx Outdated
Comment thread dashboards/src/context/VariableProvider/VariableProvider.tsx Outdated
Comment thread dashboards/src/components/GridLayout/RepeatGridItemContent.tsx Outdated
@adrianSepiol
adrianSepiol force-pushed the feature/panel-level-repeat branch from 7296c12 to de926ba Compare July 29, 2026 09:28
@adrianSepiol

Copy link
Copy Markdown
Contributor Author

Hi @jgbernalp, I adjusted code to your comments. Could you have another look?

Comment thread plugin-system/src/schema/panel.ts Outdated
Comment thread dashboards/src/utils/repeatLayoutUtils.ts Outdated
Comment thread plugin-system/src/components/LayoutEditor/RepeatVariableEditor.tsx Outdated
Comment thread dashboards/src/utils/repeatLayoutUtils.ts Outdated
Comment thread plugin-system/src/components/LayoutEditor/LayoutEditor.test.tsx
@adrianSepiol
adrianSepiol force-pushed the feature/panel-level-repeat branch 2 times, most recently from 05dc32e to fe39dc3 Compare August 12, 2026 08:53
return `This panel is generated from the variable "${repeatVariableName}" with the value "${value}". To change panel definition, please edit the first panel.`;
}
if (isFirst && isCapped) {
return `Not all values are displayed. To display more, update the repeat variable limit in the server configuration.`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return `Not all values are displayed. To display more, update the repeat variable limit in the server configuration.`;
return `Not all values are displayed. To display more, update the repeat variable limit in the server configuration or exit full screen mode.`;

const { name: repeatVariableName, values: variableValues, maxPer: perRow } = panelRepeatVariable;
const variables = useVariableValues();

const rows: string[][] = useMemo(() => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the same as in RepeatLayoutPreview.tsx:29 ? maybe we can extract a small reusable function

}, []);

const preview =
watchedRepeatVariable && repeatVariableValue ? (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jgbernalp jgbernalp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minor style and code reuse comments.

@jgbernalp

Copy link
Copy Markdown
Contributor

@adrianSepiol we need a rebase

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>
@adrianSepiol
adrianSepiol force-pushed the feature/panel-level-repeat branch from fe39dc3 to 184c638 Compare August 18, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panel repeat

3 participants