Skip to content

SettingsActivity: document ui_options label mapping for value-label row#7

Open
bitcoin3us wants to merge 1 commit into
MicroPythonOS:mainfrom
bitcoin3us:docs/settings-ui-options-labels
Open

SettingsActivity: document ui_options label mapping for value-label row#7
bitcoin3us wants to merge 1 commit into
MicroPythonOS:mainfrom
bitcoin3us:docs/settings-ui-options-labels

Conversation

@bitcoin3us
Copy link
Copy Markdown

Summary

Companion to MicroPythonOS#137 which makes SettingsActivity honour the (label, value) tuple in ui_options when rendering the row's value label.

Adds:

  • A new "Display Labels for ui_options" section to settings-activity.md covering the (label, value) tuple format, the initial-render + post-save behaviour, the fall-through for stale stored values, and tips for choosing labels vs values.
  • A clarifying inline note on the ui_options description in both settings-activity.md and setting-activity.md so callers know the label is shown in the parent list row (not just inside the picker).
  • A cross-reference from setting-activity.md to the new section.

Why

Before MPOS#137, a setting like:

{"title": "Hero Image", "key": "hero_image", "ui": "radiobuttons",
 "ui_options": [("Lightning Piggy", "lightningpiggy"), ...]}

…displayed "lightningpiggy" (the raw value, no space) in the row beneath the title, even though the picker correctly showed "Lightning Piggy". MPOS#137 fixes the framework; this doc PR explains the contract so framework users know to expect label-display (and what to do for stale values that no longer appear in ui_options).

Test plan

  • Markdown renders cleanly
  • Docs site preview: confirm the new section anchor + cross-reference from setting-activity.md resolve
  • Once MicroPythonOS#137 merges, verify the documented behaviour matches the framework

Companion to MicroPythonOS#137 (framework change). Explains the
(label, value) tuple semantics: label shown in picker AND in the
settings-list row's value label; value is what gets stored.

Adds a new "Display Labels for ui_options" section to settings-activity.md
covering:
- The (label, value) tuple format
- Initial-render + post-save behavior
- Fall-through for stale stored values not in current ui_options
- Tips for choosing labels vs values (don't change values without
  a migration; labels are free to change)

setting-activity.md gets a one-line cross-reference to the new section
on the parent doc, since the same (label, value) contract applies in
the picker UI as well.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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