Add editor font size setting#531
Merged
makermelissa merged 1 commit intoJul 17, 2026
Merged
Conversation
makermelissa-ai-assistant
force-pushed
the
issue-353-font-size
branch
from
July 17, 2026 17:09
3819418 to
87ffd8a
Compare
makermelissa-ai-assistant
force-pushed
the
issue-353-font-size
branch
from
July 17, 2026 17:13
87ffd8a to
f1ba4e8
Compare
makermelissa
approved these changes
Jul 17, 2026
makermelissa
left a comment
Collaborator
There was a problem hiding this comment.
Tested locally, found a few bugs along the way, but it appears to be working well.
There was a problem hiding this comment.
Pull request overview
This PR adds a user-configurable editor font size setting and applies it consistently across both the CodeMirror editor and the xterm serial terminal, including on startup and after saving settings. It also updates the Settings dialog so cancel/close no longer overwrites existing settings, and adjusts the dialog layout styling to accommodate the new control.
Changes:
- Add
editorFontSizeas a numeric setting (8–48px) and render it in the Settings dialog. - Clamp numeric setting values on save and apply the configured font size to CodeMirror (via a compartment) and xterm (via
options.fontSize) after settings changes. - Update Settings dialog behavior so cancel/close does not replace the existing settings object.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
sass/layout/_layout.scss |
Switch Settings dialog layout to a two-column grid suitable for label/control pairs (including the new number input). |
js/script.js |
Introduce font-size setting plumbing and apply it to CodeMirror and xterm (including refitting the terminal after changes). |
js/layout.js |
Export refitTerminal() for reuse from the main script. |
js/common/settings.js |
Add a numeric input type, clamp number values on save, and avoid overwriting settings when the dialog is canceled/closed. |
Comments suppressed due to low confidence (1)
js/layout.js:158
refitTerminal()can be invoked duringlayout.jsmodule initialization (viafixViewportHeight()/loadPanelSettings()), beforesetupXterm()assignsstate.terminal. In that case the current implementation will throw when it dereferencesstate.terminal._core.... Add an early guard so the function safely no-ops until the terminal has been created/opened.
export function refitTerminal() {
// Custom function to replace the terminal refit function as it was a bit buggy
// Re-fitting the terminal requires a full re-layout of the DOM which can be tricky to time right.
// see https://www.macarthur.me/posts/when-dom-updates-appear-to-be-asynchronous
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
Refs #353