Skip to content

feat(settings): redesign settings UI and localize help text#1933

Merged
bajrangCoder merged 15 commits intoAcode-Foundation:mainfrom
bajrangCoder:settings-redesign
Mar 9, 2026
Merged

feat(settings): redesign settings UI and localize help text#1933
bajrangCoder merged 15 commits intoAcode-Foundation:mainfrom
bajrangCoder:settings-redesign

Conversation

@bajrangCoder
Copy link
Member

@bajrangCoder bajrangCoder commented Mar 9, 2026

This PR improves the settings experience with a cleaner settings layout, better grouping, and clearer help text across the redesigned settings screens.

Demo

Screenshot_20260309-122638 Acode Screenshot_20260309-122645 Acode Screenshot_20260309-122653 Acode
Screenshot_20260309-122659 Acode Screenshot_20260309-122706 Acode Screenshot_20260309-122718 Acode
Screenshot_20260309-122726 Acode

@github-actions github-actions bot added the translations Anything related to Translations Whether a Issue or PR label Mar 9, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 9, 2026

Greptile Summary

This PR redesigns the Acode settings UI with a cleaner two-tier layout (main overview + detail pages), category grouping with section cards, a new valueInTail trailing-value display for select/prompt settings, and localizes ~195 previously hardcoded strings across all 35 supported languages.

Key changes:

  • settingsPage.js is substantially refactored: item rendering is broken into focused helpers (createListItemElement, buildListContent, resolveItemInteraction, syncTrailingValueDisplay, etc.), category grouping is handled by buildListContent, and a new valueInTail option renders the current value as a compact trailing control instead of a subtitle.
  • searchbar/index.js gains buildSearchContent and cloneSearchItem to preserve section grouping in search results; a latent bug exists where ungrouped items are silently dropped (and the result count overstated) when mixed with grouped items — though all current settings items always receive a group label so this does not manifest today.
  • settingsPage.scss introduces 629 lines of new styles for both page types; the main-settings-page and detail-settings-page blocks share a large amount of identical CSS that could be deduplicated with a shared placeholder or class.
  • All settings pages (mainSettings, editorSettings, appSettings, lspSettings, lspServerDetail, etc.) are updated to use the new pageClassName/listClassName/valueInTail/infoAsDescription options and the new localized info strings.
  • In lspSettings.js, the server detail route uses key.split(":")[1] to extract the server ID, which would silently truncate any server ID containing a colon; key.slice("server:".length) would be more robust.

Confidence Score: 4/5

  • This PR is generally safe to merge; the redesign is well-structured and the two identified issues are low-severity edge cases that don't affect the current settings feature set.
  • The core refactor is solid: interaction logic is correctly separated, category grouping works as expected for all existing settings pages (all of which pass preserveOrder: true to avoid sort-category conflicts), and localization is applied consistently. The one logic concern (buildSearchContent dropping ungrouped items) is latent and does not trigger with any current settings items since every item receives a defaultSearchGroup. The server ID split issue is a minor robustness gap. The SCSS duplication is a maintenance concern but doesn't affect runtime behavior.
  • Pay closest attention to src/components/searchbar/index.js (buildSearchContent ungrouped-item handling) and src/components/settingsPage.scss (CSS duplication between the two page-type blocks).

Important Files Changed

Filename Overview
src/components/settingsPage.js Major refactor: inline item-rendering logic extracted into helper functions, new section/category grouping via buildListContent, trailing-value tail support with valueInTail option, and resolveItemInteraction cleanly separates interaction logic from DOM updates. Logic is substantially improved over the original monolithic function.
src/components/searchbar/index.js New buildSearchContent and cloneSearchItem helpers add grouped display of search results. Latent logic bug: items without data-searchGroup are silently dropped when mixed with grouped items, and the result count label would be inaccurate in that scenario.
src/components/settingsPage.scss New 629-line stylesheet for the redesigned settings UI. Contains significant CSS duplication between wc-page.main-settings-page and wc-page.detail-settings-page blocks; shared rules for sections, labels, cards, notes, and toggle switches are copy-pasted verbatim across both scopes.
src/settings/mainSettings.js Items reorganized into five categories with localized info descriptions and chevron: true for all navigation entries. preserveOrder: true correctly prevents alphabetical re-sorting from breaking category grouping.
src/settings/editorSettings.js Editor settings reorganized into six categories with localized help text. Uses preserveOrder: true, valueInTail: true, and infoAsDescription: true — all appropriate for this dense settings page.
src/settings/appSettings.js App settings reorganized into four categories with localized descriptions. The keybindings item was correctly converted from an inline select item to a chevron action handled entirely in the callback. Pre-existing missing break after cleanInstallState causes fall-through into rememberFiles (not introduced by this PR).
src/settings/lspSettings.js LSP settings page reorganized with localized strings, custom server flow, and sorted server list. Server ID extraction via key.split(":")[1] would silently truncate IDs containing a colon; key.slice("server:".length) would be safer.
src/settings/lspServerDetail.js Hardcoded English strings replaced with localized keys; FEATURE_ITEMS converted to a getFeatureItems() function; fillTemplate now correctly uses replaceAll; updateItemDisplay updated to handle both .value (info subtitle) and .setting-trailing-value (tail value) for the new layout.
src/lang/en-us.json ~195 new locale keys added: LSP feature/status/error strings, settings category labels, per-setting info descriptions, and search result count labels. All additions are in English; the same English strings are copy-pasted to every other locale file in this PR.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[settingsPage called] --> B[normalizeSettings\nextract note, attach info getter]
    B --> C[listItems\nbuild DOM items]
    C --> D{item has category?}
    D -- yes --> E[buildListContent\nwrap in section card]
    D -- no --> F[flat list item]
    E --> G[children array\nsections + flat items]
    F --> G
    G --> H{note exists?}
    H -- top --> I[unshift note]
    H -- bottom --> J[push note]
    H -- no note --> K
    I --> K[$list.content = children]
    J --> K

    C --> L[searchItems\nflat list of items]

    K --> M{shouldEnableSearch?}
    M -- united or separate>5 --> N[search icon added to header]
    N --> O[searchBar component]
    O --> P{typing in search}
    P --> Q[createSearchHandler]
    Q -- united --> R[query all uiSettings pages]
    Q -- separate --> S[filter searchItems by text]
    R --> T[buildSearchContent\ngroup by data-searchGroup]
    S --> T
    T --> U[render grouped\nsearch results]

    K --> V[item click]
    V --> W[resolveItemInteraction]
    W --> X{item type}
    X -- select --> Y[select dialog]
    X -- checkbox --> Z[toggle checkbox]
    X -- prompt --> AA[prompt dialog]
    X -- file/folder --> AB[FileBrowser]
    X -- color --> AC[colorPicker]
    X -- link --> AD[openInBrowser]
    Y & Z & AA & AB & AC --> AE[updateItemValueDisplay\nsync tail or inline value]
    AE --> AF[callback key, value]
Loading

Comments Outside Diff (2)

  1. src/settings/lspSettings.js, line 276-278 (link)

    Server ID extraction truncates at first colon

    key.split(":")[1] only takes the segment immediately after the first ":". If a server ID ever contains a colon (e.g. a namespaced or URI-style ID like "my-org:typescript"), the extracted ID would be truncated and the detail page would fail to open.

    Using slice with the known prefix length is safer and doesn't have this edge case:

  2. src/components/settingsPage.scss, line 884-886 (link)

    Significant CSS duplication between main and detail settings pages

    The wc-page.main-settings-page block (lines 884–1040) and wc-page.detail-settings-page block (lines 1042–1469) are nearly identical. Shared rules — .settings-section, .settings-section-label, .settings-section-card, .settings-search-summary, the .icon interaction overrides, the .note block, and the responsive media queries — are copy-pasted verbatim across both scopes.

    This creates a maintenance hazard: any styling tweak must be applied in two places to stay consistent. Consider extracting the shared rules into a single %settings-page-base SCSS placeholder or a common .settings-page class, and having the two page-type scopes only override their specific layout differences (icon sizing, min-heights, padding, etc.).

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Last reviewed commit: 140889d

Copy link
Member

@UnschooledGamer UnschooledGamer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bajrangCoder
Copy link
Member Author

@greptileai check again

@bajrangCoder bajrangCoder merged commit 01bbc5c into Acode-Foundation:main Mar 9, 2026
6 checks passed
@bajrangCoder bajrangCoder deleted the settings-redesign branch March 9, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

translations Anything related to Translations Whether a Issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants