Skip to content

Conversation

@bobhy
Copy link
Contributor

@bobhy bobhy commented May 12, 2025

Edit: this PR is about Table doc, not Tree! Updated title...

Changes under "Components"; clarify Table page, add a new page for Table Styling and another for Table Headers.
The headers page shows rendered output for the sample code, the Styling page does not, but maybe should?

@andydotxyz
Copy link
Member

Table headers seems like a good thing to document.
But the styling - isn't that actually styling Labels not Tables?

bobhy added 2 commits May 15, 2025 18:06
add wordwrapping to example;
add sample for MeasureText()
@bobhy
Copy link
Contributor Author

bobhy commented May 16, 2025

This page is about styling the table, which certainly involves styling labels but also involves the table API as well.

I could see adding a page someday about styling forms, too.

Copy link
Member

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

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

Thanks, but I think this is trying to cover a lot too much - each page is very long.
For the headers page the first section is sufficient to demonstrate the functionality.

In the table styling page if you want it to be about styling the table and not about labels then again the first section seems sufficient - alternating styling across odd/even rows is a great example and I'm not sure the additional examples add a lot.

As you say, illustrating the output would be great.
Thanks for working on this, let's see how to focus it down to a main focus for each page.

)

var dataTemplateText = "0123456789012345"
var sampData = []string{
Copy link
Member

Choose a reason for hiding this comment

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

It's not a great idea to use 1-dimensional data for a demonstration of a 2-dimensional output.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The sample renders different data in each column and the pattern doesn't repeat till 5 rows later. It doesn't look like 1-dimensional data.
But the point of the sample is the headers, and maybe it would be simpler and less distracting to put the same placeholder text in all the data cells, or even leave them empty?

Copy link
Member

Choose a reason for hiding this comment

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

I agree the data here is not the point - but docs have to consider every single line will be used as best practice - and 1D data is not best practice for a table and could lead to support requests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To clarify, are you concerned about line 25, var dataTemplateText = "0123456789012345"? I thought the concern was about the sample data, at lines 26-31 which is indeed a 1-d vector of strings.
If it's about line 25, please clarify what you'd rather have there (my idea was you can tell at a glance that this string is 16 runes long). If it's about the subsequent lines, I could have the sample show blanks in the data cells. That would focus attention on the headers, which is the point of this sample.

@bobhy bobhy changed the title Add usage documentation for Tree cell styling and headers Add usage documentation for Table cell styling and headers Jun 5, 2025
@andydotxyz
Copy link
Member

I've noticed also you have replaced the tab indentation in code to 4-space, any particular reason? This is not how Go is normally formatted.

Can you also comment on the file removal?

@bobhy
Copy link
Contributor Author

bobhy commented Jun 9, 2025

The hard tabs in the sample render as 8 spaces on the doc site, not the 4 spaces I see in samples on go std lib (e.g: https://pkg.go.dev/strings#CutPrefix) or my IDE. I couldn't figure out how to configure kramdown or rouge to get this effect, so I replaced them with spaces so they'd at least look "right". I can put back the hard returns if you'd prefer.

@bobhy
Copy link
Contributor Author

bobhy commented Jun 9, 2025

Can you also comment on the file removal?

widget.html is shadowed by widget.md, and in any case, redirects to a non-existent page. Agreed, this change is not directly related to the purpose of the PR, so it's your call whether to retract it.

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.

2 participants