Add a WinForms Dialog (runbook)
Create a new dialog that matches the codebase's conventions. Follow in order.
Steps
- Pick the base class (see ui-composition):
- Repo-aware dialog → derive from
GitModuleForm(givesUICommands/Module). - Standard dialog chrome → derive from / use
GitExtensionsDialog. - A panel/control → derive from
GitModuleControl. - NEVER derive directly from raw
Form.
- Repo-aware dialog → derive from
- Place the files under
src/app/GitUI/CommandsDialogs/(or a suitable subfolder):Form<Name>.cs,Form<Name>.Designer.cs,Form<Name>.resx. - Name controls per ui_design_guidelines.md:
btn,lbl,txt,cbx,chk,rb,gbx,tlpnl,flpnl,lnk, … - Talk to git only through
UICommands/Module; build commands withCommands.*(structuredIGitCommandpreferred). NEVERnewaGitModuleor spawngitdirectly. - Localize: make every user-facing string a
TranslationString, then run the add-translation-strings runbook (update-loc.cmd). - Hotkeys (if any): register via
HotkeySettingsManager, not hardcoded key handling (see hotkey-system). - Refresh: after a state-changing action, call
UICommands.RepoChangedNotifier.Notify().
Verify
dotnet build /v:qsucceeds; control names follow the prefixes.English.xlfupdated (localization gate).- UI touched only on the UI thread (threading-model).
STOP conditions
- Deriving from raw
Form, hardcodedColors (useAppColor), or raw git command strings → fix before proceeding. - Add a unit test if the dialog builds git arguments via
Commands.*.