Skip to content

fix: Fixes bug in settings UI#2388

Merged
bajrangCoder merged 14 commits into
Acode-Foundation:mainfrom
claycuy:fix/settings-ui
Jun 26, 2026
Merged

fix: Fixes bug in settings UI#2388
bajrangCoder merged 14 commits into
Acode-Foundation:mainfrom
claycuy:fix/settings-ui

Conversation

@claycuy

@claycuy claycuy commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Fixes

  • Label on settings options:
    • Cursor Style
    • Cursor Inactive Style
    • Preview Mode
    • Quicktoola Trigger
  • Capitalization on Console

Note: I hope this PR is helpful and relevant :)

@claycuy claycuy changed the title fix: App settings ui bug fix: Fixes bug in settings UI Jun 25, 2026
@claycuy

claycuy commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

@claycuy claycuy marked this pull request as ready for review June 25, 2026 09:22
@greptile-apps

greptile-apps Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes the settings UI by adding valueText callbacks to select-type settings that previously displayed raw internal constant values (e.g. "quicktools-trigger:click") instead of human-readable, localized labels.

  • appSettings.js: Adds localized valueText for quickToolsTriggerMode (using strings.* keys) and console (using hardcoded "Legacy" / "Eruda"); the console select array is also updated to use [value, label] tuples.
  • previewSettings.js: Adds valueText for previewMode using strings.browser / strings.inapp with a null-safe fallback.
  • terminalSettings.js: Adds valueText for fontWeight, cursorStyle, and cursorInactiveStyle using array-find lookups with a raw-value fallback for unrecognized entries (e.g. numeric font weights).

Confidence Score: 5/5

Safe to merge — all changes are additive valueText callbacks with null-safe fallbacks; no existing logic is removed or altered.

The fix is narrowly scoped to display-only callbacks. Every new code path guards against null/undefined values and falls back gracefully, so a missing or unrecognized setting value cannot crash the UI. The one minor inconsistency (hardcoded English strings in the console setting) is a cosmetic i18n gap, not a functional defect.

src/settings/appSettings.js — the console setting uses hardcoded English display labels where other settings in the same PR use strings.* keys.

Important Files Changed

Filename Overview
src/settings/appSettings.js Adds localized valueText to quickToolsTriggerMode and console settings; console labels are hardcoded English strings instead of strings.* keys
src/settings/previewSettings.js Adds valueText using strings.browser / strings.inapp with proper null-guard fallback; consistent with the rest of the PR
src/settings/terminalSettings.js Adds valueText for fontWeight, cursorStyle, and cursorInactiveStyle using array.find lookups with safe fallback to raw value

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Settings UI renders item] --> B{Has valueText?}
    B -->|No| C[Display raw value from store]
    B -->|Yes| D[Call valueText with value]
    D --> E{value in options lookup?}
    E -->|Yes| F[Return localized strings label]
    E -->|No| G{value not null?}
    G -->|Yes| H[Return value.capitalize fallback]
    G -->|No| I[Return null as-is]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[Settings UI renders item] --> B{Has valueText?}
    B -->|No| C[Display raw value from store]
    B -->|Yes| D[Call valueText with value]
    D --> E{value in options lookup?}
    E -->|Yes| F[Return localized strings label]
    E -->|No| G{value not null?}
    G -->|Yes| H[Return value.capitalize fallback]
    G -->|No| I[Return null as-is]
Loading

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

@greptile-apps

greptile-apps Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes the localization bug in the quicktools trigger mode settings display, where the original value.capitalize() call would always render the raw internal constant (\"click\"\"Click\", \"touch\"\"Touch\") ignoring translated strings for non-English locales (e.g., Hungarian \"Kattintás\" / \"Érintés\", Indonesian \"Klik\" / \"Sentuh\").

  • Replaces the capitalize() polyfill call with an explicit branch that returns the correct strings[\"quicktools-trigger:click\"] or strings[\"quicktools-trigger:touch\"] localization key.
  • The fix is functionally correct for the two existing modes, but the fallback else clause silently returns the "touch" label for any unrecognized value rather than propagating or surfacing the unknown mode.

Confidence Score: 4/5

The change correctly fixes a localization bug; only concern is a non-defensive else-fallback that could silently mislabel a future third trigger mode.

The core fix is correct and well-scoped: replacing .capitalize() with proper strings[…] lookups resolves the display bug for non-English locales. The only weak spot is the implicit return strings["quicktools-trigger:touch"] for any non-click value, which would silently display the wrong label if a new mode were added or if the value were somehow undefined.

src/settings/appSettings.js — specifically the new valueText fallback branch

Important Files Changed

Filename Overview
src/settings/appSettings.js Replaces value.capitalize() with a localization-aware lookup for the quicktools trigger mode display label; fallback implicitly returns the "touch" string for any non-click value.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["valueText(value) called"] --> B{value === QUICKTOOLS_TRIGGER_MODE_CLICK?}
    B -- Yes --> C["return strings['quicktools-trigger:click']"]
    B -- No --> D["return strings['quicktools-trigger:touch']"]
    D -- "⚠️ also reached for undefined or future modes" --> E["Displays 'Touch' label incorrectly"]
    C --> F["Correct localized label shown in UI"]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["valueText(value) called"] --> B{value === QUICKTOOLS_TRIGGER_MODE_CLICK?}
    B -- Yes --> C["return strings['quicktools-trigger:click']"]
    B -- No --> D["return strings['quicktools-trigger:touch']"]
    D -- "⚠️ also reached for undefined or future modes" --> E["Displays 'Touch' label incorrectly"]
    C --> F["Correct localized label shown in UI"]
Loading

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

Comment thread src/settings/appSettings.js
@claycuy

claycuy commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

@claycuy

claycuy commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

Comment thread src/settings/appSettings.js
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@claycuy

claycuy commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

@claycuy

claycuy commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

Comment thread src/settings/previewSettings.js Outdated
@claycuy

claycuy commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

@claycuy

claycuy commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

@bajrangCoder bajrangCoder merged commit 5ed68cf into Acode-Foundation:main Jun 26, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in The Code Board - Acode Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants