Skip to content

Commit b07505a

Browse files
committed
v2.1.7: Fix massive editor text (fontSize percentage treated as pixels)
monaco-adapter.applySettings() was passing 'editorFontSize' straight to Monaco's fontSize option, but editorFontSize is stored as a percentage (100 = 100%), not pixels. So fontSize:100 was telling Monaco to render 100-pixel-tall text — enormous. The sibling setFontSize(pct) helper already does the correct pct → px conversion (round(13 * pct / 100), clamped 8..32). Apply the same conversion in applySettings() so first-open of any script in the editor gets the normal 13px default (or whatever the user's saved percentage maps to).
1 parent dfc36be commit b07505a

File tree

6 files changed

+10
-6
lines changed

6 files changed

+10
-6
lines changed

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Modern userscript manager built with Chrome Manifest V3. Tampermonkey-inspired functionality with cloud sync, auto-updates, a full dashboard, Monaco editor, DevTools panel, and a persistent side panel.
55

66
## Version
7-
v2.1.6
7+
v2.1.7
88

99
## Tech Stack
1010
- Chrome MV3 extension (JavaScript runtime + TypeScript source in `src/`)

background.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// ScriptVault v2.1.6 - Background Service Worker
1+
// ScriptVault v2.1.7 - Background Service Worker
22
// Comprehensive userscript manager with cloud sync and auto-updates
33
// NOTE: This file is built from source modules. Edit the individual files in
44
// shared/, modules/, and lib/, then run `npm run build` to regenerate.

manifest-firefox.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "__MSG_extName__",
4-
"version": "2.1.6",
4+
"version": "2.1.7",
55
"description": "__MSG_extDescription__",
66
"default_locale": "en",
77
"homepage_url": "https://github.com/SysAdminDoc/ScriptVault",

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "__MSG_extName__",
4-
"version": "2.1.6",
4+
"version": "2.1.7",
55
"description": "__MSG_extDescription__",
66
"default_locale": "en",
77
"minimum_chrome_version": "120",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "scriptvault",
3-
"version": "2.1.6",
3+
"version": "2.1.7",
44
"private": true,
55
"type": "module",
66
"scripts": {

pages/monaco-adapter.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,15 @@
197197

198198
// applyEditorSettings: called from dashboard initEditor
199199
applySettings(s) {
200+
// editorFontSize is a percentage (100 = 100%); Monaco wants a pixel value.
201+
// Same conversion used by setFontSize().
202+
const pct = parseInt(s.editorFontSize) || 100;
203+
const fontPx = Math.max(8, Math.min(Math.round(13 * (pct / 100)), 32));
200204
const opts = {
201205
tabSize: parseInt(s.tabSize || s.editorTabSize) || 4,
202206
insertSpaces: (s.indentWith || 'spaces') === 'spaces',
203207
wordWrap: s.wordWrap !== undefined ? s.wordWrap : (s.editorWordWrap !== false),
204-
fontSize: parseInt(s.editorFontSize) || 100,
208+
fontSize: fontPx,
205209
theme: s.editorTheme || 'dark',
206210
lineNumbers: true,
207211
minimap: s.editorMinimap !== false

0 commit comments

Comments
 (0)