fix(tui): implement dynamic text-wrapping in observation detail view#82
Open
Twinber wants to merge 2 commits intoGentleman-Programming:mainfrom
Open
fix(tui): implement dynamic text-wrapping in observation detail view#82Twinber wants to merge 2 commits intoGentleman-Programming:mainfrom
Twinber wants to merge 2 commits intoGentleman-Programming:mainfrom
Conversation
- Updated internal/tui/view.go to use Lipgloss for dynamic wrapping based on window width. - Added comprehensive unit test in internal/tui/wrap_test.go to verify wrapping logic. - Ensured long observation content is no longer cut off at the viewport boundaries. This improvement addresses readability issues when viewing large technical or personal memories.
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.
fix(tui): Implement dynamic soft-wrapping in observation detail view
Summary
Improved the readability of the TUI by implementing dynamic text wrapping for observation content. This ensures that long lines (prompts, logs, or detailed notes) are fully visible regardless of the terminal window size.
Motivation
Previously, long observations were truncated at the viewport boundaries, making it impossible to read the full content without side-scrolling. This change addresses a long-standing readability issue and makes the TUI far more robust for technical documentation.
Closes #60
Closes #83
Changes
internal/tui/view.go
viewObservationDetailto calculate a dynamicwrapWidth(terminal width minus padding).detailContentStyle.Width(wrapWidth).Render(obs.Content)before splitting into lines.internal/tui/wrap_test.go [NEW]
TestViewObservationDetailWrappingto programmatically verify that long content is correctly split into multiple lines when it exceeds the assigned width.Validation
internal/tuitests passed.TestViewObservationDetailWrappingconfirms the fix.