The imperial list ran the architectural scales from 1'=1'-0" down to
1/128"=1'-0", then restarted at 1"=10' for the engineering scales. Merge
both groups into a single sequence ordered by ratio, largest scale first.
The metric list was already ordered by ratio and is unchanged.
Also fix the enum cache invalidation, which compared the cached list's
length against hardcoded 13/31 while the imperial list has 32 entries, so
switching a scene from imperial back to metric kept showing imperial
scales. Track the unit system the cache was built for instead.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Closes #9356.
The imperial scale list in get_diagram_scales() was stored as two consecutive blocks — architectural scales from 1'=1'-0" (1/1) down to 1/128"=1'-0" (1/1536), then engineering scales restarting at 1"=10' (1/120) and running to 1"=500' (1/6000) — so the dropdown descended, jumped back up, and descended again.
Both groups are now merged into a single sequence ordered by ratio, largest scale first, so e.g. 1"=10' (1/120) sits between 1/8"=1'-0" (1/96) and 3/32"=1'-0" (1/128). Same 31 entries, reordered only — no scales added or removed.
The metric list was already ordered by ratio and is unchanged.
Also fixes the secondary bug described in the issue: the enum cache was invalidated by comparing the cached list's length against hardcoded 13/31, but the imperial list has 32 entries, so the metric branch never fired and switching a scene from imperial back to metric kept showing imperial scales. It now records which unit system the cache was built for, which also won't go stale if entries are added later. purge() resets it alongside the list.
🤖 Generated with Claude Code