Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(showcase): add table built-in widget showcase #335

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

Valentin271
Copy link
Member

@Valentin271 Valentin271 commented Jan 2, 2024

Relates to #249

Copy link

cloudflare-workers-and-pages bot commented Jan 2, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 94ff963
Status: ✅  Deploy successful!
Preview URL: https://65f848d0.ratatui.pages.dev
Branch Preview URL: https://feat-table-showcase.ratatui.pages.dev

View logs

Copy link
Member

@joshka joshka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A fun Easter egg might be to use the Ratatui maintainers in the list


pub fn render(frame: &mut Frame) {
let rows = [
Row::new(["1".bold(), "John".into(), "john.doe@mail.org".dim()]),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add two more rows to fill the space in the image.


let table = Table::new(
rows,
[Constraint::Min(8), Constraint::Min(15), Constraint::Min(20)],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we know the exact size of the image that we're displaying here, these lengths can be exact.

Maybe make the ID column narrower.
To fill the space better you could make the user names lower case, and add a Name column.

@Valentin271
Copy link
Member Author

Pushed 94ff963 "temporarily" as I don't have much time right now. Feedback is appreciated, I think it's better but the mail could be replaced by something more interesting imo

@joshka
Copy link
Member

joshka commented Jan 2, 2024

LGTM - merging and will propose some changes in another PR.

@joshka joshka merged commit 74e73db into main Jan 2, 2024
4 checks passed
@joshka joshka deleted the feat/table-showcase branch January 2, 2024 20:40
@joshka joshka mentioned this pull request Jun 4, 2024
joshka pushed a commit that referenced this pull request Jun 4, 2024
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.

3 participants