Skip to content

Conversation

alexiscolin
Copy link
Member

@alexiscolin alexiscolin commented Jun 28, 2025

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
Capture d’écran 2025-06-28 à 19 03 26

@github-actions github-actions bot added 🧾 package/realm Tag used for new Realms or Packages. 📦 ⛰️ gno.land Issues or PRs gno.land package related labels Jun 28, 2025
@Gno2D2 Gno2D2 requested a review from gfanton June 28, 2025 10:05
@Gno2D2 Gno2D2 added the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Jun 28, 2025
@Gno2D2
Copy link
Collaborator

Gno2D2 commented Jun 28, 2025

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • IGNORE the bot requirements for this PR (force green CI check)
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)
🟢 Changes related to gnoweb must be reviewed by its codeowners
🟢 Pending initial approval by a review team member, or review from tech-staff

☑️ Contributor Actions:
  1. Fix any issues flagged by automated checks.
  2. Follow the Contributor Checklist to ensure your PR is ready for review.
    • Add new tests, or document why they are unnecessary.
    • Provide clear examples/screenshots, if necessary.
    • Update documentation, if required.
    • Ensure no breaking changes, or include BREAKING CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Automated Checks
Maintainers must be able to edit this pull request (more info)

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 The pull request was created from a fork (head branch repo: alexiscolin/gno)

Then

🟢 Requirement satisfied
└── 🟢 Maintainer can modify this pull request

Changes related to gnoweb must be reviewed by its codeowners

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 A changed file matches this pattern: ^gno.land/pkg/gnoweb/ (filename: gno.land/pkg/gnoweb/components/ui/help_function.html)

Then

🟢 Requirement satisfied
└── 🟢 Or
    ├── 🟢 Or
    │   ├── 🟢 And
    │   │   ├── 🟢 Pull request author is user: alexiscolin
    │   │   └── 🟢 This user reviewed pull request: gfanton (with state "APPROVED")
    │   └── 🔴 And
    │       ├── 🔴 Pull request author is user: gfanton
    │       └── 🔴 This user reviewed pull request: alexiscolin (with state "APPROVED")
    └── 🔴 And
        ├── 🔴 Not (🟢 Pull request author is user: alexiscolin)
        ├── 🟢 Not (🔴 Pull request author is user: gfanton)
        └── 🟢 Or
            ├── 🔴 This user reviewed pull request: alexiscolin (with state "APPROVED")
            └── 🟢 This user reviewed pull request: gfanton (with state "APPROVED")

Pending initial approval by a review team member, or review from tech-staff

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 Not (🔴 Pull request author is a member of the team: tech-staff)

Then

🟢 Requirement satisfied
└── 🟢 If
    ├── 🟢 Condition
    │   └── 🟢 Or
    │       ├── 🟢 At least 1 user(s) of the organization reviewed the pull request (with state "APPROVED")
    │       ├── 🟢 At least 1 user(s) of the team tech-staff reviewed pull request
    │       └── 🔴 This pull request is a draft
    └── 🟢 Then
        └── 🟢 And
            ├── 🟢 Not (🔴 This label is applied to pull request: review/triage-pending)
            └── 🟢 At least 1 user(s) of the team tech-staff reviewed pull request

Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission

Copy link

codecov bot commented Jun 28, 2025

Codecov Report

Attention: Patch coverage is 81.72757% with 55 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
gno.land/pkg/gnoweb/markdown/ext_forms.go 83.21% 48 Missing and 1 partial ⚠️
gno.land/pkg/gnoweb/markdown/utils.go 33.33% 4 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@alexiscolin alexiscolin added the 🌍 gnoweb Issues & PRs related to gnoweb and render label Jun 28, 2025
@Kouteki Kouteki moved this from Triage to In Review in 🧙‍♂️gno.land core team Jun 30, 2025
@Kouteki Kouteki added this to the 🚀 Mainnet beta launch milestone Jun 30, 2025
Copy link
Member

@gfanton gfanton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice 👍

@jefft0 jefft0 removed the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Jul 17, 2025
@alexiscolin
Copy link
Member Author

alexiscolin commented Jul 17, 2025

I just added a selectbox

Capture d’écran 2025-07-17 à 23 19 06

moul added a commit that referenced this pull request Jul 18, 2025
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]>
moul added a commit to thehowl/gno that referenced this pull request Jul 19, 2025
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]>
@gfanton gfanton merged commit 60d520c into gnolang:master Jul 23, 2025
101 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in 💪 Bounties & Worx Jul 23, 2025
stefann-01 pushed a commit to stefann-01/gno that referenced this pull request Aug 26, 2025
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]>
stefann-01 pushed a commit to stefann-01/gno that referenced this pull request Aug 26, 2025
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"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌍 gnoweb Issues & PRs related to gnoweb and render 📦 ⛰️ gno.land Issues or PRs gno.land package related 🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants