Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and refactorings to the codebase, focusing on code reuse, maintainability, and UI consistency. The most significant changes include extracting tag color logic into a reusable class, introducing a trait for rendering centered dialogs, refactoring urgency option handling, and simplifying cursor management. Below are the most important changes grouped by theme:
Tag color handling and code reuse:
TodoandTodoDetailWidgetinto a new reusable classTagColors, which provides methods for assigning consistent colors to tags by name or index. (src/Support/TagColors.php,src/Support/Todo.php,src/Widgets/TodoDetailWidget.php) [1] [2] [3] [4] [5] [6]UI consistency and code reuse for dialogs:
RendersAsDialogto encapsulate the logic for rendering widgets as centered dialogs with horizontal margins, and refactoredHelpWidgetandTodoDetailWidgetto use this trait for consistent dialog appearance. (src/Widgets/Concerns/RendersAsDialog.php,src/Widgets/HelpWidget.php,src/Widgets/TodoDetailWidget.php) [1] [2] [3] [4] [5]Urgency option handling improvements:
selectOptions()to theTodoUrgencyenum to generate a value-to-label map for select prompts, and refactored related code to use this method for better maintainability. (src/Support/Enums/TodoUrgency.php,src/Support/DataManager.php) [1] [2] [3]Cursor management and code simplification:
inactive()constructor to theCursorclass for clearer intent, and refactored usage throughout the codebase to use this method instead of manually instantiating inactive cursors. (src/Support/Cursor.php,src/Widgets/MainWidget.php) [1] [2] [3]MainWidgetinto a new helper methodupdatePaginatorForType(), reducing code duplication and improving maintainability. (src/Widgets/MainWidget.php) [1] [2] [3] [4] [5] [6]Other improvements:
DATA_FILE_NAMEinDataManagerpublic and updated references to use it instead of a duplicate constant inContext. (src/Support/DataManager.php,src/Support/Context.php) [1] [2] [3]dockerscript by usingdocker rm -fanddocker container inspect. (docker)