feat(ui): add KeyValueEditor component for managing key-value pairs#29
Merged
Conversation
faloker
commented
Jul 6, 2026
Collaborator
- Implemented KeyValueEditor.svelte to handle key-value pairs with validation for empty keys/values.
- Integrated KeyValueEditor into PackParametersDialog and SchemaForm components.
- Refactored config page to utilize KeyValueEditor for default tags management.
- Added utility functions for object and entry conversions in KeyValueEditor.
- Enhanced form validation to prevent saving of blank entries in settings.
- Created reusable field components for better UI consistency and structure.
- Updated AppConfig type to include new configuration options related to tags and logging.
…ttings - Implemented KeyValueEditor.svelte to handle key-value pairs with validation for empty keys/values. - Integrated KeyValueEditor into PackParametersDialog and SchemaForm components. - Refactored config page to utilize KeyValueEditor for default tags management. - Added utility functions for object and entry conversions in KeyValueEditor. - Enhanced form validation to prevent saving of blank entries in settings. - Created reusable field components for better UI consistency and structure. - Updated AppConfig type to include new configuration options related to tags and logging.
There was a problem hiding this comment.
Pull request overview
This PR redesigns the /config route into a tabbed Settings UI with typed controls for known AppConfig keys, adds a reusable key/value map editor for default_tags, and introduces a reusable field component set for consistent form layout.
Changes:
- Rewrote the settings page into four tabs (General / Default tags / Retention / About) with typed inputs and per-tab save semantics.
- Extracted the string-map editor into a shared
KeyValueEditorand reused it inSchemaFormplus validation reuse inPackParametersDialog. - Added shadcn-svelte-style
Field.*components and expanded theAppConfigTS type for known settings keys.
Reviewed changes
Copilot reviewed 18 out of 22 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| web/frontend/src/routes/config/+page.svelte | Replaces generic config loop with tabbed, typed Settings UI and save/toggle behavior. |
| web/frontend/src/lib/types/index.ts | Extends AppConfig with known optional settings keys. |
| web/frontend/src/lib/components/ui/field/index.ts | Barrel export for new Field.* UI primitives. |
| web/frontend/src/lib/components/ui/field/field.svelte | Base Field wrapper with orientation variants. |
| web/frontend/src/lib/components/ui/field/field-title.svelte | Adds Field.Title primitive (slot naming needs correction). |
| web/frontend/src/lib/components/ui/field/field-set.svelte | Adds Field.Set wrapper for fieldset layouts. |
| web/frontend/src/lib/components/ui/field/field-separator.svelte | Adds separator element for grouping within forms. |
| web/frontend/src/lib/components/ui/field/field-legend.svelte | Adds legend/label variant for grouped form sections. |
| web/frontend/src/lib/components/ui/field/field-label.svelte | Adds Field.Label wrapper around existing Label. |
| web/frontend/src/lib/components/ui/field/field-group.svelte | Adds Field.Group container for consistent spacing/layout. |
| web/frontend/src/lib/components/ui/field/field-error.svelte | Adds standardized field error rendering (single/multi error). |
| web/frontend/src/lib/components/ui/field/field-description.svelte | Adds Field.Description text primitive. |
| web/frontend/src/lib/components/ui/field/field-content.svelte | Adds Field.Content wrapper for horizontal field layouts. |
| web/frontend/src/lib/components/SchemaForm.svelte | Replaces inline map editor with shared KeyValueEditor. |
| web/frontend/src/lib/components/PackParametersDialog.svelte | Reuses hasBlankEntry helper for map validation. |
| web/frontend/src/lib/components/KeyValueEditor.svelte | New shared key/value map editor + helper exports. |
| openspec/specs/settings-page/spec.md | Adds Settings page specification and requirements. |
| openspec/changes/archive/2026-07-06-settings-page-redesign/tasks.md | Archives the completed implementation task checklist. |
| openspec/changes/archive/2026-07-06-settings-page-redesign/specs/settings-page/spec.md | Captures delta requirements for the redesign. |
| openspec/changes/archive/2026-07-06-settings-page-redesign/proposal.md | Proposal describing rationale and intended UX. |
| openspec/changes/archive/2026-07-06-settings-page-redesign/design.md | Design doc detailing decisions and trade-offs. |
| openspec/changes/archive/2026-07-06-settings-page-redesign/.openspec.yaml | OpenSpec metadata for the archived change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| </Card.Content> | ||
| </Card.Root> | ||
| {/if} | ||
| <Tabs.Root value="general"> |
Comment on lines
+89
to
+94
| try { | ||
| for (const [key, value] of dirty) { | ||
| await updateConfig(key, value); | ||
| } | ||
| config = { ...config, ...Object.fromEntries(dirty) }; | ||
| toast.success('Settings saved'); |
Comment on lines
+102
to
+111
| function saveGeneral() { | ||
| return saveKeys( | ||
| [ | ||
| ['parallelism', Math.trunc(Number(parallelism))], | ||
| ['terraform_version', terraformVersion] | ||
| ], | ||
| (v) => (generalSaving = v), | ||
| (v) => (generalError = v) | ||
| ); | ||
| } |
Comment on lines
+126
to
+135
| function saveRetention() { | ||
| return saveKeys( | ||
| [ | ||
| ['run_log_retention_days', Math.trunc(Number(runLogRetentionDays))], | ||
| ['run_retention_days', Math.trunc(Number(runRetentionDays))] | ||
| ], | ||
| (v) => (retentionSaving = v), | ||
| (v) => (retentionError = v) | ||
| ); | ||
| } |
|
|
||
| <div | ||
| bind:this={ref} | ||
| data-slot="field-label" |
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.