Thank you for your interest in contributing to MermaidPad! Your time and effort are valued — and contributors of all experience levels are welcome. 🎉🚀
This document outlines how to contribute effectively and consistently.
- Getting Started
- Development Environment
- Branching & Workflow
- Coding Guidelines
- Cross-Platform Responsibility
- Async & UI Thread Expectations
- Testing Requirements
- Pull Requests
- Issue Reporting
- Commit Messages
- Code of Conduct
Before working on the project:
- Familiarize yourself with MermaidPad’s purpose and features.
- Read through this file and the README.md.
- Review open issues or Discussions to avoid duplicated work.
If you’re unsure where to start, feel free to open a Discussion — we’re friendly!
MermaidPad requires:
- .NET 9 SDK
- Avalonia as the UI framework
- ESLint 9+ for validating embedded JavaScript assets (when applicable)
No Node.js runtime is required unless you are modifying JavaScript packages that themselves require it.
To keep history clean and conflict-free:
- Base new branches on develop
- Use git rebase instead of merge when updating your branch
- All pull requests must target develop
main → stable releases
develop → active development
feature/* → individual contribution work
bugfix/* → individual contribution work
Maintain code style consistency unless:
- A pattern is provably flawed, or
- You have a clear reason to improve it.
If you spot inconsistencies or technical debt, feel free to open an issue or Discussion.
Prefer async I/O and background work to avoid blocking the UI.
Instead, use MVVM bindings and commands to keep UI logic in ViewModels. This project uses the MVVM pattern extensively via:
There should be very few cases where code-behind is necessary. If you find yourself needing to add code-behind logic, please reach out in the Issue you are working on - or start a Discussion first to ensure it aligns with project conventions.
There are plenty of examples in the codebase demonstrating proper MVVM usage. It uses DataBinding with RelayCommand.
Here are some places in the code to look at:
MermaidPad runs on Windows, macOS, and Linux. Avoid using OS-specific APIs directly in application code.
If OS-specific functionality is required, route it through:
WindowsPlatformServicesLinuxPlatformServicesMacPlatformServices
These are located under Services/Platforms.
This keeps platform differences contained and prevents regressions.
This is important:
Any code that interacts with UI or ViewModel objects must run on the UI thread.
Examples in the project demonstrate:
- Posting UI updates from background operations
- Dispatching async callbacks correctly
- Avoiding deadlocks on Avalonia’s UI scheduler
If you’re unsure, search the codebase for existing async patterns and match them.
All changes must be tested using both:
- DEBUG build
- RELEASE build
Release builds behave differently (trimming, optimizations, etc.) and can reveal issues that debug builds hide.
Instructions for building publishable artifacts are in README.md → Building & Publishing.
Additionally:
- Test on at least one desktop OS
- If you touched platform-specific code, test on multiple OSes where possible
Before submitting a PR:
No merge commits, please.
If your modification triggers new Roslyn warnings, address them before opening the PR.
ESLint v9+ should report zero errors or warnings.
Small, single-responsibility PRs are easier to review and merge.
Visual changes are much easier to evaluate when screenshots are provided.
When reporting an issue:
- Provide OS version
- Provide CPU architecture
- Include steps to reproduce
- Include logs if applicable
- Add screenshots when relevant
- Indicate whether the issue is reproducible (always, intermittent, rare, etc.)
The issue templates in .github/ISSUE_TEMPLATE/ will guide you.
Important
- Every commit message should reference the Issue it relates to.
- Avoid vague messages like "Fix bug" or "Update code".
Clear commit messages help maintain a readable history.
You can do either of the following:
-
Use AI generated commit messages based on your changes
-
or follow this pattern:
Short summary of the change Issue #<issue-number> Detailed explanation (optional) - Why the change was made - What problem it solves - Relevant context or links
Examples:
Fix: handle large mermaid diagrams without UI freeze. Resolves Issue #123Refactor: consolidate Linux clipboard integration. Resolves Issue #456Feature: improved tab persistence across sessions. Resolves Issue #789
Be kind, be respectful, and act professionally. We’re building a community together — empathy and clarity matter. See the CODE_OF_CONDUCT.md for details.
Your contributions — small or large — help improve MermaidPad for everyone. Thank you again for helping make the project better! 🙌