Skip to content

Name cells to preserve position in app grid view #10013

Description

@areidmall

Describe the bug

I have a grid style app view.
If I modify the order of cells by editing the .py file externally then I am forced to reorganise my app view.
Cell positions are no longer preserved.

On reload via --watch flag, can the x.grid.json > cells be recalculated? I'd imagine this is hard given the only data preserved is cell position, depending solely on order.

If a cell is named, could that be used as a field in the cells list? Using that as first preference to match cells then fall back on order?
Also helping in being able to adjust sizes to uniform in the grid view mode then knowing the cell name within the json file.

Better yet could the info from grid layout be embedded all within the .py notebook file?

I get that it's recommended to use the online editor, my preference is external editor. Love Marimo. Thanks

Will you submit a PR?

  • Yes

Environment

Details
{
  "marimo": "0.23.8",
  "editable": false,
  "location": "C:/dev/notebooks/.venv/Lib/site-packages/marimo",
  "OS": "Windows",
  "OS Version": "11",
  "Processor": "Intel64 Family 6 Model 170 Stepping 4, GenuineIntel",
  "Python Version": "3.13.9",
  "Locale": "--",
  "Binaries": {
    "Browser": "149.0.7827.115",
    "Node": "--",
    "uv": "0.9.5 (d5f39331a 2025-10-21)"
  },
  "Dependencies": {
    "click": "8.3.1",
    "docutils": "0.22.4",
    "itsdangerous": "2.2.0",
    "jedi": "0.19.2",
    "markdown": "3.10.2",
    "narwhals": "2.16.0",
    "packaging": "26.0",
    "psutil": "7.2.2",
    "pygments": "2.19.2",
    "pymdown-extensions": "10.21.3",
    "pyyaml": "6.0.3",
    "starlette": "0.52.1",
    "tomlkit": "0.14.0",
    "typing-extensions": "4.15.0",
    "uvicorn": "0.40.0",
    "websockets": "16.0"
  },
  "Optional Dependencies": {
    "altair": "6.0.0",
    "anywidget": "0.9.21",
    "duckdb": "1.4.4",
    "loro": "1.10.3",
    "openai": "2.20.0",
    "pandas": "3.0.0",
    "polars": "1.38.1",
    "pyarrow": "23.0.0",
    "ruff": "0.15.0",
    "sqlglot": "28.10.1",
    "watchdog": "6.0.0"
  },
  "Experimental Flags": {}
}

Code to reproduce

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions