Skip to content

WIP RichTextEditor docs#916

Open
luke-whos-here wants to merge 6 commits intomainfrom
v12-richtexteditor-docs
Open

WIP RichTextEditor docs#916
luke-whos-here wants to merge 6 commits intomainfrom
v12-richtexteditor-docs

Conversation

@luke-whos-here
Copy link
Copy Markdown
Contributor

@luke-whos-here luke-whos-here commented Mar 17, 2026

Currently WIP

This PR adds new documentation for the RichTextEditor.

  • Adds a main reference page under the /controls directory.
  • Adds a troubleshooting page under the /troubleshooting directory.
  • Crosslinks the new pages.
  • Displays the new pages on the sidebars.
  • Adds Avalonia.Controls.RichTextEditor to available packages listed on the Accelerate installation page.
  • Adds the new samples to the Samples page.

Further edits on RichTextEditor control doc. Add new Troubleshooting doc.
Further edits to main reference and troubleshooting pages. Add paths to sidebar. Add samples to Samples and Tutorials page.
@luke-whos-here luke-whos-here changed the title WIP RichTextditor docs WIP RichTextEditor docs Mar 17, 2026
Comment on lines +297 to +306
## Performance checklist

- Batch all multi-edit operations
- Use `UpdateFinished` instead of `Changed` for expensive operations
- Debounce user-triggered updates
- Set appropriate `UndoLimit` on the editor
- Disable undo during bulk loads
- Use background threads for serialization
- Minimize pointer allocations
- Profile before optimizing
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This could work better placed earlier in the document, perhaps after "Core performance characteristics"?

Comment on lines +351 to +370
## Debugging threading issues

### Enable thread assertions

Avalonia has built-in thread checking:

```csharp
// Throws if not on UI thread
Dispatcher.UIThread.VerifyAccess();
```

### Common exceptions

**InvalidOperationException**: "The calling thread cannot access this object because a different thread owns it."
- **Cause**: Accessing UI thread object from background thread
- **Fix**: Use `Dispatcher.UIThread.InvokeAsync()`

**NullReferenceException** when accessing `Element`
- **Cause**: Weak reference collected or background thread access
- **Fix**: Check null and ensure UI thread
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Would this make more sense on the Troubleshooting page?

Comment on lines +155 to +157
| `MarkdownCodeBlockParagraphPadding` | Thickness | `16` | — | Inner padding |
| `MarkdownCodeBlockParagraphBorderThickness` | Thickness | `1` | — | Border thickness |
| `MarkdownCodeBlockParagraphCornerRadius` | CornerRadius | `6` | — | Corner radius |
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Does this mean the default dark setting is the same as default light, or that no default is defined for dark mode?

Comment on lines +204 to +209
| `MarkdownQuoteBlockSectionBorderThickness` | Thickness | `4,0,0,0` | — | Quote block left border thickness |
| `MarkdownQuoteBlockSectionBorderBrush` | Brush | `#DDDDDD` | `#3b434b` | Quote block border brush |
| `MarkdownQuoteBlockSectionForeground` | Brush | `#777777` | `#8b949e` | Quote block foreground color |
| `MarkdownQuoteBlockSectionPadding` | Thickness | `15,0` | — | Quote block inner padding |
| `MarkdownQuoteBlockFirstChildSectionMargin` | Thickness | `0,0,0,14` | — | Margin for first child in quote |
| `MarkdownQuoteBlockLastChildSectionMargin` | Thickness | `0` | — | Margin for last child in quote |
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same as the above table. Would be nice to clarify whether Thickness properties in dark mode share the light mode defaults, or actually have no defaults.

Comment on lines +216 to +219
| `MarkdownTableBorderThickness` | Thickness | `0,0,1,1` | — | Table outer border thickness |
| `MarkdownTableCellSpacing` | Double | `0` | — | Cell spacing |
| `MarkdownTableCellBorderThickness` | Thickness | `1,1,0,0` | — | Cell border thickness |
| `MarkdownTableCellParagraphPadding` | Thickness | `12,5` | — | Cell paragraph padding |
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same comment as previous re: dark mode defaults.

| `MarkdownAlertBlockWarningParagraphForeground` | Brush | `#9a6700` | `#d29922` | Warning alert paragraph foreground |
| `MarkdownAlertBlockCautionBorderBrush` | Brush | `#d1242f` | `#f85149` | Caution alert border brush |
| `MarkdownAlertBlockCautionParagraphForeground` | Brush | `#d1242f` | `#f85149` | Caution alert paragraph foreground |
| `MarkdownAlertBlockHeaderMargin` | Thickness | `0 0 0 8` | — | Alert header margin |
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same comment as previous re: dark mode defaults.

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.

2 participants