feat: list group builder - #124
Open
ContextFound wants to merge 13 commits into
Open
Conversation
- 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
- Pass url parameter to LinkButton constructor in ATagMd.build() - Update link regex to support optional title attribute: [text](url "title") - Update URL extraction logic to strip title portion from raw URL Includes test infrastructure and regression tests to prevent recurrence.
- 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.
Replace initState() with didChangeDependencies() in lib/md_widget.dart
Add optional showFrontmatter parameter (default: true) to GptMarkdown widget and GptMarkdownConfig. When set to false, YAML frontmatter blocks at the beginning of markdown content are stripped before rendering. Frontmatter format: --- key: value tags: ["active"] --- - Added showFrontmatter to GptMarkdownConfig with copyWith and isSame - Added showFrontmatter to GptMarkdown widget - Implemented _stripFrontmatter static method with regex pattern - Added comprehensive tests including edge cases: - Frontmatter-style blocks in middle of content are preserved - Only frontmatter at the very beginning is stripped
- Introduced ListGroupMd component to handle grouped unordered list items in GptMarkdown. - Added ListGroupItem class to represent individual list items with content and index. - Updated GptMarkdown and GptMarkdownConfig to include a listGroupBuilder for custom rendering of grouped lists. - Enhanced the serializer to accommodate new widget structures.
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.
Summary
Adds a new
ListGroupMdcomponent that captures consecutive unordered list items as a single block, enabling custom group rendering (e.g.,ReorderableListViewfor drag-to-reorder support). Primarily aimed at being able to make re-orderable lists from standard markdown list items.Screen capture is from gpt_markdown_viewer created just to visualize the output of gpt_markdown. It has custom components and handling to utilize the ListGroupMd enhancement.
Changes
New types in
markdown_config.dart:ListGroupItemclass withindex,rawText, andcontentfieldsListGroupBuildertypedef for custom list group renderingNew
listGroupBuilderparameter added toGptMarkdownandGptMarkdownConfigNew
ListGroupMdblock component that:UnOrderedList)listGroupBuilderwhen provided, passing the parsed itemslistGroupBuilderis null