Skip to content

fix: render text inside containers with mixed-case fractional indices#24

Merged
JonRC merged 2 commits intomainfrom
fix/text-not-shown-in-containers
Feb 10, 2026
Merged

fix: render text inside containers with mixed-case fractional indices#24
JonRC merged 2 commits intomainfrom
fix/text-not-shown-in-containers

Conversation

@JonRC
Copy link
Copy Markdown
Owner

@JonRC JonRC commented Feb 10, 2026

Summary

  • Fix element z-order sorting that caused text inside containers to be invisible
  • localeCompare() sorts uppercase after lowercase in many locales, reversing the intended order of Excalidraw's fractional indices (e.g., container "b1QV" sorted after text "b1Ql", drawing the filled container on top of the text)
  • Replace with simple < / > ASCII comparison, matching the original Excalidraw's orderByFractionalIndex()

Test plan

  • Verify contained-text fixture renders all 3 text labels inside containers
  • All existing tests pass (97 tests across 7 suites)
  • Chargeback flow diagram text now visible

localeCompare() sorts uppercase after lowercase in many locales,
reversing the intended z-order of Excalidraw's fractional indices.
This caused text inside containers to render behind the container's
filled background, making it invisible.

Replace with simple < / > comparison, matching the original
Excalidraw's orderByFractionalIndex() implementation.
Generated via Docker for the new contained-text fixture that
verifies text renders inside filled containers with mixed-case
fractional indices.
@JonRC JonRC merged commit 4cc1896 into main Feb 10, 2026
7 checks passed
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.

1 participant