Skip to content

Add Editor UI#11

Merged
prachigauriar merged 9 commits intomainfrom
prachi/editor-ui
Mar 9, 2026
Merged

Add Editor UI#11
prachigauriar merged 9 commits intomainfrom
prachi/editor-ui

Conversation

@prachigauriar
Copy link
Copy Markdown
Contributor

  • Add a SwiftUI configuration variable editor with list and detail
    views for browsing and overriding configuration values at runtime
  • Add EditorOverrideProvider, a persistent configuration provider
    backed by UserDefaults that integrates with ConfigVariableReader
  • Add EditorDocument to manage a working copy of overrides with
    undo/redo and dirty tracking
  • Add MVVM layer with ConfigVariableListView,
    ConfigVariableDetailView, and their view model protocols and
    implementations
  • Add ConfigVariableEditor as the public entry point for presenting
    the editor
  • Add ProviderBadge and ProviderValue utility views for displaying
    provider information
  • Add EditorControl to describe which UI control the editor uses for
    each variable type
  • Add DisplayNameMetadataKey and RequiresRelaunchMetadataKey for
    editor metadata
  • Add ConfigContent editing support with displayString, editorControl,
    parse, and defaultContent on content types
  • Add NamedConfigProvider and ProviderEditorSnapshot data models
  • Add ConfigSnapshot+ConfigContent extension
  • Refactor ConfigVariableSecrecy enum into an isSecret boolean on
    ConfigVariable
  • Add destinationTypeName to RegisteredConfigVariable
  • Add localized string catalog for all editor UI strings
  • Add example app for exercising the editor

Prachi Gauriar added 9 commits March 7, 2026 21:24
…nt editing support

  - Add displayName and requiresRelaunch metadata keys with localized
    display text via a new string catalog resource bundle
  - Add EditorControl, a struct describing which UI control to use when
    editing a variable (toggle, text field, number field, decimal field,
    or none)
  - Add editorControl and parse properties to ConfigVariableContent,
    set automatically by each content factory based on value type
  - Capture editorControl and parse on RegisteredConfigVariable during
    registration
  - Move ConfigVariableMetadata and metadata keys into a Metadata
    directory; move metadata tests accordingly
  - Add architecture plan and implementation plan documents for the
    editor UI feature
  - Add configType computed property and Codable conformance to
    ConfigContent for type checking and JSON serialization
  - Add EditorOverrideProvider, a ConfigProvider that stores editor
    overrides in memory with real-time value and snapshot watching,
    following the MutableInMemoryProvider pattern
  - Add UserDefaults persistence to EditorOverrideProvider via load,
    persist, and clearPersistence methods with injectable UserDefaults
    for testability
  - Add isEditorEnabled parameter to ConfigVariableReader inits; when
    enabled, creates an EditorOverrideProvider, loads persisted
    overrides, and prepends it to the provider list
  - Add Editor source and test directories for editor-specific code
  - Add EditorDocument, a @mainactor working copy model that tracks
    staged overrides separately from the committed baseline in
    EditorOverrideProvider
  - Support setOverride, removeOverride, and removeAllOverrides with
    dirty tracking via isDirty and changedKeys
  - Add save method that computes the delta, updates the provider,
    persists to UserDefaults, and resets the baseline
  - Integrate with UndoManager for undo/redo of all mutation
    operations, including a single undo action for removeAllOverrides
  - Reorder EditorOverrideProvider declarations to place types before
    stored properties
  - Add displayString computed property to ConfigContent using
    locale-aware formatters for numbers and list formatting
  - Add VariableListItem and ProviderValue data structs for the
    list and detail views respectively
  - Add ConfigVariableListViewModeling and
    ConfigVariableDetailViewModeling protocols outside
    #if canImport(SwiftUI) for testability
  - Add ConfigVariableListViewModel with filtered/sorted variable
    list, search, value resolution across providers, save, cancel,
    undo/redo delegation, and detail view model creation
  - Add ConfigVariableDetailViewModel with provider value queries,
    override enable/disable, text and bool override editing via
    parse closures, and secret reveal toggle
  - Make EditorDocument @observable so view model computed
    properties react to working copy changes
  - Add static editorProviderName to EditorOverrideProvider to
    avoid hardcoded provider name strings
  - Add localized unknownProviderName string for variables that
    resolve to their default value
  - Reorganize Editor directory into Data Models and View Models
    subdirectories
…point

  - Add ProviderBadge view and providerColor(at:) function for
    deterministic provider color assignment from a fixed palette
  - Add ConfigVariableDetailView with header, override controls
    (toggle, text field, number/decimal fields), provider values
    with tap-to-reveal for secrets, and metadata sections
  - Add ConfigVariableEditorView with searchable list, navigation
    to detail views, toolbar with save/cancel and overflow menu
    for undo, redo, and clear overrides, and confirmation alerts
  - Add ConfigVariableEditor as the public entry point, creating
    the view model layer from a ConfigVariableReader
  - Replace secrecy property on RegisteredConfigVariable with a
    resolved isSecret boolean, computed at registration time using
    ConfigVariableReader.isSecret(_:)
  - Add isSecret to ConfigVariableDetailViewModeling protocol and
    concrete implementation
  - Add providerIndex to VariableListItem and ProviderValue for
    correct provider color assignment in views
  - Add 21 localized strings for editor and detail view labels,
    alerts, and section headers
@prachigauriar prachigauriar changed the title Editor UI Add Editor UI Mar 9, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 9, 2026

Code Coverage Report

Overall Coverage: 79.75% (3,044 of 3,817)

DevConfiguration: 79.75% (3,044 of 3,817)
File Coverage Covered Lines Executable Lines
CodableValueRepresentation.swift 100.00% 66 66
ConfigContent+Additions.swift 100.00% 118 118
ConfigSnapshot+ConfigContent.swift 100.00% 22 22
ConfigVariable.swift 100.00% 68 68
ConfigVariableAccessFailedEvent.swift 100.00% 4 4
ConfigVariableAccessSucceededEvent.swift 100.00% 5 5
ConfigVariableContent.swift 100.00% 1,520 1,520
ConfigVariableDecodingFailedEvent.swift 100.00% 5 5
ConfigVariableDetailView.swift 0.00% 0 344
ConfigVariableDetailViewModel.swift 100.00% 65 65
ConfigVariableEditor.swift 0.00% 0 25
ConfigVariableListView.swift 0.00% 0 360
ConfigVariableListViewModel.swift 97.96% 96 98
ConfigVariableMetadata.swift 100.00% 30 30
ConfigVariableReader.swift 96.02% 193 201
DisplayNameMetadataKey.swift 100.00% 2 2
EditorControl.swift 100.00% 15 15
EditorDocument.swift 98.48% 390 396
EditorOverrideProvider.swift 98.73% 311 315
EventBusAccessReporter.swift 100.00% 32 32
Localization.swift 33.33% 3 9
NamedConfigProvider.swift 100.00% 5 5
ProviderBadge.swift 0.00% 0 18
RegisteredConfigVariable.swift 100.00% 92 92
RequiresRelaunchMetadataKey.swift 100.00% 2 2

@prachigauriar prachigauriar merged commit 40db0ba into main Mar 9, 2026
3 checks passed
@prachigauriar prachigauriar deleted the prachi/editor-ui branch March 9, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant