Skip to content

repl: Show add-cell controls in empty notebooks - #61329

Merged
MrSubidubi merged 2 commits into
zed-industries:mainfrom
ArneshBanerjee:pr/notebook-empty-state
Jul 24, 2026
Merged

repl: Show add-cell controls in empty notebooks#61329
MrSubidubi merged 2 commits into
zed-industries:mainfrom
ArneshBanerjee:pr/notebook-empty-state

Conversation

@ArneshBanerjee

@ArneshBanerjee ArneshBanerjee commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Objective

When a notebook has no cells, the editor renders a blank pane with no visible way to add one. Cells can only be added via the toolbar icons or keybindings, which aren't discoverable from an empty editor — so a newly created .ipynb looks broken.

This is the follow-up direction suggested in #61296.

Solution

Render an empty-state in the editor body when the notebook has no cells, with "Add code cell" / "Add markdown cell" buttons (dispatching the existing add_code_block / add_markdown_block handlers), matching the affordance VSCode provides.

Testing

Tested locally on macOS with the notebook feature enabled (LOCAL_NOTEBOOK_DEV=1):

  • Opening an empty .ipynb shows the empty-state instead of a blank pane.
  • Clicking "Add code cell" inserts an editable code cell and marks the tab dirty.

Showcase

Before — empty notebook renders a blank pane:

Before: blank pane

After — empty notebook shows add-cell controls:

After: add-cell controls

Clicking "Add code cell" inserts a cell:

After clicking Add code cell

Release Notes:

  • N/A

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jul 20, 2026
@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Jul 20, 2026

@MrSubidubi MrSubidubi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for this - can you please add some screenshots comparisons as requested by the PR template and our repository contribution guidelines?

@ArneshBanerjee

Copy link
Copy Markdown
Contributor Author

Added a before/after showcase to the description — the empty notebook now shows "Add code cell" / "Add markdown cell" controls instead of a blank pane. Thanks!

@ArneshBanerjee

Copy link
Copy Markdown
Contributor Author

@MrSubidubi this is ready for another look whenever you have a moment — the before/after showcase has been added to the description as requested. Thanks!

@MrSubidubi

Copy link
Copy Markdown
Member

No need to ping me/anyone here, but all good, just an FYI.

With that out of the way, overall looks good! Two things come to mind:

  • Are there fitting icons we can use for both the buttons?
  • Can we please show the keybinding with those? There should exist some APIs for us to be able to show those.

When a notebook has no cells, the editor rendered a blank pane with no
visible way to add one. Render an empty-state with add code cell and add
markdown cell buttons in the editor body, each with an icon and its
keybinding, matching the affordance VSCode provides.

This is the follow-up direction suggested in zed-industries#61296.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ArneshBanerjee
ArneshBanerjee force-pushed the pr/notebook-empty-state branch from f531b5b to fe36d6f Compare July 20, 2026 18:19
@ArneshBanerjee

Copy link
Copy Markdown
Contributor Author

Added icons to both buttons and surfaced their keybindings, so they now show cmd-m and cmd-shift-m. Also refreshed the showcase screenshot in the description.

@ChristopherBiscardi ChristopherBiscardi added the area:repl repl, jupyter, notebooks, etc label Jul 22, 2026
@ArneshBanerjee

Copy link
Copy Markdown
Contributor Author

Hey. I've added the changes requested.
Is it good to be merged or anything additional needed?

Comment thread crates/repl/src/notebook/notebook_ui.rs Outdated

@MrSubidubi MrSubidubi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nope, looks good now. Thank you!

@MrSubidubi
MrSubidubi enabled auto-merge July 24, 2026 10:58
@MrSubidubi
MrSubidubi added this pull request to the merge queue Jul 24, 2026
Merged via the queue into zed-industries:main with commit d1548bd Jul 24, 2026
38 checks passed
@ArneshBanerjee

Copy link
Copy Markdown
Contributor Author

Thanks!

mdz-axo added a commit to mdz-axo/zed-kask that referenced this pull request Jul 25, 2026
Upstream changes (zed-industries/zed main, 27 commits):
- agent: Add agent.compaction_model setting for context compaction (zed-industries#60012)
- agent: Show effort selector for anthropic compatible providers (zed-industries#61579)
- acp: Update agent-client-protocol SDK to 2.0.0 (zed-industries#61570)
- client: Extract proxy handshakes into new proxy_handshake crate (zed-industries#61427)
- collab: Fix multiworkspace location out of sync bugs (zed-industries#61598)
- editor: Fix sticky header drag cancels autoscroll (zed-industries#53592)
- editor: Fix crash when copying and pasting using multiple cursors (zed-industries#61545)
- editor: Skip untitled buffers when saving a multi-buffer (zed-industries#61380)
- gpui: Fix images not being drawn with rounded corners with ObjectFit::Cover (zed-industries#61383)
- gpui: Fix deadlock in performance profiler and reenable it (zed-industries#61584)
- git_ui: Prevent Git panel bindings in repository selector (zed-industries#61282)
- language_model: Add explicit OpenAI conversation compaction and fix Anthropic compaction (zed-industries#61370)
- markdown: Fix squashed Mermaid diagrams in markdown preview (zed-industries#61260)
- Opus 5 BYOK Support (zed-industries#61596)
- repl: Show add-cell controls in empty notebooks (zed-industries#61329)
- search: Escape seeded buffer search query in regex mode (zed-industries#57748)
- settings: Fix VS Code import appending duplicate file associations (zed-industries#61355)
- settings: Split VSCode and Zed keymap files (zed-industries#61532)
- Treat blank spawn_agent session IDs as absent (zed-industries#60893)
- worktree: Reload git state when a watcher rescan covers a repository (zed-industries#61541)
- Plus 7 more minor fixes.

Merge fixes:
- crates/agent/src/thread.rs: replay_tool_call used 'message_ix' (undefined)
  after auto-merge; renamed to 'owning_message_ix' (the parameter name).
- Cargo.toml: Removed stale workspace members hkask-wallet and hkask-git-cas
  (both directories deleted in prior commits but workspace entries remained).
- kask/crates/hkask-regulation/src/wallet_manager.rs: Stubbed consume() and
  settle_rjoules() on WalletBudgetPort — these were API-key encumbrance
  operations from the deleted hkask-wallet crate; regulation tracks per-agent
  gas balances, not per-key encumbrances.
- kask/crates/hkask-regulation/src/wallet_gas_calibrator.rs: Fixed test to
  use crate::agent_wallet_store::WalletStore instead of hkask_storage::WalletStore.
- kask/crates/hkask-regulation/Cargo.toml: Added tokio macros feature to
  dev-dependencies for #[tokio::test].
- kask/crates/kask_bridge/Cargo.toml: Added futures dependency (needed by
  context_injector.rs for futures::executor::block_on).
- kask/crates/kask_bridge/src/context_injector.rs: Fixed futures_util::executor
  to futures::executor (futures-util doesn't include executor module).

Release Notes:

- N/A
ReachForStar added a commit to ReachForStar/zed-ZH_CN that referenced this pull request Jul 25, 2026
上游 zed-industries#61329 新增笔记本空状态提示与两个按钮,补 en/zh-CN
翻译并替换硬编码字符串为 t! 调用。
0arm pushed a commit to 0arm/zed that referenced this pull request Jul 26, 2026
## Objective

When a notebook has no cells, the editor renders a blank pane with no
visible way to add one. Cells can only be added via the toolbar icons or
keybindings, which aren't discoverable from an empty editor — so a newly
created `.ipynb` looks broken.

This is the follow-up direction suggested in zed-industries#61296.

## Solution

Render an empty-state in the editor body when the notebook has no cells,
with "Add code cell" / "Add markdown cell" buttons (dispatching the
existing `add_code_block` / `add_markdown_block` handlers), matching the
affordance VSCode provides.

## Testing

Tested locally on macOS with the notebook feature enabled
(`LOCAL_NOTEBOOK_DEV=1`):

- Opening an empty `.ipynb` shows the empty-state instead of a blank
pane.
- Clicking "Add code cell" inserts an editable code cell and marks the
tab dirty.

## Showcase

**Before** — empty notebook renders a blank pane:

![Before: blank
pane](https://raw.githubusercontent.com/ArneshBanerjee/zed-jupyter/pr-assets/61329-before.png)

**After** — empty notebook shows add-cell controls:

![After: add-cell
controls](https://raw.githubusercontent.com/ArneshBanerjee/zed-jupyter/pr-assets/61329-after.png)

Clicking "Add code cell" inserts a cell:

![After clicking Add code
cell](https://raw.githubusercontent.com/ArneshBanerjee/zed-jupyter/pr-assets/61329-after-add-cell.png)

Release Notes:

- N/A

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Finn Evers <finn.evers@outlook.de>
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
## Objective

When a notebook has no cells, the editor renders a blank pane with no
visible way to add one. Cells can only be added via the toolbar icons or
keybindings, which aren't discoverable from an empty editor — so a newly
created `.ipynb` looks broken.

This is the follow-up direction suggested in zed-industries#61296.

## Solution

Render an empty-state in the editor body when the notebook has no cells,
with "Add code cell" / "Add markdown cell" buttons (dispatching the
existing `add_code_block` / `add_markdown_block` handlers), matching the
affordance VSCode provides.

## Testing

Tested locally on macOS with the notebook feature enabled
(`LOCAL_NOTEBOOK_DEV=1`):

- Opening an empty `.ipynb` shows the empty-state instead of a blank
pane.
- Clicking "Add code cell" inserts an editable code cell and marks the
tab dirty.

## Showcase

**Before** — empty notebook renders a blank pane:

![Before: blank
pane](https://raw.githubusercontent.com/ArneshBanerjee/zed-jupyter/pr-assets/61329-before.png)

**After** — empty notebook shows add-cell controls:

![After: add-cell
controls](https://raw.githubusercontent.com/ArneshBanerjee/zed-jupyter/pr-assets/61329-after.png)

Clicking "Add code cell" inserts a cell:

![After clicking Add code
cell](https://raw.githubusercontent.com/ArneshBanerjee/zed-jupyter/pr-assets/61329-after-add-cell.png)

Release Notes:

- N/A

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Finn Evers <finn.evers@outlook.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:repl repl, jupyter, notebooks, etc cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants