Skip to content

fix: render human-readable Event name in diagrams#601

Merged
fgmacedo merged 3 commits intodevelopfrom
fix/event-humanized-name
Mar 21, 2026
Merged

fix: render human-readable Event name in diagrams#601
fgmacedo merged 3 commits intodevelopfrom
fix/event-humanized-name

Conversation

@fgmacedo
Copy link
Owner

Summary

Fixes #600

  • Event.name is now auto-generated as a humanized form of the id (split by _ and ., first word capitalized) instead of echoing the raw identifier. Explicit name= passed by the user is preserved.
  • Diagrams (DOT, Mermaid) and text formats (markdown/rst tables) now display event.name instead of event.id.
  • Unified the humanization logic between Event and State into a shared humanize_id() in utils.py (compiled regex).

Before

State Event Guard Target
Green cycle Yellow

After

State Event Guard Target
Green Cycle Yellow

Event.name is now auto-generated as a humanized form of the id (split
by _ and . separators, first word capitalized) instead of echoing the
raw identifier. Explicit name= passed by the user is preserved.

- Add humanize_id() in utils.py (compiled regex, shared by Event and
  State)
- Remove redundant name= from Event call sites in factory, events,
  and SCXML actions so auto-generation kicks in
- Use event.name in diagram labels (_format_event_names)
- Update docs and tests to reflect humanized names

Closes #600
@codecov
Copy link

codecov bot commented Mar 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (67f2b0d) to head (28a3308).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff            @@
##           develop      #601   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           42        42           
  Lines         5007      5015    +8     
  Branches       810       810           
=========================================
+ Hits          5007      5015    +8     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud
Copy link

@fgmacedo fgmacedo merged commit ee3607a into develop Mar 21, 2026
14 checks passed
@fgmacedo fgmacedo deleted the fix/event-humanized-name branch March 21, 2026 16:12
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.

Render Event human readable name

1 participant