Confusing UI behaviour for hiding code

Open
#10,737 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@manzt is already working on this.

Since Sep 3, 2026.

Assessment

This issue has not been assessed yet.

Description

bug
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

Dominant language
Python
Stars
22.9k
Forks
1.3k
Avg merge
1d 10h
Merged PRs (30d)
380

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from marimo-team/marimo

All issues in marimo-team/marimo

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.