Skip to content

Commit ba71229

Browse files
manztpre-commit-ci[bot]
authored andcommitted
Fix hide_code not taking effect on kernel-created cells (marimo-team#8926)
Cells created via code_mode with `hide_code=True` and non-empty code showed their editor anyway because they were marked "untouched," which overrides `hide_code` in the render logic. That override only makes sense for empty cells the user just created, so gate it on `!code` as well. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 08b46a6 commit ba71229

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

frontend/src/core/cells/cells.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,10 @@ const {
247247
[newCellId]: createRef(),
248248
},
249249
scrollKey: autoFocus ? newCellId : null,
250-
untouchedNewCells: hideCode
251-
? new Set([...state.untouchedNewCells, newCellId])
252-
: state.untouchedNewCells,
250+
untouchedNewCells:
251+
hideCode && !code
252+
? new Set([...state.untouchedNewCells, newCellId])
253+
: state.untouchedNewCells,
253254
};
254255
},
255256
moveCell: (

0 commit comments

Comments
 (0)