Skip to content

Conversation

@deanlee
Copy link
Contributor

@deanlee deanlee commented Nov 18, 2025

Extracts all debug-only functionality into a new DebugGuiApplication subclass and keeps GuiApplication focused on production behavior.

Key changes:

  • Move debug-only features (scaling, render texture, burn-in shader, touch overlay, grid, profiling) into a new DebugGuiApplication subclass.
  • Keep GuiApplication minimal and focused on release behavior (scale 1.0, no debug overlays).
  • Add a lazy factory in application.py that instantiates DebugGuiApplication for debug and GuiApplication otherwise.

Benefits:

  • Lower runtime overhead in production (no unnecessary debug checks or rendering).
  • Cleaner architecture and easier long-term maintenance.

@github-actions github-actions bot added the ui label Nov 18, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 18, 2025

raylib UI Preview

All Screenshots

@deanlee deanlee force-pushed the ui-app-debug branch 2 times, most recently from bd019c5 to 60ae3dc Compare November 18, 2025 09:59
@deanlee deanlee marked this pull request as ready for review November 18, 2025 10:06
@deanlee deanlee force-pushed the ui-app-debug branch 4 times, most recently from 5991055 to e8af0e8 Compare November 19, 2025 14:06
Comment on lines +482 to +491
# Lazy factory to create the app
def _create_gui_app(width=None, height=None):
is_release = Params().get_bool("IsReleaseBranch")
if not is_release:
from openpilot.system.ui.lib.debug_application import DebugGuiApplication
return DebugGuiApplication(width, height)

return GuiApplication(width, height)

gui_app = _create_gui_app()
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I like the two paths this way. It should definitely at least be behind a flag, not release param

@sshane
Copy link
Contributor

sshane commented Nov 27, 2025

We can split out debugging code for clarity, but let's not over optimize too much (like two mouse initializers)

@deanlee deanlee closed this Dec 5, 2025
@deanlee deanlee deleted the ui-app-debug branch December 5, 2025 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants