webui: human-readable labels + section titles/descriptors in Settings (closes #436)#451
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds human-readable labels for individual settings and titles/descriptions for setting categories on the WebUI Settings page, addressing #436 and laying the metadata groundwork for #439 (typed selectors) and #444 (cron picker).
Changes:
- Adds required
labeltoSettingMetadataand a newcategoryMetadatamap withtitle/descriptionper category slug inconfig-schema.ts. - Updates
renderSettingsPageto show the human label as primary text with the dotted key as a muted<code>reference, and renders category title + description in section headers. - Threads
labelthroughSettingRowinread-only-routes.ts(falling back to the raw key for orphan DB rows) and adds coverage tests for both schema completeness and rendering.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/services/config-schema.ts | Adds label to every settings entry and introduces CategoryMetadata + categoryMetadata map; tightens lobby description wording. |
| src/web/admin-views.ts | Renders human label as primary + muted dotted key, and category title/description in section header. |
| src/web/read-only-routes.ts | Populates label on SettingRows, with raw-key fallback for orphans. |
| tests/services/config-schema.test.ts | Asserts label/description/category coverage and no stale entries; verifies categoryMetadata covers all used categories. |
| tests/web/admin-views.test.ts | Adds renderer tests for label-as-primary layout and category title/description. |
…closes #436) The Settings page presented each row by its raw dotted key (voicetracking.enabled, voicechannels.lobby.offlinename) and each section by its bare slug (<h2>voicechannels</h2>). Fine for developers, hostile to the "clueless admin" the v1.0 admin panel is being shaped around. Schema (src/services/config-schema.ts): - SettingMetadata gains a required `label` field. Every entry in settingsMetadata now carries a human-readable label alongside its description and category. - New CategoryMetadata interface and categoryMetadata map: one entry per category slug used by settingsMetadata, with a human title and short description. Renderer (src/web/admin-views.ts): - SettingRow interface gains `label`. - renderSettingsPage: - Section header now <h2>{title}</h2> from categoryMetadata, with a muted <p>{description}</p> under it. - Row's first column shows <strong>{label}</strong> as the primary text and the raw dotted key as a muted <code> reference beneath. The standalone "Key" column is gone — the dotted key still appears on every row but de-emphasised. - All other columns (Edit, Type, Default, Description) unchanged. Route plumbing (src/web/read-only-routes.ts): - The settings page route now reads `label` from settingsMetadata when building SettingRows, falling back to the raw key for orphan DB rows that have no schema metadata. Tests: - Two new coverage tests in __tests__/services/config-schema.test.ts: - settingsMetadata has a non-empty label/description/category for every defaultConfig key, and has no stale entries. - categoryMetadata covers every category referenced by settingsMetadata. - Two new render tests in __tests__/web/admin-views.test.ts cover the label-as-primary / key-as-muted-reference layout and the category-title + category-description rendering. This is the keystone for the rest of the v1.0 UX work: #439 (channel/ role/category selectors) will add a `type` discriminator next to `label` in SettingMetadata, and #444 (cron picker) will piggyback on the same `type` mechanism.
585a521 to
29d943b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #436. Keystone for the remaining v1.0 UX work: #439 (channel/role/category dropdown selectors) and #444 (cron picker) will both add a
typediscriminator next tolabelinSettingMetadataand piggyback on the same plumbing this PR introduces.What changed
Schema (
src/services/config-schema.ts)SettingMetadatagains a requiredlabelfield. Every entry insettingsMetadatanow carries a human-readable label (e.g."Voice Tracking enabled") alongside the existingdescriptionandcategory.CategoryMetadatainterface andcategoryMetadatamap: one entry per category slug used bysettingsMetadata, with a humantitleand shortdescription.While writing labels I also tightened the descriptions for
voicechannels.lobby.nameandvoicechannels.lobby.offlinenameto clarify they're cosmetic display strings the bot sets on managed channels, not lookups — flagged during the #441 audit.Renderer (
src/web/admin-views.ts)SettingRowinterface gainslabel.renderSettingsPage:<h2>{title}</h2>fromcategoryMetadata, with a muted<p>{description}</p>under it (e.g.<h2>Voice Channels</h2>instead of<h2>voicechannels</h2>).<strong>{label}</strong>as the primary text and the raw dotted key as a muted<code>reference beneath. The standalone "Key" column is gone — the dotted key still appears on every row but de-emphasised.Route plumbing (
src/web/read-only-routes.ts)labelfromsettingsMetadatawhen buildingSettingRows, falling back to the raw key for orphan DB rows that have no schema metadata.Tests
__tests__/services/config-schema.test.ts:settingsMetadatahas a non-emptylabel/description/categoryfor everydefaultConfigkey, and has no stale entries.categoryMetadatacovers every category referenced bysettingsMetadata.__tests__/web/admin-views.test.tscover the label-as-primary / key-as-muted-reference layout and the category-title + category-description rendering.Verification
npm test— 739 passed, 1 skipped, 0 failed (4 new tests).npx tsc --noEmit— clean.npm run lint— 0 errors.npm run format:check— clean./admin/settingsshows human labels as the primary text and the dotted key as a small muted reference underneath. Each section card has a human title and one-line description.Test plan
/admin/settingsrendering across all categories.Generated by Claude Code