Skip to content

Fix Theme.style_from_theme/4 calling undefined Style.from/1#17

Closed
johnnymo87 wants to merge 1 commit into
pcharbon70:developfrom
johnnymo87:fix-theme-style-from-undefined
Closed

Fix Theme.style_from_theme/4 calling undefined Style.from/1#17
johnnymo87 wants to merge 1 commit into
pcharbon70:developfrom
johnnymo87:fix-theme-style-from-undefined

Conversation

@johnnymo87

Copy link
Copy Markdown
Contributor

Summary

  • Fix production bug where Theme.style_from_theme/4 crashed with UndefinedFunctionError because it called Style.from/1 which doesn't exist in TermUI.Renderer.Style
  • Add has_attr?/2 to TermUI.Renderer.Style for API parity
  • Update test aliases to match the actual return type (TermUI.Renderer.Style)

Details

theme.ex aliases TermUI.Renderer.Style as Style, but line 428 was calling Style.from(overrides). This function only exists in TermUI.Style, not TermUI.Renderer.Style. Changed to Style.new(overrides) which exists and accepts the same keyword list argument.

Test plan

  • Existing theme tests now pass
  • No new test failures introduced

🤖 Generated with Claude Code

Theme aliases TermUI.Renderer.Style but was calling Style.from/1,
which only exists in TermUI.Style. This caused UndefinedFunctionError
when style_from_theme/4 was invoked.

Changed to Style.new/1 which exists in Renderer.Style and accepts
the same keyword list argument. Also added has_attr?/2 to
Renderer.Style for API parity, and updated test aliases to match
the actual return type.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@johnnymo87 johnnymo87 marked this pull request as ready for review January 6, 2026 16:38
@johnnymo87 johnnymo87 closed this Jan 6, 2026
@johnnymo87 johnnymo87 reopened this Jan 6, 2026
@johnnymo87 johnnymo87 closed this Jan 6, 2026
@johnnymo87

Copy link
Copy Markdown
Contributor Author

#18 has a CI build, that's nice, so closing this one out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant