Skip to content

docs: add custom widget subclassing guide - #434

Merged
forntoh merged 1 commit into
masterfrom
docs-custom-widget-subclassing
Sep 28, 2026
Merged

forntoh merged 1 commit into
masterfrom
docs-custom-widget-subclassing

Conversation

@forntoh

@forntoh forntoh commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Adds a Custom Widgets documentation page (overview/widgets/custom-widget) describing the supported pattern for customizing how widget values are displayed: subclass an existing widget (or BaseWidgetValue<T>), override the protected virtual draw() method, and compose the custom widget with ITEM_WIDGET instead of the ITEM_RANGE/ITEM_LIST convenience macros.
  • Includes a complete example: a custom range widget that displays its value through a stringForValue(const T&) function instead of a printf format string, keeping all inherited editing behavior (UP/DOWN, clamping, cycling, BACK restore).
  • Registers the page in the widget overview and ItemWidget toctrees.

Motivation

Documents the pattern that answers #430 (dynamic string for widget values) without any library API change. A maintainer reply with the same pattern has already been posted on the issue: #430 (comment)

Verification

  • Sphinx build (make html, clean rebuild): succeeds with the pre-existing warning set only — byte-identical to a clean build before the change; zero warnings from the new page.
  • Content verified against source: BaseWidget::draw (protected virtual, src/widget/BaseWidget.h), BaseWidgetValue::draw / WidgetRange::draw / WidgetList::draw behaviors (including that WidgetList::draw formats the selected list entry), ITEM_DRAW_BUFFER_SIZE (64), and ITEM_WIDGET composition/template deduction (src/ItemWidget.h).

References #430

Summary by CodeRabbit

  • Documentation
    • Added guidance on creating custom widgets, including display formatting, buffer handling, and an example using value ranges.
    • Added the custom widget guide to the widget documentation listings.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: ca914a17-6513-45ec-80bd-e8e24ffa88ce

📥 Commits

Reviewing files that changed from the base of the PR and between 86243aa and 95d4861.

📒 Files selected for processing (3)
  • docs/source/overview/items/item-widget.rst
  • docs/source/overview/widgets/custom-widget.rst
  • docs/source/overview/widgets/index.rst
 _______________________________________________
< Finding your faults 10 times faster than Mom. >
 -----------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@forntoh
forntoh merged commit 56bfce7 into master Sep 28, 2026
4 of 5 checks passed
@forntoh
forntoh deleted the docs-custom-widget-subclassing branch September 28, 2026 11:32
@forntoh forntoh added the documentation Improvements or additions to documentation label Sep 28, 2026
forntoh added a commit that referenced this pull request Sep 28, 2026
## Summary

- Removes the dangling esp8266 `include` block from the Compile Examples
workflow matrix.

## Why

Since bbd2b8f ("Remove esp8266 board configuration from compile
workflow") removed the esp8266 matrix board entry, the leftover
`include` block (no `fqbn`, empty `libraries`/`sketch-paths`) has
spawned a broken esp8266 job on every workflow run — it fails with
`IndexError: list index out of range` before compiling anything (see the
failed job on #433 and #434). That commit's own verification run was
cancelled, so the breakage went unnoticed.

This completes the original removal intent and un-breaks the compile
workflow for all current and future PRs.

## Verification

- `git diff`: only the 9-line esp8266 include block removed; the four
board matrix entries (esp32, avr:uno, mkr1000, stm32) and all remaining
include blocks (AVR, ESP32, SAMD, STM32) are untouched.
- YAML validated: `yaml.safe_load` (temp venv) and independently via
ruby `YAML.load_file` — both pass.

## Notes

- If the esp8266 compile job is listed as a required status check in
branch protection, that repository setting should be updated after this
merges.
- After this merges, open PRs with a recorded failed esp8266 job (e.g.
#433) may need a branch update to re-run checks.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Automated build validation no longer includes ESP8266 board
configurations. This changes which board builds are checked
automatically; it does not describe a change to the behavior of existing
devices.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant