Skip to content

Confusing UI behaviour for hiding code #10737

Description

@teristam

Describe the bug

After you hide the code of a cell, clicking on it will auto expand it. However, when you do a search (ctrl+F), the code is automatically hidden again. A user typically expands a cell to search for information, hiding the code when you press ctrl+f is a confusing behaviour.

Also just a small feature suggestion, the output has a collapse and expand button, it will be great if we can have that for code too. Because if the first line of the code is empty, there is really no indication that there is some code in it. e..g

Image

compared to:

Image

Thank you!

Will you submit a PR?

  • Yes

Environment

Environment
{
  "marimo": "0.24.0",
  "editable": false,
  "location": "~/code/trialexp_notebook_learning/.venv/lib/python3.12/site-packages/marimo",
  "OS": "Linux",
  "OS Version": "6.14.0-33-generic",
  "Processor": "x86_64",
  "Python Version": "3.12.3",
  "Locale": "en_US",
  "Binaries": {
    "Browser": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36 Edg/152.0.0.0",
    "Node": "v24.8.0",
    "uv": "0.12.9 (x86_64-unknown-linux-gnu)"
  },
  "Dependencies": {
    "click": "8.1.7",
    "docutils": "0.21.2",
    "itsdangerous": "2.2.0",
    "jedi": "0.19.1",
    "markdown": "3.6",
    "narwhals": "2.25.0",
    "packaging": "24.1",
    "psutil": "6.0.0",
    "pygments": "2.21.0",
    "pymdown-extensions": "11.0.2",
    "pyyaml": "6.0.1",
    "starlette": "0.41.3",
    "tomlkit": "0.13.2",
    "typing-extensions": "4.16.0",
    "uvicorn": "0.30.1",
    "websockets": "17.0.1"
  },
  "Optional Dependencies": {
    "altair": "6.2.2",
    "duckdb": "1.5.5",
    "loro": "1.13.2",
    "nbformat": "5.10.4",
    "openai": "2.54.0",
    "pandas": "2.1.4",
    "polars": "1.44.1",
    "pyarrow": "17.0.0",
    "ruff": "0.16.5",
    "sqlglot": "30.17.0"
  },
  "Experimental Flags": {}
}

Code to reproduce

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions