Skip to content

Make notebook cells follow global font and markdown styling - #57567

Merged
MartinYe1234 merged 2 commits into
zed-industries:mainfrom
JannikRosendahl:notebook-respect-global-font
May 28, 2026
Merged

Make notebook cells follow global font and markdown styling#57567
MartinYe1234 merged 2 commits into
zed-industries:mainfrom
JannikRosendahl:notebook-respect-global-font

Conversation

@JannikRosendahl

@JannikRosendahl JannikRosendahl commented May 23, 2026

Copy link
Copy Markdown
Contributor

Notebook cells are currently not responding to changes in font-family (zed://settings/buffer_font_family) and font-size (zed://settings/buffer_font_size).

Currently, MarkdownCell and CodeCell create and set a TextStyleRefinement on their Editor, creating copies of font-family and font-size in the process. As a result, these do not get updated when the global font-family or font-size change.
By not setting the refinement manually and letting the editor handle these value instead, these values get updated when the global settings change.

This behaviour is consistent with how the inline repl already behaves and in my opinion is according to the users expectations.

After Review: this PR changes the rendered preview of MarkdownCells to use the themed MarkdownStyle instead of an empty Markdown Style

Before:

origin_main.mov

After:

fix.mov

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
    • not sure if this needs test or how they should look like...
  • Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

  • Fixed notebook cells not responding to appearance settings changes

Copilot AI review requested due to automatic review settings May 23, 2026 16:05
@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 May 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR removes custom text-style refinement configuration from notebook cell editors, likely to let editors inherit styling from defaults/themes and to reduce theme-specific coupling.

Changes:

  • Removed ThemeSettings dependency from notebook cells.
  • Removed TextStyleRefinement setup (font, size, foreground, transparent background) for Markdown and Code cell editors.
  • Cleaned up imports accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/repl/src/notebook/cell.rs
Comment thread crates/repl/src/notebook/cell.rs
@cla-bot

cla-bot Bot commented May 23, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Jannik Rosendahl.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@JannikRosendahl
JannikRosendahl force-pushed the notebook-respect-global-font branch from f59f9b0 to cfd837d Compare May 23, 2026 17:13
@cla-bot

cla-bot Bot commented May 23, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Jannik Rosendahl.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@JannikRosendahl

Copy link
Copy Markdown
Contributor Author

I have checked markdown rendering in cells after Copilots comments.
I added a second commit with a similar change to the first one, the global markdown preview style is now used. Inline and block code preview now get rendered.

Before:

markdown_before

After:

markdown_preview

@maxdeviant maxdeviant changed the title Fix: use global font settings for notebook cell contents Use global font settings for notebook cell contents May 23, 2026
@JannikRosendahl
JannikRosendahl force-pushed the notebook-respect-global-font branch from cfd837d to 7de1fe7 Compare May 26, 2026 07:49
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 26, 2026
@smitbarmase smitbarmase added the area:repl repl, jupyter, notebooks, etc label May 26, 2026
@MartinYe1234 MartinYe1234 self-assigned this May 28, 2026
@MartinYe1234 MartinYe1234 changed the title Use global font settings for notebook cell contents Use global appearance settings for notebook cell rendering May 28, 2026
@MartinYe1234

MartinYe1234 commented May 28, 2026

Copy link
Copy Markdown
Contributor

Reviewed and the PR is good, small focused change. However, I will be updating the title and description as the the current title and description do not fully capture the scope of the changes.

Thank you for the contribution!

@MartinYe1234 MartinYe1234 changed the title Use global appearance settings for notebook cell rendering Make notebook cells follow global font and markdown styling*. May 28, 2026
@MartinYe1234 MartinYe1234 changed the title Make notebook cells follow global font and markdown styling*. Make notebook cells follow global font and markdown styling May 28, 2026
@MartinYe1234
MartinYe1234 added this pull request to the merge queue May 28, 2026
Merged via the queue into zed-industries:main with commit 2bba4e2 May 28, 2026
57 checks passed
@JannikRosendahl
JannikRosendahl deleted the notebook-respect-global-font branch May 28, 2026 20:40
TomPlanche pushed a commit to TomPlanche/zed that referenced this pull request Jun 2, 2026
…stries#57567)

Notebook cells are currently not responding to changes in font-family
(`zed://settings/buffer_font_family`) and font-size
(`zed://settings/buffer_font_size`).

Currently, `MarkdownCell` and `CodeCell` create and set a
`TextStyleRefinement` on their `Editor`, creating copies of font-family
and font-size in the process. As a result, these do not get updated when
the global font-family or font-size change.
By not setting the refinement manually and letting the editor handle
these value instead, these values get updated when the global settings
change.

This behaviour is consistent with how the inline repl already behaves
and in my opinion is according to the users expectations.


After Review: this PR changes the rendered preview of MarkdownCells to
use the themed MarkdownStyle instead of an empty Markdown Style



Before:


https://github.com/user-attachments/assets/e70b9346-8fa1-4d66-aa85-07e987c56ff2

After:


https://github.com/user-attachments/assets/4957e20e-9b5b-4cb9-a9df-3b33538bc686



Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
  - not sure if this needs test or how they should look like...
- [x] Performance impact has been considered and is acceptable

~~Closes #ISSUE~~

Release Notes:

- Fixed notebook cells not responding to appearance settings changes
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
…stries#57567)

Notebook cells are currently not responding to changes in font-family
(`zed://settings/buffer_font_family`) and font-size
(`zed://settings/buffer_font_size`).

Currently, `MarkdownCell` and `CodeCell` create and set a
`TextStyleRefinement` on their `Editor`, creating copies of font-family
and font-size in the process. As a result, these do not get updated when
the global font-family or font-size change.
By not setting the refinement manually and letting the editor handle
these value instead, these values get updated when the global settings
change.

This behaviour is consistent with how the inline repl already behaves
and in my opinion is according to the users expectations.


After Review: this PR changes the rendered preview of MarkdownCells to
use the themed MarkdownStyle instead of an empty Markdown Style



Before:


https://github.com/user-attachments/assets/e70b9346-8fa1-4d66-aa85-07e987c56ff2

After:


https://github.com/user-attachments/assets/4957e20e-9b5b-4cb9-a9df-3b33538bc686



Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
  - not sure if this needs test or how they should look like...
- [x] Performance impact has been considered and is acceptable

~~Closes #ISSUE~~

Release Notes:

- Fixed notebook cells not responding to appearance settings changes
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.

4 participants