[PR #7] refactor(renderer): Separate render loop from single frame rendering #215

Open
opened 2026-03-02 23:45:27 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/7
Author: @SyedaAnshrahGillani
Created: 7/31/2025
Status: 🔄 Open

Base: mainHead: feature/animation-loop-refactor


📝 Commits (2)

  • f608455 refactor: Use for...of loop for animation frame requests
  • f82c5e2 refactor(renderer): separate render loop from single frame rendering

📊 Changes

1 file changed (+30 additions, -24 deletions)

View changed files

📝 src/index.ts (+30 -24)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/7 **Author:** [@SyedaAnshrahGillani](https://github.com/SyedaAnshrahGillani) **Created:** 7/31/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feature/animation-loop-refactor` --- ### 📝 Commits (2) - [`f608455`](https://github.com/anomalyco/opentui/commit/f60845518f4a942db8b414caec99a2d81edd6e19) refactor: Use for...of loop for animation frame requests - [`f82c5e2`](https://github.com/anomalyco/opentui/commit/f82c5e2c52a058d8de6cc2ccb90f93eee03b03e2) refactor(renderer): separate render loop from single frame rendering ### 📊 Changes **1 file changed** (+30 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `src/index.ts` (+30 -24) </details> ### 📄 Description 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#215
No description provided.