Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce Message structs #873

Merged
merged 1 commit into from
Jan 21, 2025
Merged

introduce Message structs #873

merged 1 commit into from
Jan 21, 2025

Conversation

panentheos
Copy link
Collaborator

Summary of changes

This introduces a new Message protocol and associated structs as part of the ongoing refactoring effort. These new structs represent a piece of sign content at a purely semantic level, in contrast with the existing Content.Message structs which encode more concrete, line-level content. The new protocol allows these abstract messages to be "rendered" into various concrete visual (and eventually audio) forms.

Conceptually, message generation is broken into several steps: First, generate the abstract messages to display. Then, optionally transform these messages, e.g. to combine headway or alert statuses. Finally, render the messages into actual line content, including flipping, shortening, or paging as needed.

One immediate benefit of this change is that the message generation algorithm is no longer split between the platform and mezzanine cases. A followup PR will leverage this new framework to generate audio messages as well.

Note that although we still assume we're dealing with at most 2 messages, nothing about this approach specifically requires that. It would be reasonably straightforward to support more messages at some point by rewriting transform_messages and render_messages accordingly.

@panentheos panentheos requested a review from a team as a code owner January 16, 2025 19:06
@PaulJKim
Copy link
Collaborator

This is looking great to me! I'll take another look in the AM during the usual code review block but not seeing any concerns

Copy link
Collaborator

@PaulJKim PaulJKim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Looks great!

@panentheos panentheos merged commit 09d9770 into main Jan 21, 2025
2 checks passed
@panentheos panentheos deleted the bhw/message-structs branch January 21, 2025 14:03
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.

2 participants