fix: Fixes bug in settings UI#2388
Conversation
|
@greptile |
Greptile SummaryThis PR fixes the settings UI by adding
Confidence Score: 5/5Safe 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
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]
%%{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]
Reviews (8): Last reviewed commit: "fix" | Re-trigger Greptile |
Greptile SummaryThis PR fixes the localization bug in the quicktools trigger mode settings display, where the original
Confidence Score: 4/5The 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 src/settings/appSettings.js — specifically the new Important Files Changed
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"]
%%{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"]
Reviews (1): Last reviewed commit: "format linting" | Re-trigger Greptile |
|
@greptile |
|
@greptile |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
|
@greptile |
|
@greptile |
|
@greptile |
|
@greptile |
Fixes
Cursor StyleCursor Inactive StylePreview ModeQuicktoola TriggerConsoleNote: I hope this PR is helpful and relevant :)