-
Notifications
You must be signed in to change notification settings - Fork 428
feat(gnoweb): new form inputs #4438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice 👍
This PR aims to activate the default Goldmark missing extensions. It enhances the markdown rendering capabilities in gnoweb: ## Changes Made - Added extension.TaskList to enable task list support (GitHub-style task lists) - Added extension.Footnote to enable footnote support (Supports academic-style footnotes) - Both extensions are now included in the default markdown renderer configuration ## Syntax - **TaskList**: Uncommented and enhanced the existing task list section with examples showing both completed (`- [x]`) and pending (`- [ ]`) tasks - **Footnote**: Added a new comprehensive section demonstrating footnote usage with proper syntax: `[^1]` for references and `[^1]`: content for definitions ## Impact - Low risk: These are official Goldmark extensions with stable APIs - Backward compatible: No breaking changes to existing markdown content - Enhancement: Adds features we lost with winter gnoweb updates. ## UI Improvements Added ### TaskList Enhancements - **Gno-Styled Checkboxes**: Tasks are now styled in coherence with future form inputs from PR #4438 - Disabled checkboxes are rendered in a different style ### Footnote UX Improvements - **Enhanced Anchor Positioning:** Better positioning of superscript footnote references - **Improved Scroll Behavior:** Fixed margin scroll top to properly view anchors under the header - **Visual Highlighting:** Footnotes are now highlighted with background and subtle emphasis during scroll (visual feedback) ## Screenshots <img width="1049" height="921" alt="Capture d’écran 2025-07-15 à 16 04 03" src="https://github.com/user-attachments/assets/e2fae2b3-b1ce-4793-8d11-4285e012853e" /> <img width="1055" height="168" alt="Capture d’écran 2025-07-15 à 15 26 55" src="https://github.com/user-attachments/assets/51a4c9ab-f53c-4af3-87ef-c9192018b9dd" /> --------- Co-authored-by: Manfred Touron <[email protected]>
This PR aims to activate the default Goldmark missing extensions. It enhances the markdown rendering capabilities in gnoweb: ## Changes Made - Added extension.TaskList to enable task list support (GitHub-style task lists) - Added extension.Footnote to enable footnote support (Supports academic-style footnotes) - Both extensions are now included in the default markdown renderer configuration ## Syntax - **TaskList**: Uncommented and enhanced the existing task list section with examples showing both completed (`- [x]`) and pending (`- [ ]`) tasks - **Footnote**: Added a new comprehensive section demonstrating footnote usage with proper syntax: `[^1]` for references and `[^1]`: content for definitions ## Impact - Low risk: These are official Goldmark extensions with stable APIs - Backward compatible: No breaking changes to existing markdown content - Enhancement: Adds features we lost with winter gnoweb updates. ## UI Improvements Added ### TaskList Enhancements - **Gno-Styled Checkboxes**: Tasks are now styled in coherence with future form inputs from PR gnolang#4438 - Disabled checkboxes are rendered in a different style ### Footnote UX Improvements - **Enhanced Anchor Positioning:** Better positioning of superscript footnote references - **Improved Scroll Behavior:** Fixed margin scroll top to properly view anchors under the header - **Visual Highlighting:** Footnotes are now highlighted with background and subtle emphasis during scroll (visual feedback) ## Screenshots <img width="1049" height="921" alt="Capture d’écran 2025-07-15 à 16 04 03" src="https://github.com/user-attachments/assets/e2fae2b3-b1ce-4793-8d11-4285e012853e" /> <img width="1055" height="168" alt="Capture d’écran 2025-07-15 à 15 26 55" src="https://github.com/user-attachments/assets/51a4c9ab-f53c-4af3-87ef-c9192018b9dd" /> --------- Co-authored-by: Manfred Touron <[email protected]>
This PR aims to activate the default Goldmark missing extensions. It enhances the markdown rendering capabilities in gnoweb: ## Changes Made - Added extension.TaskList to enable task list support (GitHub-style task lists) - Added extension.Footnote to enable footnote support (Supports academic-style footnotes) - Both extensions are now included in the default markdown renderer configuration ## Syntax - **TaskList**: Uncommented and enhanced the existing task list section with examples showing both completed (`- [x]`) and pending (`- [ ]`) tasks - **Footnote**: Added a new comprehensive section demonstrating footnote usage with proper syntax: `[^1]` for references and `[^1]`: content for definitions ## Impact - Low risk: These are official Goldmark extensions with stable APIs - Backward compatible: No breaking changes to existing markdown content - Enhancement: Adds features we lost with winter gnoweb updates. ## UI Improvements Added ### TaskList Enhancements - **Gno-Styled Checkboxes**: Tasks are now styled in coherence with future form inputs from PR gnolang#4438 - Disabled checkboxes are rendered in a different style ### Footnote UX Improvements - **Enhanced Anchor Positioning:** Better positioning of superscript footnote references - **Improved Scroll Behavior:** Fixed margin scroll top to properly view anchors under the header - **Visual Highlighting:** Footnotes are now highlighted with background and subtle emphasis during scroll (visual feedback) ## Screenshots <img width="1049" height="921" alt="Capture d’écran 2025-07-15 à 16 04 03" src="https://github.com/user-attachments/assets/e2fae2b3-b1ce-4793-8d11-4285e012853e" /> <img width="1055" height="168" alt="Capture d’écran 2025-07-15 à 15 26 55" src="https://github.com/user-attachments/assets/51a4c9ab-f53c-4af3-87ef-c9192018b9dd" /> --------- Co-authored-by: Manfred Touron <[email protected]>
This PR extends the markdown form functionality in `gno.land/pkg/gnoweb/markdown` to support: - **Textarea inputs** with customizable rows and descriptions - **Radio button groups** with proper grouping and checked states - **Checkbox inputs** with checked states and descriptions - **Select inputs** with selected default option and descriptions - **Enhanced accessibility** with proper ARIA labels and descriptions - All form elements now support a `description` attribute that renders as accessible help title (semantic grouping) ## Technical updates ### Core Implementation (`ext_forms.go`) - Added `FormTextarea` struct with support for rows and descriptions - Added `FormSelect` struct with support for options and descriptions - Enhanced `FormInput` struct to support radio/checkbox types with `value` and `checked` attributes - Added validation for radio/checkbox requiring `value` attribute - Added validation for `checked` attribute (only valid for radio/checkbox) - Improved error handling with specific error messages - Enhanced HTML rendering with proper accessibility attributes - Added styles for description text, select/options, radio button, textarea and checkboxes - Improved hover states and focus indicators - Enhanced accessibility with proper contrast and sizing ## Validation Rules ### Radio/Checkbox/Select Requirements - Must have a `value` attribute - `checked` attribute only valid for radio/checkbox types - Same `name` allowed for radio groups (required for grouping) - Unique `name` required for other input types ### Textarea Requirements - Must have a `name` attribute - `rows` attribute is optional (default: 4, min: 2, max: 10) - `description` attribute is optional <img width="1096" alt="Capture d’écran 2025-06-28 à 19 03 26" src="https://github.com/user-attachments/assets/7b16553c-07b8-45dc-b600-5555bc0b09f0" />
This PR extends the markdown form functionality in
gno.land/pkg/gnoweb/markdown
to support:description
attribute that renders as accessible help title (semantic grouping)Technical updates
Core Implementation (
ext_forms.go
)FormTextarea
struct with support for rows and descriptionsFormSelect
struct with support for options and descriptionsFormInput
struct to support radio/checkbox types withvalue
andchecked
attributesvalue
attributechecked
attribute (only valid for radio/checkbox)Validation Rules
Radio/Checkbox/Select Requirements
value
attributechecked
attribute only valid for radio/checkbox typesname
allowed for radio groups (required for grouping)name
required for other input typesTextarea Requirements
name
attributerows
attribute is optional (default: 4, min: 2, max: 10)description
attribute is optional