Skip to content

fix(chat): explicit lumis theme; element-less tool body; error-panel spacing - #689

Merged
nhobes merged 1 commit into
mainfrom
fix/chat-code-theme-and-tool-error
Aug 24, 2026
Merged

fix(chat): explicit lumis theme; element-less tool body; error-panel spacing#689
nhobes merged 1 commit into
mainfrom
fix/chat-code-theme-and-tool-error

Conversation

@nhobes

@nhobes nhobes commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Three more petal.build finds from Nic, riding the unpublished 4.15.1:

  1. Colourless code blocks - the markdown pipeline passes formatter: :html_inline and relied on lumis defaulting a theme. lumis 0.6 (playground) does; lumis 0.7 (marketing, resolved newer) does not - structure renders, tokens don't. Reproduced both ways in isolation; {:html_inline, theme: "onedark"} now travels explicitly and verifies on both lumis generations.
  2. Empty padded strip in the error tool card - HEEx counts the whitespace before the first named slot as inner content, so <.tool_call> carrying only <:error_actions> renders a whitespace-only widget body past the @widget != [] guard. An element-less body now hides itself via :not(:has(*)); the slot doc says bare-text widgets need a wrapper.
  3. Error band → Input panels junction - panels normally breathe off the body's bottom padding; with no body they were crammed against the red band. Ruling per Nic's question: the red stays the failure message's band, Input stays neutral evidence - they get pt-3 separation, not red envelopment.

Suite 1812/0 with three new invariants.

🤖 Generated with Claude Code

…panel spacing

Three petal.build finds riding 4.15.1. Code blocks rendered
structurally correct but colourless on the marketing site: the
markdown pipeline passed a bare :html_inline formatter and lumis 0.6
defaulted a theme where lumis 0.7 does not - reproduced both ways,
the onedark theme now travels explicitly and works on both
generations. The lifecycle demo's error card carried an empty padded
strip: HEEx counts the whitespace before a named slot as inner
content, so the widget-body guard passed with nothing to render - an
element-less body now hides itself (:not(:has(*))), the slot doc
carries the wrap-bare-text rule, and panels that follow the error
band directly bring their own top spacing. Invariants pin the theme
tuple, the body guard and the spacing rule.
@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown

Greptile Summary

This PR restores syntax highlighting by passing Lumis an explicit theme and refines tool-call layout for named-slot-only error cards.

  • Configures the onedark theme explicitly for chat code blocks.
  • Hides tool bodies containing no child elements.
  • Adds spacing between error rows and subsequent tool panels.
  • Documents the wrapper requirement for bare-text tool output and adds CSS-source invariants.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness or security defects identified.

The explicit formatter configuration and CSS changes align with the documented behavior, and the investigated compatibility concerns either predate this change or are explicitly covered by the updated component contract.

Important Files Changed

Filename Overview
lib/petal_components/chat.ex Explicitly configures the syntax-highlighting theme and documents the element-wrapper requirement for tool body content.
assets/default.css Hides element-less tool bodies and adds spacing where tool panels directly follow an error row.
test/petal/css_assets_test.exs Adds source-level assertions covering the new CSS selectors and explicit Lumis formatter configuration.
CHANGELOG.md Documents the syntax-highlighting and tool-card layout fixes.

Reviews (1): Last reviewed commit: "fix(chat): explicit lumis theme; element..." | Re-trigger Greptile

@nhobes
nhobes merged commit 1ba68d9 into main Aug 24, 2026
3 checks passed
@nhobes
nhobes deleted the fix/chat-code-theme-and-tool-error branch August 24, 2026 21:09
@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.40%. Comparing base (644d13c) to head (3daf6bf).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #689   +/-   ##
=======================================
  Coverage   95.40%   95.40%           
=======================================
  Files         162      162           
  Lines        8045     8045           
=======================================
  Hits         7675     7675           
  Misses        370      370           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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