Skip to content

fix: Terminal.app rendering issues - #643

Merged
caarlos0 merged 3 commits into
mainfrom
fix-terminalapp
Apr 29, 2025
Merged

caarlos0 merged 3 commits into
mainfrom
fix-terminalapp

Conversation

@caarlos0

Copy link
Copy Markdown
Contributor

closes #631

@caarlos0 caarlos0 added bug Something isn't working layout labels Apr 29, 2025
@caarlos0 caarlos0 self-assigned this Apr 29, 2025
@caarlos0
caarlos0 requested a review from a team as a code owner April 29, 2025 19:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR aims to fix Terminal.app rendering issues by replacing the use of lipgloss.JoinVertical/JoinHorizontal with strings.Join for constructing multi-line views, and by renaming auxiliary height functions to better reflect their purpose.

  • Replaces lipgloss join functions with strings.Join (using "\n" as a separator) to improve rendering
  • Renames nonContentHeight to titleFooterHeight and refactors height calculation in WithHeight
  • Simplifies height comparison in form Update using a max helper function

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
layout.go Updated view functions to join lines via strings.Join
group.go Renamed nonContentHeight to titleFooterHeight and updated join calls
form.go Replaced manual height check with a max helper function
field_text.go Updated to use strings.Join for view rendering
field_select.go Updated to use strings.Join for view rendering
field_filepicker.go Updated to use strings.Join for view rendering
Comments suppressed due to low confidence (3)

group.go:129

  • [nitpick] The function previously named nonContentHeight has been renamed to titleFooterHeight; consider updating inline comments or documentation to clearly explain the rationale behind the new name.
h := height - g.titleFooterHeight()

layout.go:81

  • [nitpick] Ensure that replacing lipgloss.JoinVertical with strings.Join preserves the intended vertical alignment and styling for Terminal.app, as the lipgloss function may provide extra formatting logic.
return strings.Join([]string{

form.go:543

  • [nitpick] Using a max helper function simplifies the height comparison; please verify that the max function is correctly defined and handles any necessary edge cases.
neededHeight = max(neededHeight, group.rawHeight())

@caarlos0
caarlos0 merged commit d7a782d into main Apr 29, 2025
@caarlos0
caarlos0 deleted the fix-terminalapp branch April 29, 2025 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working layout

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Breaking layouts in Terminal.app on Mac?

4 participants

⌂ 换网址