mirror of
https://github.com/leozide/leocad.git
synced 2026-10-26 22:10:32 +00:00
Explain array counts, offsets, rotations, image dimensions, file naming, and step ranges with translated tooltips and contextual help. Give both dialogs a standard Help button and dialog-scoped F1 support that falls back from the focused control through its parent groups to the overview. Link image field labels to their buddies and share tooltip and field help text. Add accessible names for unlabeled controls. Document the writing and maintenance conventions, with concise guidance in the existing AGENTS.md. Refresh all eight language catalogs while preserving existing translations and review status. The 62 new help and accessibility strings remain unfinished pending translation. Validation: Qt 6.10 debug build; runtime checks for seven F1 routes, Help, Escape, dialog state, spin-box focus, and five label buddies with matching help; visual layout inspection; catalog coverage for all 2,118 active source messages and existing translation preservation; git diff --check.
2.2 KiB
2.2 KiB
Code instructions
- Keep the file lists in
leocad.proalphabetically sorted within their existing groups. - Get Qt and std includes through the precompiled header,
lc_global.h. - Prefer std containers, use Qt containers where a Qt API boundary makes them useful.
- Prefer
lcstrcpy()andlcstrcat()fromlc_string.hfor bounded C-string copies and concatenation. Use the array overloads when possible; avoidstrncpy()plus manual null termination. Keep standard functions where no suitablelchelper exists. - Avoid using
autofor ordinary variable types. Template iterators, lambdas, and structured bindings may use it for readability. - Do not nest ternary expressions. Use explicit branches when a choice needs another condition.
- Prefer a private static member function over a file-scope helper when the function belongs to a class and does not use instance state.
- Prefer explicit
lock()andunlock()over an extra scope withQMutexLockerfor short, straight-line critical sections that must end before the following code. KeepQMutexLockerfor early returns, waits, or nontrivial control flow. - Preserve existing blank lines when editing code. Prefer blank lines between declarations and following logic, and between distinct logical steps; do not remove user-added blank lines without a specific reason.
- When adding a parameter to an existing function, update every call site explicitly instead of adding a default argument to preserve old calls.
Commit Messages
- Every nontrivial commit must have a concise subject and a descriptive body.
- Explain the problem or trigger, why the change is needed, and how the resulting behavior addresses it.
- Write for a future maintainer without access to the chat. Do not merely restate the diff or include conversational history.
- Subject-only messages are acceptable for purely mechanical changes.
Dialog help and translations
- Follow
docs/dialog-help.mdwhen adding or changing dialog controls, including help text, label buddies, and Help/F1 behavior. - Keep UI strings translatable and refresh affected catalogs. Preserve existing translations and review status; leave new untranslated or generated translations unfinished.