Comments (3)
Right now this works fine, and there's no huge need to change this. Let's try to focus on things that add value rather than looking to change every little thing.
Not sure if you're a sports fan at all, but often when a referee's call is being reviewed (e.g. a coach's challenge of a goal in hockey), the standard of review is that it was "clearly not correct". It could be worth applying some similar thinking to ideas for improvement like this. Having our own Alignment type works fine, it solves the problem and doesn't have any obvious bugs. Changing it won't help any apps do anything easier / better.
So while this is probably "technically correct", it's also probably a distraction not worth investing time into. Does that make sense?
from ratatui.
What problem does it solve?
What problems does it cause (e.g. existing apps)?
What would this prevent in the future (maybe adding other alignments / adding methods for alignment related stuff to the impl block)?
Seems like if there's no problem to solve (or only very low impact ones), and there's a possible chance of a problem (however unlikely), it might be worth keeping our current code instead on this.
from ratatui.
unicode-truncate
has its own Alignment definition which is incompatible with the one of ratatui. As long as stuff is reusable, why not reuse it?
When other stuff is needed in the future it can still be adapted and an own type introduced. Personally I prefer smaller breaking changes in comparison to over generic code that might be good for some future use that might never arise.
Its not really significant to use it, but it's still the same intention reinvented. Which is why it might be interesting to think about it.
It might be a good idea in the future to search the std lib for existing types before inventing the wheel again. Until the usage diverges enough to diverge.
from ratatui.
Related Issues (20)
- Support block titles in top-right and bottom-right HOT 4
- Onboard to bencher, to start tracking benchmarks over time HOT 9
- Running `cargo test` fails HOT 6
- Inconsistent behavior between `Line::from` and `Line::raw` HOT 3
- Allow bypassing diff and writing all to screen HOT 6
- RSX-based interface to reduce boilerplate code HOT 5
- Make methods / fields on buffer that deal with the underlying content index private.
- Italic Borders? HOT 3
- `clippy::same_name_method` with Stylize HOT 3
- Add a Buffer::fill method
- Move away from using Prelude / glob imports
- Add .next()/.prev() to ListState to make traversing a list of selectable items easier HOT 4
- Consistent examples in ratatui HOT 2
- Add Stylize methods directly to Style HOT 3
- index out of bounds: the len is 17526 but the index is 17526 HOT 9
- Change examples folder structure HOT 4
- Features documentation on docs.rs isn't right. HOT 4
- TableState resets offset to 0 HOT 3
- Bug: ensure that block title rows apply the border style
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ratatui.