refactor(tui): extract shared style definitions#59
Merged
daisuke8000 merged 1 commit intomainfrom Dec 20, 2025
Merged
Conversation
Add styles.rs module with common style definitions for TUI components: - border_style() for focused/unfocused border styling - header_style() for table headers - row_highlight_style() for selected table rows - HIGHLIGHT_SYMBOL constant for selection indicator - Text style constants for future use Apply styles to render_collections() and render_databases() views. Changes: - Add crates/mbr-tui/src/components/styles.rs (119 lines) - Simplify style definitions in content.rs - Reduce content.rs by ~24 lines
daisuke8000
added a commit
that referenced
this pull request
Dec 20, 2025
Apply the extracted helpers from PR #58 and #59 to three render functions in content.rs: - render_collection_questions: Use LoadStateConfig for non-loaded states, header_style(), row_highlight_style(), HIGHLIGHT_SYMBOL - render_database_schemas: Same pattern applied - render_schema_tables: Same pattern applied This reduces content.rs from 4,427 to 4,112 lines (~315 lines removed) by eliminating duplicated LoadState pattern matching and inline style definitions across these functions. Changes: - Replace manual LoadState match arms with render_non_loaded_state() - Replace manual empty state rendering with render_empty_with_hint() - Use shared style functions instead of inline Style definitions - Use HIGHLIGHT_SYMBOL constant instead of hardcoded "► "
3 tasks
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.
Summary
styles.rsmodule with shared style definitions for TUI componentsrender_collections()andrender_databases()viewsChanges
crates/mbr-tui/src/components/styles.rs(119 lines)border_style()for focused/unfocused border stylingheader_style()for table headersrow_highlight_style()for selected table rowsHIGHLIGHT_SYMBOLconstant for selection indicatorcontent.rs- use shared styles in collections and databases viewsTest plan
cargo testpasses (32 tests)cargo clippypassesRelated
Part 4 of crates refactoring plan. Styles module prepares for comprehensive View refactoring in PR 5, 6.