Thank you for contributing to HTWind. This guide explains the expected workflow, quality standards, and review checklist for contributors.
- Scope and Principles
- Ways to Contribute
- Development Prerequisites
- Repository Setup
- Build and Run
- VS Code Tasks
- Project Structure at a Glance
- Branching and Commit Guidelines
- Code Quality Guidelines
- Pull Request Guidelines
- Pull Request Template
- Validation Checklist
- Manual Test Scenarios
- Widget Contribution Guidelines
- Widget Submission Checklist
- Localization Contribution Guidelines
- Localization Checklist
- Security and Safety Notes
- Packaging Locally
- Reporting Bugs and Requesting Features
- Review and Merge Expectations
- License and Attribution
HTWind is a .NET 10 WPF desktop application that hosts HTML widgets.
Contributions should preserve existing behavior and follow these principles:
- Keep changes focused and minimal.
- Prefer maintainable solutions over quick workarounds.
- Preserve architecture boundaries.
- Avoid introducing breaking changes without a clear migration note.
- Document user-visible behavior changes.
Project-specific expectations:
- Keep business logic out of heavy UI event handlers.
- Prefer interface-based services (
I*) for new dependencies. - Keep code and inline comments in English.
- In XAML, avoid hard-coded UI strings and prefer localization resources.
You can contribute in many ways:
- Bug fixes
- New built-in widgets
- Host API improvements
- UI/UX improvements for WPF screens
- Stability/performance improvements
- Documentation and localization updates
- Maintainability and testability improvements
- Windows 10/11
- .NET SDK 10.0+
- Git
- Optional: VS Code with C# tooling
- Fork the repository.
- Clone your fork.
- Create a feature branch.
git clone https://github.com/<your-user>/HTWind.git
cd HTWind
git checkout -b feat/short-descriptionRun from repository root:
dotnet restore HTWind/HTWind.csproj
dotnet build HTWind/HTWind.csproj
dotnet run --project HTWind/HTWind.csprojOptional cleanup:
dotnet clean HTWind/HTWind.csprojThe workspace includes tasks for common operations:
restore HTWindbuild HTWindrun HTWindclean HTWindpackage HTWind installer (local)package HTWind portable (local)package HTWind all (local)
Run tasks from Terminal -> Run Task....
Main folders:
HTWind/Views: WPF windows and visual layerHTWind/ViewModels: presentation logicHTWind/Services: app, widget, and platform servicesHTWind/Templates: built-in HTML widgetsHTWind/Resources: localization resourcesscripts: local packaging scripts
Keep changes within the existing responsibility boundaries.
Recommended branch naming:
feat/<short-description>fix/<short-description>docs/<short-description>refactor/<short-description>
Commit recommendations:
- Write clear, imperative commit messages.
- Keep commits small and logically focused.
- Avoid mixing refactor-only and behavior-changing edits in one commit.
Examples:
fix: prevent widget resize handle from disappearingdocs: expand contributing guidefeat: add built-in drive health widget
General expectations:
- Favor small, focused methods and classes.
- Avoid magic strings/numbers when practical.
- Use null and argument guards where appropriate.
- Handle file system, registry, and OS-dependent operations defensively.
WPF-specific expectations:
- Keep UI responsive; do not block the UI thread with long-running work.
- Keep user-facing text localizable.
- Preserve accessibility basics (tooltips, keyboard navigation, readable layouts).
Architecture expectations:
- Prefer constructor-injected dependencies.
- Extend behavior through services/interfaces when possible.
- Avoid broad, unrelated refactors in bugfix PRs.
Before opening a PR:
- Rebase or merge latest upstream changes.
- Ensure local build succeeds.
- Review your diff for unrelated changes.
- Update docs/localization when behavior or text changes.
PR description should include:
- What changed
- Why it changed
- How it was tested
- Known risks or limitations
- Screenshots/GIFs for UI changes
Keep PRs focused. Smaller PRs are safer and faster to review.
You can use this template:
## Summary
- What changed
## Motivation
- Why this change is needed
## Testing
- Commands run
- Manual scenarios validated
## Impact
- User-visible impact
- Risk and rollback notes
## Screenshots (if UI change)
- Before/after visualsUse this checklist before opening or updating a PR:
dotnet build HTWind/HTWind.csprojsucceeds.- No obvious nullability or analyzer regressions are introduced.
- New/changed UI text is localized where applicable.
- No regression in tray behavior, startup behavior, or widget persistence.
- Documentation is updated for user-visible changes.
Run relevant manual checks based on your change scope:
- Launch app, add a widget, close app, relaunch, verify state restore.
- Toggle widget
Visible,Locked, andPin on topcontrols. - Verify tray icon actions (show/hide/exit).
- Open editor and validate save/live preview behavior.
- Validate localization rendering if text/resource keys changed.
- Validate host bridge behavior if PowerShell execution logic changed.
Built-in templates live in HTWind/Templates.
When adding or updating a widget:
- Keep widget HTML/CSS/JS self-contained when possible.
- Avoid unnecessary external dependencies.
- Ensure expected state survives app restart.
- Document host bridge usage clearly.
For widgets using host bridge:
- Supported call is
window.HTWind.invoke("powershell.exec", args). - Keep commands intentionally scoped.
- Respect output/timeout boundaries (
maxOutputChars,timeoutMs). - Avoid risky default scripts.
Before opening a widget-focused PR:
- Widget has a clear name and purpose.
- Markup is readable and reasonably formatted.
- No private/local absolute path dependency exists.
- External APIs/services are documented.
- Error and empty states are handled gracefully.
- Widget behavior is verified after fresh launch.
HTWind uses HTWind/Resources/Strings.resx and localization services.
To add a language:
- Create
Strings.<culture>.resxinHTWind/Resources. - Copy all keys from
Strings.resx. - Translate values only.
- Keep placeholders and formatting tokens unchanged.
- Build and test.
For local verification, temporarily switch startup culture in HTWind/App.xaml.cs and run the app.
- Keys are unchanged and aligned with
Strings.resx. - Placeholders and interpolation tokens are preserved.
- UI tone and punctuation are consistent.
- Longer translations are checked for overflow/truncation.
- New user-facing strings are added to resources.
HTWind supports PowerShell execution through host bridge. Contributors should avoid lowering the safety posture:
- Do not broaden execution capabilities casually.
- Keep user intent explicit for potentially destructive actions.
- Document behavior changes affecting command execution.
If you discover a security issue, do not publish exploit details in a public issue. Open a private report to the maintainer first.
Security report should include:
- Affected component
- Reproduction steps
- Potential impact
- Suggested mitigation (if available)
Terminal scripts:
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/package-installer.ps1
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/package-portable.ps1Or use VS Code tasks listed above.
Use GitHub Issues and include:
- Reproduction steps
- Expected behavior
- Actual behavior
- Environment details (Windows version, .NET SDK, app version)
- Screenshots/log snippets where relevant
Links:
- Issues: https://github.com/sametcn99/HTWind/issues
- Discussions: https://github.com/sametcn99/HTWind/discussions
- Maintainers may request smaller scope for oversized PRs.
- Requested changes should be addressed with focused follow-up commits.
- If a large rewrite is pushed, summarize it in a PR comment.
- Merge timing depends on risk, reviewer availability, and release timing.
By contributing, you agree that your contribution is licensed under the repository license. If third-party code/assets are included, ensure compatibility and provide attribution when required.
Thank you for helping improve HTWind.