feat(scrollbar)!: WIP - Refactored and added scrollbar component style with defaults#201
feat(scrollbar)!: WIP - Refactored and added scrollbar component style with defaults#201vijayprakashpj wants to merge 8 commits into
Conversation
- Encapsulate track, thumb and arrow styles into a struct. - Implemented builder methods, default styles based on existing implementation
…` for unified style configuration.
…scriptions, method comments, and a usage example.
… methods `const` functions.
|
lmk when this is ready for review |
|
Thanks for working on this. I dug into the original issue in #193 and left a note there: the style values are currently hardcoded only as defaults, and the existing Given that, I’m not sure this PR is necessary as a fix for #193. The remaining question is whether we want a grouped I do think there is a discoverability problem here, though. The existing styling methods should probably get a clearer example and better docs, since it was easy to miss them when looking at the default values in |
## Summary - Improve `tui-scrollbar` crate docs for API discovery, styling behavior, glyph selection, and interaction flow. - Add a small `scrollbar_styled` example that shows distinct track, thumb, and arrow styles for vertical and horizontal scrollbars. - Configure docs.rs example scraping and add a regression test for custom thumb styling on full and partial thumb cells. ## Details This is a non-functional docs/examples/tests change. It reorganizes the crate-level docs so important defaults and caveats are visible earlier, replaces the loose `ScrollBar` “Key methods” list with a grouped method map, and adds canonical examples for the main builder methods. The styling docs now spell out how `fg` and `bg` apply to terminal glyph cells. In particular, they call out that the default minimal track renders spaces, so empty track cells show background color, while visible glyph sets can use foreground color for the track line. The docs also note the partial-thumb caveat: when using visible tracks such as `GlyphSet::box_drawing`, thumb background can show at partial glyph edges, so matching it to the track background is usually less surprising. The glyph docs keep repeated `Symbols for Legacy Computing` context where readers may land directly, rather than relying on linear reading through the crate docs. Related context: - Issue #193: #193 - PR #201: #201 ## Validation - `cargo test -p tui-scrollbar --all-features` - `cargo test -p tui-scrollbar --doc --all-features` - `cargo check -p tui-scrollbar --examples --all-features` - `cargo clippy -p tui-scrollbar --all-targets --all-features` - `RUSTDOCFLAGS='-D warnings' cargo doc -p tui-scrollbar --no-deps --all-features` - `just fmt-check` - `cargo rdme --check --manifest-path tui-scrollbar/Cargo.toml` - `markdownlint-cli2 tui-scrollbar/README.md`
## 🤖 New release * `tui-scrollbar`: 0.2.5 -> 0.2.6 (✓ API compatible changes) <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.2.6] - 2026-06-11 ### 📚 Documentation - *(scrollbar)* Improve API discovery ([#251](#251)) > ## Summary > > - Improve `tui-scrollbar` crate docs for API discovery, styling > behavior, glyph selection, and interaction flow. > - Add a small `scrollbar_styled` example that shows distinct track, > thumb, and arrow styles for vertical and horizontal scrollbars. > - Configure docs.rs example scraping and add a regression test for > custom thumb styling on full and partial thumb cells. > > ## Details > > This is a non-functional docs/examples/tests change. It reorganizes the > crate-level docs so important defaults and caveats are visible earlier, > replaces the loose `ScrollBar` “Key methods” list with a grouped method > map, and adds canonical examples for the main builder methods. > > The styling docs now spell out how `fg` and `bg` apply to terminal glyph > cells. In particular, they call out that the default minimal track > renders spaces, so empty track cells show background color, while > visible glyph sets can use foreground color for the track line. The docs > also note the partial-thumb caveat: when using visible tracks such as > `GlyphSet::box_drawing`, thumb background can show at partial glyph > edges, so matching it to the track background is usually less > surprising. > > The glyph docs keep repeated `Symbols for Legacy Computing` context > where readers may land directly, rather than relying on linear reading > through the crate docs. > > Related context: > > - Issue #193: #193 > - PR #201: #201 > > ## Validation > > - `cargo test -p tui-scrollbar --all-features` > - `cargo test -p tui-scrollbar --doc --all-features` > - `cargo check -p tui-scrollbar --examples --all-features` > - `cargo clippy -p tui-scrollbar --all-targets --all-features` > - `RUSTDOCFLAGS='-D warnings' cargo doc -p tui-scrollbar --no-deps > --all-features` > - `just fmt-check` > - `cargo rdme --check --manifest-path tui-scrollbar/Cargo.toml` > - `markdownlint-cli2 tui-scrollbar/README.md` </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>
## 🤖 New release * `tui-widgets`: 0.7.4 -> 0.7.5 (✓ API compatible changes) <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.7.5] - 2026-06-11 ### 📚 Documentation - *(scrollbar)* Improve API discovery ([#251](#251)) > ## Summary > > - Improve `tui-scrollbar` crate docs for API discovery, styling > behavior, glyph selection, and interaction flow. > - Add a small `scrollbar_styled` example that shows distinct track, > thumb, and arrow styles for vertical and horizontal scrollbars. > - Configure docs.rs example scraping and add a regression test for > custom thumb styling on full and partial thumb cells. > > ## Details > > This is a non-functional docs/examples/tests change. It reorganizes the > crate-level docs so important defaults and caveats are visible earlier, > replaces the loose `ScrollBar` “Key methods” list with a grouped method > map, and adds canonical examples for the main builder methods. > > The styling docs now spell out how `fg` and `bg` apply to terminal glyph > cells. In particular, they call out that the default minimal track > renders spaces, so empty track cells show background color, while > visible glyph sets can use foreground color for the track line. The docs > also note the partial-thumb caveat: when using visible tracks such as > `GlyphSet::box_drawing`, thumb background can show at partial glyph > edges, so matching it to the track background is usually less > surprising. > > The glyph docs keep repeated `Symbols for Legacy Computing` context > where readers may land directly, rather than relying on linear reading > through the crate docs. > > Related context: > > - Issue #193: #193 > - PR #201: #201 > > ## Validation > > - `cargo test -p tui-scrollbar --all-features` > - `cargo test -p tui-scrollbar --doc --all-features` > - `cargo check -p tui-scrollbar --examples --all-features` > - `cargo clippy -p tui-scrollbar --all-targets --all-features` > - `RUSTDOCFLAGS='-D warnings' cargo doc -p tui-scrollbar --no-deps > --all-features` > - `just fmt-check` > - `cargo rdme --check --manifest-path tui-scrollbar/Cargo.toml` > - `markdownlint-cli2 tui-scrollbar/README.md` ### ⚙️ Miscellaneous Tasks - *(tui-scrollbar)* Release v0.2.6 ([#258](#258)) > ## 🤖 New release > > * `tui-scrollbar`: 0.2.5 -> 0.2.6 (✓ API compatible changes) > > <details><summary><i><b>Changelog</b></i></summary><p> > > <blockquote> > > ## [0.2.6] - 2026-06-11 > > ### 📚 Documentation > > - *(scrollbar)* Improve API discovery > ([#251](#251)) > > ## Summary > > > > - Improve `tui-scrollbar` crate docs for API discovery, styling > > behavior, glyph selection, and interaction flow. > > - Add a small `scrollbar_styled` example that shows distinct track, > > thumb, and arrow styles for vertical and horizontal scrollbars. > > - Configure docs.rs example scraping and add a regression test for > > custom thumb styling on full and partial thumb cells. > > > > ## Details > > > > This is a non-functional docs/examples/tests change. It reorganizes > the > > crate-level docs so important defaults and caveats are visible > earlier, > > replaces the loose `ScrollBar` “Key methods” list with a grouped > method > > map, and adds canonical examples for the main builder methods. > > > > The styling docs now spell out how `fg` and `bg` apply to terminal > glyph > > cells. In particular, they call out that the default minimal track > > renders spaces, so empty track cells show background color, while > > visible glyph sets can use foreground color for the track line. The > docs > > also note the partial-thumb caveat: when using visible tracks such as > > `GlyphSet::box_drawing`, thumb background can show at partial glyph > > edges, so matching it to the track background is usually less > > surprising. > > > > The glyph docs keep repeated `Symbols for Legacy Computing` context > > where readers may land directly, rather than relying on linear reading > > through the crate docs. > > > > Related context: > > > > - Issue #193: #193 > > - PR #201: #201 > > > > ## Validation > > > > - `cargo test -p tui-scrollbar --all-features` > > - `cargo test -p tui-scrollbar --doc --all-features` > > - `cargo check -p tui-scrollbar --examples --all-features` > > - `cargo clippy -p tui-scrollbar --all-targets --all-features` > > - `RUSTDOCFLAGS='-D warnings' cargo doc -p tui-scrollbar --no-deps > > --all-features` > > - `just fmt-check` > > - `cargo rdme --check --manifest-path tui-scrollbar/Cargo.toml` > > - `markdownlint-cli2 tui-scrollbar/README.md` > </blockquote> > > > </p></details> > > --- > This PR was generated with > [release-plz](https://github.com/release-plz/release-plz/). </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>
Fixes #193