← oracle_full

rich_3718

resolved RESOLVED UNSUBMITTED PASS · None tool calls · 0 s · Textualize/rich

Task input

fix(panel): fix title missing panel background

 Fix `Panel` title missing the panel background style.
    
This really just reverts the change in 7a38204. There's a history of issues related to the panel title styles, so I was careful to run all the examples in those issues to ensure there wasn't any regression.
    
Fixes #3569

## Type of changes

- [x] Bug fix
- [ ] New feature
- [ ] Documentation / docstrings
- [ ] Tests
- [ ] Other

## Checklist

- [x] I've run the latest [black](https://github.com/psf/black) with default args on new code.
- [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
- [x] I've added tests for new code.
- [x] I accept that @willmcgugan may be pedantic in the code review.

Tool calls (0)

#ToolArgumentsResult
No trace captured.

Patch

--- a/rich/panel.py
+++ b/rich/panel.py
@@ -146,8 +146,7 @@ def __rich_console__(
             Padding(self.renderable, _padding) if any(_padding) else self.renderable
         )
         style = console.get_style(self.style)
-        partial_border_style = console.get_style(self.border_style)
-        border_style = style + partial_border_style
+        border_style = style + console.get_style(self.border_style)
         width = (
             options.max_width
             if self.width is None
@@ -206,7 +205,7 @@ def align_text(
 
         title_text = self._title
         if title_text is not None:
-            title_text.stylize_before(partial_border_style)
+            title_text.stylize_before(border_style)
 
         child_width = (
             width - 2
@@ -255,7 +254,7 @@ def align_text(
 
         subtitle_text = self._subtitle
         if subtitle_text is not None:
-            subtitle_text.stylize_before(partial_border_style)
+            subtitle_text.stylize_before(border_style)
 
         if subtitle_text is None or width <= 4:
             yield Segment(box.get_bottom([width - 2]), border_style)

Test output

show
.............                                                            [100%]
13 passed in 0.12s