Skip to content

Guard schematic TextColor access without stopping Altium polling - #38

Closed
TerrenceHenry wants to merge 1 commit into
salitronic:mainfrom
TerrenceHenry:fix/altium-textcolor-guard
Closed

TerrenceHenry wants to merge 1 commit into
salitronic:mainfrom
TerrenceHenry:fix/altium-textcolor-guard

Conversation

@TerrenceHenry

@TerrenceHenry TerrenceHenry commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Querying TextColor on a schematic power object raised an Undeclared identifier: TextColor modal on Altium 21.4.1.30 and stopped polling. The getter, setter, filters and creation paths could reach the same unsupported member.

Allow TextColor only on the documented port, sheet-entry and harness-entry interfaces, and access it through typed locals. Unsupported query fields remain empty with unreadable diagnostics; project queries now include those diagnostics too. Filters refuse known unsupported properties before comparison, so TextColor= cannot match an unreadable value. Modification preflights the complete assignment list before moving or recolouring an object; creation uses the existing single refusal and indexed batch-failure format. Independent valid batch items continue.

The assignment preflight also protects the already-guarded Text/IsHidden pairs. It does not make arbitrary writes transactional or claim a complete property capability map. Script version is bumped to 2026.10.03.1; reload the script project or restart Altium before acceptance.

Closes #37.

Validation:

  • DelphiScript lint: 11 files, zero errors or warnings; script bundle build passed.
  • Focused property/lint suite: 53 passed, 3 skipped for unavailable local Free Pascal. Source-mutation tests detect removed read/write guards, admitting power objects, direct generic-member access and removed preflight checks.
  • Upstream CI passed: the main suite reports 5,631 passed, 104 skipped and 1 xfailed; the Free Pascal 3.2.2 job reports 70 passed with no skips, including production guard/filter and creation tests. CI run.
  • Full offline suite: 5,408 passed, 147 skipped, 1 xfailed, 6 initial failures. Five were nested pytest temporary-directory access failures; one exposed a stale release-document version expectation. After directing nested processes to a writable scratch directory and updating the expectation, all 11 tests in the affected files passed. Final version/property checks: 34 passed, 3 compiler-dependent skips.
  • Live acceptance passed on Altium 21.4.1.30 with running script 2026.10.03.1 on 2026-10-03, using a disposable schematic and explicit scratch-project scope. Power-object and net-label TextColor queries returned empty fields plus unreadable diagnostics without a modal or polling stop; project-scope diagnostics also passed. Empty and numeric unsupported filters matched zero objects; delete with TextColor= left the power object intact. Single and batch mixed writes rejected TextColor and preserved Color and position; a valid independent batch write applied. Single invalid creation was refused; mixed creation produced exactly two valid objects and indexed failures for items 0 and 2. Port and sheet-entry TextColor values read back as 16711680 after save, close and reopen, including supported-property filters. Ping continued after rejected operations. Scratch documents/project were closed; original editor restored; 32 original documents remained with no unsaved documents. Polling was stopped afterwards through the dashboard.

Limits and related observation: harness-entry round trips were not performed because the generic object-type mapping does not expose that owner and no fixture was available; its owner guard is covered by the compiler job. Existing batch-modify diagnostics are cumulative: a later valid item inherits a failure note although its write readback passes. This reporting issue is outside the TextColor crash fix. Upstream CI and the live acceptance cases above are complete.

@TerrenceHenry
TerrenceHenry marked this pull request as ready for review October 3, 2026 19:17
@salitronic

Copy link
Copy Markdown
Owner

Thanks Terrence, merged as 4c2e274 with your authorship. I resolved the conflicts with the latest main and bumped the script to 2026.10.05.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Guard schematic TextColor access to prevent script modal failures

2 participants