opentui icon indicating copy to clipboard operation
opentui copied to clipboard

refactor(renderer): Separate render loop from single frame rendering

Open SyedaAnshrahGillani opened this issue 4 months ago • 1 comments

This pull request refactors the CliRenderer to improve code clarity and maintainability.

The core rendering logic has been extracted from the loop() method into a new private method called _renderFrame().

This change allows renderOnce() to directly call the rendering logic without invoking the entire loop, which is more efficient and semantically correct. The loop() method now focuses on its primary responsibility: managing the rendering loop and scheduling frames.

This refactoring improves the overall structure of the CliRenderer and makes the code easier to understand and maintain. No functional changes are introduced.

SyedaAnshrahGillani avatar Jul 31 '25 13:07 SyedaAnshrahGillani

Hey, thanks for contributing! I see your concerns. I need to test this.

For me the loop() method is basically the render method, just running one cycle. Extracting that would still need to take care of the deltaTime though, should not just be 0.

kommander avatar Jul 31 '25 18:07 kommander