Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SceneCSSGridLayout: Add support for dragging and dropping panels #993

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kaydelaney
Copy link
Contributor

There's a lot of code here but the gist of it is enables support for dragging and dropping panels in the responsive grid layout (when paired with the PR linked below)

Let me know if there are any questions or parts of the code that could use further explanation.

Related: grafana/grafana#97495

@kaydelaney kaydelaney added minor Increment the minor version when merged release Create a release when this pr is merged labels Dec 5, 2024
@kaydelaney kaydelaney requested review from torkelo, bfmatei and a team December 5, 2024 17:19
@kaydelaney kaydelaney self-assigned this Dec 5, 2024
@kaydelaney kaydelaney requested review from axelavargas and removed request for a team December 5, 2024 17:19
parentState?: SceneCSSGridItemPlacement;
}

export class SceneCSSGridItem extends SceneObjectBase<SceneCSSGridItemState> {
Copy link
Member

Choose a reason for hiding this comment

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

I understand doing pocs here (if you need to make changes to VizPanelRenderer esp),

just be aware we have a special class in core for this CSS grid items, https://github.com/grafana/grafana/blob/main/public/app/features/dashboard-scene/scene/layout-responsive-grid/ResponsiveGridItem.tsx#L13

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh this wasn't a POC, I just factored it out from SceneCSSGridLayout

Copy link
Member

Choose a reason for hiding this comment

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

I understand, just know we are not using it dashboards.

I think a challenge with this work is what logic needs live in scenes vs the core repo implementation (and the ResponsiveGridLayoutManager)

@torkelo
Copy link
Member

torkelo commented Dec 6, 2024

Tried to test it with the css grid demo but just get an empty page
Screenshot 2024-12-06 at 06 32 49

@kaydelaney
Copy link
Contributor Author

@torkelo The css grid demo should work now - made some fixes.

@torkelo
Copy link
Member

torkelo commented Dec 10, 2024

@kaydelaney works really well!

I am not sure it helps or not but might be useful to go directly from this and explore how moving a panel between layouts would work (as as an early exploratory poc/test, to understand the problem etc) .

@torkelo
Copy link
Member

torkelo commented Dec 10, 2024

and by "between layouts" i mean between two separate CSS grids in this case (moving between CSS grid and the default grid is a separate problem, one we might have to solve as well)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Increment the minor version when merged release Create a release when this pr is merged
Projects
Status: 🗂️ Needs Triage / Escalation
Development

Successfully merging this pull request may close these issues.

2 participants