Skip to content

fix(widgets): require thread-safe shadow effects#2584

Merged
orhun merged 2 commits into
mainfrom
joshka/fix-shadow-auto-traits
Jun 7, 2026
Merged

fix(widgets): require thread-safe shadow effects#2584
orhun merged 2 commits into
mainfrom
joshka/fix-shadow-auto-traits

Conversation

@joshka

@joshka joshka commented Jun 7, 2026

Copy link
Copy Markdown
Member

Summary

  • require custom shadow effects to preserve the auto traits expected by Block-backed widgets
  • document the CellEffect auto-trait contract
  • add a public widget regression test for the affected ratatui::widgets re-exports

Fixes #2583

Testing

  • cargo test -p ratatui --test widgets_auto_traits
  • cargo test -p ratatui-widgets block::shadow::tests
  • cargo test -p ratatui-widgets
  • cargo semver-checks -p ratatui-widgets --baseline-version 0.3.0 --release-type patch
    • auto-trait removals are gone; the command still reports the unrelated GraphType::Area variant addition

@joshka
joshka requested a review from a team as a code owner June 7, 2026 05:28
Preserve the Send, Sync, UnwindSafe, and RefUnwindSafe auto
traits for Block-backed widgets by requiring custom shadow effects to
provide the same guarantees.

Fixes #2583
@joshka
joshka force-pushed the joshka/fix-shadow-auto-traits branch from d569aa5 to 12a5deb Compare June 7, 2026 05:56
@orhun
orhun merged commit fce3c80 into main Jun 7, 2026
33 of 34 checks passed
@orhun
orhun deleted the joshka/fix-shadow-auto-traits branch June 7, 2026 17:25
@joshka

joshka commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

This is probably worth dropping a 0.30.2 on. But let's wait a little bit and collect any other quick fixes

@orhun orhun added this to the v0.30.2 milestone Jun 9, 2026
orhun added a commit that referenced this pull request Jun 19, 2026
## 🤖 New release

* `ratatui-core`: 0.1.1 -> 0.1.2
* `ratatui-crossterm`: 0.1.1 -> 0.1.2
* `ratatui-widgets`: 0.3.1 -> 0.3.2
* `ratatui-termina`: 0.1.0
* `ratatui-termwiz`: 0.1.1 -> 0.1.2
* `ratatui-termion`: 0.1.1 -> 0.1.2
* `ratatui`: 0.30.1 -> 0.30.2
* `ratatui-macros`: 0.7.1 -> 0.7.2

<details><summary><i><b>Changelog</b></i></summary><p>

## `ratatui-core`

<blockquote>

##
[0.1.2+ratatui-core](ratatui-core-v0.1.1...ratatui-core-v0.1.2)
- 2026-06-19

### Features

