Skip to content

feat: add editor and UI zoom commands#2058

Merged
bajrangCoder merged 4 commits intoAcode-Foundation:mainfrom
bajrangCoder:feat/editor-ui-zoom-shortcuts
Apr 25, 2026
Merged

feat: add editor and UI zoom commands#2058
bajrangCoder merged 4 commits intoAcode-Foundation:mainfrom
bajrangCoder:feat/editor-ui-zoom-shortcuts

Conversation

@bajrangCoder
Copy link
Copy Markdown
Member

No description provided.

@github-actions github-actions Bot added enhancement New feature or request translations Anything related to Translations Whether a Issue or PR labels Apr 25, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 25, 2026

Greptile Summary

This PR adds two new features: an editor font-size zoom accessible via Ctrl-+/Ctrl-= and Ctrl-- keyboard bindings, and a UI zoom setting (70–160%) that scales document.documentElement and document.body font sizes proportionally using a once-captured baseline. Locale strings are added across all 33 language files, and the terminal keyboard handler is refactored to call executeCommand directly instead of re-dispatching synthetic KeyboardEvent objects.

Confidence Score: 4/5

Safe to merge with minor caveats — no data loss or security concerns, but the Ctrl-+ terminal binding dead-end and the bundled indentGuides default change are worth resolving.

All P1/P0-level concerns were already flagged in prior review rounds and appear addressed in the current code. Remaining new findings are P2: a dead Ctrl-+ alternative in the terminal binding lookup, a misleading || 100 fallback, and an unrelated indentGuides default flip bundled into the PR.

src/components/terminal/terminal.js — Ctrl-+ alternative is unreachable; src/lib/settings.js and src/lib/editorManager.js — unrelated indentGuides default change.

Important Files Changed

Filename Overview
src/components/terminal/terminal.js Reworked keyboard handler to call executeCommand directly; Ctrl+=/- guards tightened with !shiftKey/!altKey/!metaKey; Ctrl-+ alternative in app-binding lookup is unreachable.
src/cm/commandRegistry.js Added increaseUiZoom/decreaseUiZoom commands and adjustUiZoom helper; clamped adjustFontSize range to 6-72; fixed toCodeMirrorKey to handle '-' as a literal key character.
src/lib/settings.js Added uiZoom default (100) and applyUiZoomSetting() that captures baseline font-size once and scales proportionally; indentGuides default changed to false (unrelated to zoom).
src/lib/keyBindings.js Added Ctrl-+/Ctrl-= and Ctrl-- bindings for increaseFontSize/decreaseFontSize in APP_BINDING_CONFIG; fixed parseKeyParts to handle '-' as a literal key.
src/settings/appSettings.js Added uiZoom setting UI entry (70-160 range, integer-only validation) and update callback that clamps and persists the value.
src/lib/applySettings.js Calls applyUiZoomSetting() at startup so the persisted zoom level is applied immediately on launch.
src/lib/editorManager.js Changed indentGuides fallback default from true to false; no other changes.
src/settings/editorSettings.js Changed indentGuides checkbox default from true to false, consistent with the settings.js change.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User action] --> B{Source}
    B -->|Settings UI| C[appSettings.js callback]
    B -->|Command: increaseUiZoom / decreaseUiZoom| D[adjustUiZoom in commandRegistry.js]
    B -->|App startup| E[applySettings.js]

    C --> C1[Validate: integer, 70-160]
    C1 -->|invalid| X[return - silent drop]
    C1 -->|valid| C2[appSettings.update uiZoom]
    C2 --> F

    D --> D1[Clamp to 70-160]
    D1 --> D2[settings.value.uiZoom = next]
    D2 --> D3[settings.update false]
    D3 --> F

    E --> F

    F[Settings.applyUiZoomSetting] --> G{uiZoomBaseFontSize cached?}
    G -->|No - first call| H[Read getComputedStyle fontSize]
    H --> I[Cache baseline]
    G -->|Yes| I
    I --> J[Apply rootFontSize x zoom/100 as inline style]
    J --> K[Clear window.root CSS zoom]
Loading

Reviews (2): Last reviewed commit: "fix" | Re-trigger Greptile

Comment thread src/components/terminal/terminal.js Outdated
Comment thread src/lib/settings.js
Comment thread src/settings/appSettings.js
@bajrangCoder

This comment was marked as outdated.

@bajrangCoder bajrangCoder merged commit f8311d0 into Acode-Foundation:main Apr 25, 2026
6 checks passed
@bajrangCoder bajrangCoder deleted the feat/editor-ui-zoom-shortcuts branch April 25, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request translations Anything related to Translations Whether a Issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant