Skip to content

Conversation

viktorSoftDev
Copy link
Contributor

📝 Description

This PR adds comprehensive task list (checkbox) support to the limel-text-editor component. Users can now create, interact with, and manage task lists with native HTML checkboxes, full keyboard navigation, and markdown support.

✨ Features Added

Core Task List Functionality

  • Interactive checkboxes: Native HTML <input type="checkbox"> elements that respond to clicks
  • Keyboard navigation: Full support for Enter, Tab/Shift-Tab, and arrow key navigation
  • Toolbar integration: Task list button in the editor toolbar with keyboard shortcut
  • Markdown support: Parsing and serialization of GitHub Flavored Markdown task list syntax (- [ ] and - [x])

ProseMirror Integration

  • Custom schema: task_list and task_list_item node types with proper DOM parsing
  • Node views: Custom TaskListItemView for interactive checkbox rendering
  • Commands: Integration with prosemirror-schema-list for list operations
  • Plugins: Dedicated plugins for Enter key handling and Tab indentation

Enhanced User Experience

  • Visual styling: Consistent appearance with other form elements
  • Indentation support: Tab/Shift-Tab for nesting task list items
  • Focus management: Proper focus handling when navigating between checkboxes and content
  • Accessibility: ARIA attributes and semantic HTML structure

🎯 Usage

Basic Usage

<limel-text-editor
    value="- [ ] Unchecked task\n- [x] Completed task"
    contentType="markdown"
/>

Keyboard Shortcuts

  • Insert task list: Ctrl/Cmd + Shift + 9
  • New task item: Enter (when cursor is in a task list item)
    Indent/outdent: Tab / Shift+Tab
    Toggle checkbox: Click on checkbox or Space when focused

✅ Testing

  • Manual testing of all keyboard interactions
  • Checkbox click handling verification
  • Markdown parsing and serialization testing
  • Toolbar integration testing
  • Focus management validation
  • Cross-browser compatibility verified
  • Example component functionality confirmed

- Add task list schema with proper parseDOM and toDOM mappings
- Add task list item schema with checked attribute support
- Add task list commands for creation and toggling
- Add task list plugin with Enter key handling
- Add task list node view with interactive checkboxes
- Add task list styling with bullet suppression
- Add task list menu command with active state detection
- Add task list menu item with checkbox icon to toolbar
- Add task list to EditorMenuTypes for type safety
- Add translations for task list button in EN, NO, and SV
- Add task list schema to ProseMirror document schema
- Register task list item node view for interactive checkboxes
- Add task list plugin to editor plugin chain
- Import task list styles into main adapter stylesheet
- Add task list serialization to markdown (- [ ] and - [x] syntax)
- Extend markdown parser whitelist for task list classes and input elements
- Add support for remark-gfm generated contains-task-list class
- Add HTML transformation to wrap task list text in paragraph elements
- Enable bidirectional conversion between markdown and task lists
- Add universal list indentation plugin for both regular and task lists
- Support Tab key to indent (nest deeper) list items
- Support Shift-Tab key to outdent (nest shallower) list items
- Maintain editor focus when Tab is pressed outside list contexts
- Use dedicated task list commands for proper indentation handling
- Add comprehensive task list example component with markdown content
- Include example of both task lists and regular lists for comparison
- Add keyboard shortcuts documentation in example
- Add task list example reference to text editor component documentation
Update package-lock.json with dependency changes from task list implementation
Copy link

coderabbitai bot commented Sep 30, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/yet-another-checklist

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
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

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

@viktorSoftDev
Copy link
Contributor Author

Had a little (read a lot of) help from a co-driver creating this hack ✅✅✅

Copy link

Documentation has been published to https://lundalogik.github.io/lime-elements/versions/PR-3690/

- Remove bullet points from task list items
- Add flexbox layout for proper checkbox and text alignment
- Make checkboxes interactive and properly styled
- Remove paragraph wrapping that caused text to appear on new lines
- Add hover and focus states for better UX
- Update composite example to showcase task list functionality

Fixes issues where:
- Task list checkboxes appeared disabled/non-clickable
- Text content wrapped to new lines
- Bullet points still appeared alongside checkboxes
- Remove disabled attribute from GFM-generated checkboxes to make them interactive
- Add taskListChange event emitter to limel-markdown component
- Implement checkbox click handlers that update source markdown text
- Add two-way binding in composite example for real-time sync
- Parse task list positions and map to corresponding markdown lines
- Support nested task lists with proper indentation preservation
- Use safe regex patterns to avoid backtracking vulnerabilities

Interactive features:
- Click checkboxes in rendered markdown to toggle state
- Automatically updates source markdown (- [ ] ↔ - [x])
- Real-time sync between textarea and rendered output
- Preserves indentation and formatting in nested lists

Fixes the core issue where remark-gfm generates disabled checkboxes by default,
making them truly interactive for task management workflows.
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