-
[90639c1](90639c1)
*(uncategorized)* Add Termina backend by `@joshka` in [#2561](
#2561)

  > ## Summary
  >
> - add the `ratatui-termina` backend crate using the published
`termina`
  > crate
  > - expose the backend through the `termina` feature and Ratatui
  > prelude/backend re-exports
> - add a small Termina event-loop example and wire the backend into CI,
  > xtask, README generation, and docs
  >
  > Refs #1784
  >
  > ## Validation
  >
  > - `cargo +nightly fmt`
  > - `cargo check -p ratatui-termina --all-features --all-targets`
  > - `cargo check -p ratatui --no-default-features --features termina`
  > - `cargo check -p xtask`
  > - `cargo check -p release-header`
  > - `cargo xtask check-backend termina`
  > - `cargo xtask test-backend termina`
  > - `cargo xtask rdme --check`
  > - `markdownlint-cli2 ARCHITECTURE.md ratatui-termina/README.md
  > .github/ISSUE_TEMPLATE/bug_report.md`
  >
  > ---------

### Bug Fixes

-
[e306ce6](e306ce6)
*(buffer)* Create updates for "uncovered" cells by `@benjajaja` in
[#2587](
#2587)

> When a wide cell from the previous buffer is replaced by a
short/normal
> cell, the trailing cell does not get an update if its content does not
  > change. But if the wide cell has a background (or other) style, the
  > terminal *did* render the trailing cell with that style.
  >
> Force trailing cells to update if background, underline, or modifiers
  > are different than the wide cell. We can ignore foreground.
  >
  > Fixes #2585 (see that for the detailed visual reports)

### Miscellaneous Tasks

-
[c75d778](c75d778)
*(ci)* Add cargo-udeps dependency check by `@joshka` in [#2599](
#2599)

  > Adds cargo xtask udeps and runs it from CI as a required job.
  >
> This complements cargo-machete rather than replacing it. cargo-machete
> is a fast static source scan, which is why it missed the package-level
  > unused deps fixed in #2598 when the same dependency names were still
  > referenced by example crates. cargo-udeps compiles the workspace and
> checks rustc dep-info, so it can catch unused dependency declarations
  > for the package being checked.
  >
> To make the new job pass, this also removes the remaining
true-positive
  > unused dev-deps and records explicit cargo-udeps ignores for current
  > false positives / intentional cases: ratatui-core critical-section,
  > ratatui-crossterm's duplicate crossterm version feature shape, and
  > ratatui-termwiz's doc-example-only ratatui dev-dependency.
  >
  > I searched existing issues and PRs for udeps / cargo-udeps / "cargo
  > udeps". I did not find prior ratatui discussion about adopting
  > cargo-udeps; the only hits were Dependabot PR bodies for
  > taiki-e/install-action release notes mentioning cargo-udeps version
  > updates, for example #1971, #2095, #2194, and #2522.
  >
  > Validation:- cargo xtask udeps
  > - cargo xtask format --check
  >
  > ---------

-
[4a63d41](4a63d41)
*(uncategorized)* Remove unused dependencies by `@KikiKian` in [#2598](
#2598)

  > Audit removes these dependencies that are not used:
  >
  >   ratatui/Cargo.toml — Removed from [dev-dependencies]:
  >   - futures
  >   - rand_chacha
  >   - tokio
  >   - tracing
  >   - tracing-appender
  >   - tracing-subscriber
  >
  > ratatui-core/Cargo.toml — Moved from [dependencies] →
  > [dev-dependencies]:
  >   - indoc
  >
  > ---------

**Full Changelog**:
ratatui-core-v0.1.1...ratatui-core-v0.1.2
</blockquote>

## `ratatui-crossterm`

<blockquote>

##
[0.1.2+ratatui-crossterm](ratatui-crossterm-v0.1.1...ratatui-crossterm-v0.1.2)
- 2026-06-19

### Miscellaneous Tasks

-
[c75d778](c75d778)
*(ci)* Add cargo-udeps dependency check by `@joshka` in [#2599](
#2599)

  > Adds cargo xtask udeps and runs it from CI as a required job.
  >
> This complements cargo-machete rather than replacing it. cargo-machete
> is a fast static source scan, which is why it missed the package-level
  > unused deps fixed in #2598 when the same dependency names were still
  > referenced by example crates. cargo-udeps compiles the workspace and
> checks rustc dep-info, so it can catch unused dependency declarations
  > for the package being checked.
  >
> To make the new job pass, this also removes the remaining
true-positive
  > unused dev-deps and records explicit cargo-udeps ignores for current
  > false positives / intentional cases: ratatui-core critical-section,
  > ratatui-crossterm's duplicate crossterm version feature shape, and
  > ratatui-termwiz's doc-example-only ratatui dev-dependency.
  >
  > I searched existing issues and PRs for udeps / cargo-udeps / "cargo
  > udeps". I did not find prior ratatui discussion about adopting
  > cargo-udeps; the only hits were Dependabot PR bodies for
  > taiki-e/install-action release notes mentioning cargo-udeps version
  > updates, for example #1971, #2095, #2194, and #2522.
  >
  > Validation:- cargo xtask udeps
  > - cargo xtask format --check
  >
  > ---------

**Full Changelog**:
ratatui-crossterm-v0.1.1...ratatui-crossterm-v0.1.2
</blockquote>

## `ratatui-widgets`

<blockquote>

##
[0.3.2+ratatui-widgets](ratatui-widgets-v0.3.1...ratatui-widgets-v0.3.2)
- 2026-06-19

### Bug Fixes

-
[81e667f](81e667f)
*(scrollbar)* Keep a large thumb within the track at the end by
`@satyakwok` in [#2594](
#2594)
  >
  > Closes #2582.
  >
  > ## Problem
  >
  > When the content is shorter than the viewport, the thumb is large
  > relative to the track. With the position at the end, `part_lengths`
  > clamped `thumb_start` to `track_length - 1` while `thumb_length` was
  > clamped independently to `[1, track_length]`, so `thumb_start +
  > thumb_length` could exceed `track_length`.
  >
> `bar_symbols` lays out `begin + track_start + thumb + track_end + end`
> and zips it against the cells of the area. When the thumb overruns the
> track, `track_end` saturates to `0` but the thumb still emits more
cells
> than the track can hold, so the trailing `end` symbol is pushed past
the
> end of the area. The last visible cell ends up being a thumb (`█`)
where
  > the end arrow (`▼`) should be.
  >
> Concretely, for the issue's repro (`VerticalRight`, `content_length =
> 9`, `position = 8`, height `24`): track is `22`, `thumb_length = 17`,
  > `thumb_start = 6`, and `6 + 17 = 23 > 22`.
  >
> This is a regression from v0.30.0, where `thumb_length` was derived as
  > `thumb_end - thumb_start` and therefore always fit within the track.
  >
  > ## Fix
  >
  > Clamp `thumb_start` to `track_length - thumb_length` (instead of
> `track_length - 1`) so the thumb always fits within the track and the
  > end symbol is preserved.
  >
  > ## Test
  >
  > Two regression tests, both fail on `main` and pass with the fix:
  >
  > - `thumb_stays_within_track_for_large_thumb_at_end` checks
  > `part_lengths` directly with the issue's parameters — asserts
> `thumb_start + thumb_length <= track_length` and that the parts sum to
  > the track length.
> - `render_scrollbar_keeps_end_symbol_for_large_thumb` renders the
#2582
> case (both arrows, large thumb at the end) and asserts the end symbol
is
  > drawn rather than overwritten by a thumb cell.
  >
  > All existing scrollbar tests still pass.

-
[fce3c80](fce3c80)
*(widgets)* Require thread-safe shadow effects by `@joshka` in [#2584](
#2584)

  > ## Summary
  >
> - require custom shadow effects to preserve the auto traits expected
by
  > Block-backed widgets
  > - document the CellEffect auto-trait contract
> - add a public widget regression test for the affected
ratatui::widgets
  > re-exports
  >
  > Fixes #2583
  >
  > ---------

**Full Changelog**:
ratatui-widgets-v0.3.1...ratatui-widgets-v0.3.2
</blockquote>

## `ratatui-termina`

<blockquote>

##
[0.1.0+ratatui-termina](https://github.com/ratatui/ratatui/releases/tag/ratatui-termina-v0.1.0)
- 2026-06-19

### Features

-
[90639c1](90639c1)
*(uncategorized)* Add Termina backend by `@joshka` in [#2561](
#2561)

  > ## Summary
  >
> - add the `ratatui-termina` backend crate using the published
`termina`
  > crate
  > - expose the backend through the `termina` feature and Ratatui
  > prelude/backend re-exports
> - add a small Termina event-loop example and wire the backend into CI,
  > xtask, README generation, and docs
  >
  > Refs #1784
  >
  > ## Validation
  >
  > - `cargo +nightly fmt`
  > - `cargo check -p ratatui-termina --all-features --all-targets`
  > - `cargo check -p ratatui --no-default-features --features termina`
  > - `cargo check -p xtask`
  > - `cargo check -p release-header`
  > - `cargo xtask check-backend termina`
  > - `cargo xtask test-backend termina`
  > - `cargo xtask rdme --check`
  > - `markdownlint-cli2 ARCHITECTURE.md ratatui-termina/README.md
  > .github/ISSUE_TEMPLATE/bug_report.md`
  >
  > ---------

### Miscellaneous Tasks

-
[c75d778](c75d778)
*(ci)* Add cargo-udeps dependency check by `@joshka` in [#2599](
#2599)

  > Adds cargo xtask udeps and runs it from CI as a required job.
  >
> This complements cargo-machete rather than replacing it. cargo-machete
> is a fast static source scan, which is why it missed the package-level
  > unused deps fixed in #2598 when the same dependency names were still
  > referenced by example crates. cargo-udeps compiles the workspace and
> checks rustc dep-info, so it can catch unused dependency declarations
  > for the package being checked.
  >
> To make the new job pass, this also removes the remaining
true-positive
  > unused dev-deps and records explicit cargo-udeps ignores for current
  > false positives / intentional cases: ratatui-core critical-section,
  > ratatui-crossterm's duplicate crossterm version feature shape, and
  > ratatui-termwiz's doc-example-only ratatui dev-dependency.
  >
  > I searched existing issues and PRs for udeps / cargo-udeps / "cargo
  > udeps". I did not find prior ratatui discussion about adopting
  > cargo-udeps; the only hits were Dependabot PR bodies for
  > taiki-e/install-action release notes mentioning cargo-udeps version
  > updates, for example #1971, #2095, #2194, and #2522.
  >
  > Validation:- cargo xtask udeps
  > - cargo xtask format --check
  >
  > ---------
</blockquote>

## `ratatui-termwiz`

<blockquote>

##
[0.1.2+ratatui-termwiz](ratatui-termwiz-v0.1.1...ratatui-termwiz-v0.1.2)
- 2026-06-19

### Miscellaneous Tasks

-
[c75d778](c75d778)
*(ci)* Add cargo-udeps dependency check by `@joshka` in [#2599](
#2599)

  > Adds cargo xtask udeps and runs it from CI as a required job.
  >
> This complements cargo-machete rather than replacing it. cargo-machete
> is a fast static source scan, which is why it missed the package-level
  > unused deps fixed in #2598 when the same dependency names were still
  > referenced by example crates. cargo-udeps compiles the workspace and
> checks rustc dep-info, so it can catch unused dependency declarations
  > for the package being checked.
  >
> To make the new job pass, this also removes the remaining
true-positive
  > unused dev-deps and records explicit cargo-udeps ignores for current
  > false positives / intentional cases: ratatui-core critical-section,
  > ratatui-crossterm's duplicate crossterm version feature shape, and
  > ratatui-termwiz's doc-example-only ratatui dev-dependency.
  >
  > I searched existing issues and PRs for udeps / cargo-udeps / "cargo
  > udeps". I did not find prior ratatui discussion about adopting
  > cargo-udeps; the only hits were Dependabot PR bodies for
  > taiki-e/install-action release notes mentioning cargo-udeps version
  > updates, for example #1971, #2095, #2194, and #2522.
  >
  > Validation:- cargo xtask udeps
  > - cargo xtask format --check
  >
  > ---------

**Full Changelog**:
ratatui-termwiz-v0.1.1...ratatui-termwiz-v0.1.2
</blockquote>

## `ratatui-termion`

<blockquote>

##
[0.1.2+ratatui-termion](ratatui-termion-v0.1.1...ratatui-termion-v0.1.2)
- 2026-06-19

### Miscellaneous Tasks

-
[c75d778](c75d778)
*(ci)* Add cargo-udeps dependency check by `@joshka` in [#2599](
#2599)

  > Adds cargo xtask udeps and runs it from CI as a required job.
  >
> This complements cargo-machete rather than replacing it. cargo-machete
> is a fast static source scan, which is why it missed the package-level
  > unused deps fixed in #2598 when the same dependency names were still
  > referenced by example crates. cargo-udeps compiles the workspace and
> checks rustc dep-info, so it can catch unused dependency declarations
  > for the package being checked.
  >
> To make the new job pass, this also removes the remaining
true-positive
  > unused dev-deps and records explicit cargo-udeps ignores for current
  > false positives / intentional cases: ratatui-core critical-section,
  > ratatui-crossterm's duplicate crossterm version feature shape, and
  > ratatui-termwiz's doc-example-only ratatui dev-dependency.
  >
  > I searched existing issues and PRs for udeps / cargo-udeps / "cargo
  > udeps". I did not find prior ratatui discussion about adopting
  > cargo-udeps; the only hits were Dependabot PR bodies for
  > taiki-e/install-action release notes mentioning cargo-udeps version
  > updates, for example #1971, #2095, #2194, and #2522.
  >
  > Validation:- cargo xtask udeps
  > - cargo xtask format --check
  >
  > ---------

**Full Changelog**:
ratatui-termion-v0.1.1...ratatui-termion-v0.1.2
</blockquote>

## `ratatui`

<blockquote>

##
[0.30.2+ratatui](ratatui-v0.30.1...ratatui-v0.30.2)
- 2026-06-19

### Features

-
[90639c1](90639c1)
*(uncategorized)* Add Termina backend by `@joshka` in [#2561](
#2561)

  > ## Summary
  >
> - add the `ratatui-termina` backend crate using the published
`termina`
  > crate
  > - expose the backend through the `termina` feature and Ratatui
  > prelude/backend re-exports
> - add a small Termina event-loop example and wire the backend into CI,
  > xtask, README generation, and docs
  >
  > Refs #1784
  >
  > ## Validation
  >
  > - `cargo +nightly fmt`
  > - `cargo check -p ratatui-termina --all-features --all-targets`
  > - `cargo check -p ratatui --no-default-features --features termina`
  > - `cargo check -p xtask`
  > - `cargo check -p release-header`
  > - `cargo xtask check-backend termina`
  > - `cargo xtask test-backend termina`
  > - `cargo xtask rdme --check`
  > - `markdownlint-cli2 ARCHITECTURE.md ratatui-termina/README.md
  > .github/ISSUE_TEMPLATE/bug_report.md`
  >
  > ---------

### Miscellaneous Tasks

-
[c75d778](c75d778)
*(ci)* Add cargo-udeps dependency check by `@joshka` in [#2599](
#2599)

  > Adds cargo xtask udeps and runs it from CI as a required job.
  >
> This complements cargo-machete rather than replacing it. cargo-machete
> is a fast static source scan, which is why it missed the package-level
  > unused deps fixed in #2598 when the same dependency names were still
  > referenced by example crates. cargo-udeps compiles the workspace and
> checks rustc dep-info, so it can catch unused dependency declarations
  > for the package being checked.
  >
> To make the new job pass, this also removes the remaining
true-positive
  > unused dev-deps and records explicit cargo-udeps ignores for current
  > false positives / intentional cases: ratatui-core critical-section,
  > ratatui-crossterm's duplicate crossterm version feature shape, and
  > ratatui-termwiz's doc-example-only ratatui dev-dependency.
  >
  > I searched existing issues and PRs for udeps / cargo-udeps / "cargo
  > udeps". I did not find prior ratatui discussion about adopting
  > cargo-udeps; the only hits were Dependabot PR bodies for
  > taiki-e/install-action release notes mentioning cargo-udeps version
  > updates, for example #1971, #2095, #2194, and #2522.
  >
  > Validation:- cargo xtask udeps
  > - cargo xtask format --check
  >
  > ---------

-
[4a63d41](4a63d41)
*(uncategorized)* Remove unused dependencies by `@KikiKian` in [#2598](
#2598)

  > Audit removes these dependencies that are not used:
  >
  >   ratatui/Cargo.toml — Removed from [dev-dependencies]:
  >   - futures
  >   - rand_chacha
  >   - tokio
  >   - tracing
  >   - tracing-appender
  >   - tracing-subscriber
  >
  > ratatui-core/Cargo.toml — Moved from [dependencies] →
  > [dev-dependencies]:
  >   - indoc
  >
  > ---------

**Full Changelog**:
ratatui-v0.30.1...ratatui-v0.30.2
</blockquote>

## `ratatui-macros`

<blockquote>

##
[0.7.2+ratatui-macros](ratatui-macros-v0.7.1...ratatui-macros-v0.7.2)
- 2026-06-19

**Full Changelog**:
ratatui-macros-v0.7.1...ratatui-macros-v0.7.2
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Orhun Parmaksız <[email protected]>
@github-actions github-actions Bot mentioned this pull request Jun 19, 2026
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.

Ratatui 0.30.1 build fails due to Paragraph is no longer Send

2 participants