Skip to content

feat(fonts): add target-based font assignments in font manager and option to set app font#1994

Merged
bajrangCoder merged 4 commits intoAcode-Foundation:mainfrom
bajrangCoder:feat/improve-font
Mar 30, 2026
Merged

feat(fonts): add target-based font assignments in font manager and option to set app font#1994
bajrangCoder merged 4 commits intoAcode-Foundation:mainfrom
bajrangCoder:feat/improve-font

Conversation

@bajrangCoder
Copy link
Copy Markdown
Member

No description provided.

@github-actions github-actions bot added the enhancement New feature or request label Mar 30, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 30, 2026

Greptile Summary

This PR extends the font manager with per-target font assignment (app UI, editor, and terminal independently or all at once) and adds a dedicated "App font" setting in the app settings page. The implementation is well-structured: setEditorFont/setAppFont are cleanly separated in fonts.js, the --app-font-family CSS variable propagates the app font across body, the console, and list components, and applySettings.js correctly initialises both font targets on boot.

Key changes:

  • fonts.js — adds setAppFont, isCustom, extracts default font constants, and keeps a backward-compat setFont alias for setEditorFont
  • fontManager.js — replaces the single "Current editor font" model with a multi-target selection dialog and per-target colour-coded badges
  • appSettings.js — new "App font" dropdown with a dynamic get select() that always reflects the live font list
  • settings.js — adds appFont: "" to default settings
  • CSS — replaces all hardcoded "Roboto", sans-serif declarations with var(--app-font-family)

Minor issues found (all P2):

  • getAppliedTargets("") is called twice for the default item in renderFonts (result should be captured once)
  • The subtitle "System default app font" is a hardcoded English literal, bypassing the strings.* i18n system used everywhere else in the file
  • The target-selection dialog labels when resetting the "Default" item (e.g. "Reset to Editor") are ambiguous — they read as navigating to a target rather than resetting a font

Confidence Score: 5/5

Safe to merge; all findings are minor P2 style/UX improvements with no correctness or data-integrity impact.

The logic for font application, settings persistence, startup initialisation, and error fallbacks is all correct. The three flagged issues are purely cosmetic or a minor redundancy and do not affect runtime behaviour.

src/pages/fontManager/fontManager.js — contains the three P2 issues; all other files are clean.

Important Files Changed

Filename Overview
src/pages/fontManager/fontManager.js Major rewrite introducing per-target font assignment (app/editor/terminal/all); three minor P2 issues flagged: double getAppliedTargets call, hardcoded non-i18n subtitle, and confusing "Reset to X" dialog labels.
src/lib/fonts.js Adds setAppFont and isCustom; renames setFont to setEditorFont with a backward-compat alias; introduces DEFAULT_EDITOR_FONT and DEFAULT_APP_FONT_STACK constants — clean and correct.
src/settings/appSettings.js Adds appFont setting item with dynamic get select() and a callback case that calls fonts.setAppFont; pattern is consistent with the rest of the settings page.
src/lib/applySettings.js Startup now calls both setAppFont(settings.appFont) and setEditorFont(settings.editorFont) — correctly initialises both font targets on boot.
src/settings/terminalSettings.js Only change is exporting updateActiveTerminals so the font manager can call it directly — minimal and safe.
src/main.scss Defines --app-font-family CSS variable and replaces the hard-coded font-family on body with var(--app-font-family) — correct approach.
src/pages/fontManager/style.scss Replaces single .font-manager-current badge with per-target colour-coded badges (app/editor/terminal); purely cosmetic, no logic concerns.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User opens Font Manager] --> B[renderFonts]
    B --> C[Default item getAppliedTargets]
    B --> D[Per-font items getAppliedTargets]
    C --> E{User taps item}
    D --> E
    E --> F[chooseApplyTarget fontName or '']
    F --> G[select dialog App / Editor / Terminal / All]
    G -->|app| H[fonts.setAppFont save appFont]
    G -->|editor| I[fonts.setEditorFont save editorFont]
    G -->|terminal| J[updateActiveTerminals save terminalSettings.fontFamily]
    G -->|all| K[setAppFont + setEditorFont + updateActiveTerminals save all three]
    H --> L[appSettings.update]
    I --> L
    J --> L
    K --> L
    L --> M[toast + renderFonts]
Loading

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

@bajrangCoder bajrangCoder merged commit 5f1007c into Acode-Foundation:main Mar 30, 2026
6 checks passed
@bajrangCoder bajrangCoder deleted the feat/improve-font branch March 30, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant