Files
leocad/common/AGENTS.md
T
Leonardo Zide 554c1d28a7 Add contextual help to Array and Save Image dialogs
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.
2026-10-22 15:14:11 -07:00

2.2 KiB

Code instructions

  • Keep the file lists in leocad.pro alphabetically 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() and lcstrcat() from lc_string.h for bounded C-string copies and concatenation. Use the array overloads when possible; avoid strncpy() plus manual null termination. Keep standard functions where no suitable lc helper exists.
  • Avoid using auto for 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() and unlock() over an extra scope with QMutexLocker for short, straight-line critical sections that must end before the following code. Keep QMutexLocker for 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.md when 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.