Skip to content

Conversation

@ContextFound
Copy link

In a project, I wanted a custom handling of a rendered markdown checkbox to allow checking / unchecking logic, but there is currently no CheckBoxBuilder nor RadioButtonBuilder like there is for imageBuilder, linkBuilder, etc.

This PR implements the builders following the existing pattern used by other component builders.

Changes

  • Added CheckBoxBuilder typedef in markdown_config.dart
  • Added RadioButtonBuilder typedef in markdown_config.dart
  • Added checkBoxBuilder and radioButtonBuilder parameters to GptMarkdown widget and GptMarkdownConfig
  • Updated CheckBoxMd and RadioButtonMd components to use the builders when provided, falling back to the default widgets
  • Created test/custom_builders_test.dart with 12 tests that validates implementation.

Context Found added 3 commits January 11, 2026 10:22
- Add custom stable serializer for widget tree comparison (test/utils/serializer.dart)
- Add test helpers: pumpMarkdown, expectMarkdown, expectMarkdownContains (test/utils/test_helpers.dart)
- Add inline element tests: bold, italic, strikethrough, underline, highlight, links
- Add block element tests: headings, lists, code blocks, tables, checkboxes, radio buttons, blockquotes, horizontal rules, indentation
- Add LaTeX tests: inline and block math expressions
- Add image tests with dimension support
- Add regression test folder structure for bug reproduction tests
- Add test framework documentation (test/README.md)

The serializer produces stable, comparable string output that avoids brittle widget equality checks. Tests verify both structural output and widget rendering.

All 123 tests pass.
failing tests in /bugs to identify known bugs
once fixed, move to /regression
test/README outlining approach
complex integration test added
serializer fix to render internal text
two known link rendering bugs identified, but currently skipped
- Introduced CheckBoxBuilder and RadioButtonBuilder types for custom rendering of checkboxes and radio buttons in GptMarkdown.
- Updated GptMarkdownConfig to include new builder properties.
- Modified CheckBoxMd and RadioButtonMd to utilize the new builders, allowing for flexible UI customization.
- Added comprehensive tests to validate the functionality of the new builders and their integration with GptMarkdown.
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