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

Show table groups without table rows #2103

Closed
Nayananga opened this issue Jul 26, 2023 · 8 comments · Fixed by #2129
Closed

Show table groups without table rows #2103

Nayananga opened this issue Jul 26, 2023 · 8 comments · Fixed by #2129
Assignees
Labels
feature Feature request ui Related to UI

Comments

@Nayananga
Copy link
Contributor

Wave SDK Version, OS

(e.g. 4.2.0, Windows)

0.26.1, MacOS

Actual behavior

(A clear and concise description of what happened.)
I want to show table groups that may or may not have table rows, But when I provide rows=[] to a particular table_group it doesn’t visible in the UI.

ui.table_group(
    label="Model Name 3",
    rows=[],
    collapsed=False,
)

But when I provide a table_group with a table_row where it has an empty list for cells it shows Invalid Date text for corresponding empty values where the table_column has data_type="time"

ui.table_group(
    label="Model Name 2",
    rows=[
        ui.table_row(
            name="model_2_version_3_table_row",
            cells=[],
        )
    ],
    collapsed=False,
),
Screenshot 2023-07-26 at 17 50 35

Expected behavior

(A clear and concise description of what you expected to happen.)
Table groups should be able to exist even without table rows

Steps To Reproduce

sample code

from h2o_wave import main, app, Q, ui


@app('/')
async def serve(q: Q):
    q.page['meta'] = ui.form_card(
        box='1 1 5 5',
        items=[
            ui.table(
                name='models_table',
                height="400px",
                columns=[
                    ui.table_column(
                        name="model_version_name_table_column",
                        label="Model Version Name",
                    ),
                    ui.table_column(
                        name="created_date_table_column",
                        label="Created Date",
                        data_type="time",
                    ),
                    ui.table_column(
                        name="last_updated_table_column",
                        label="Last Updated",
                        data_type="time",
                    ),
                ],
                groups=[
                    ui.table_group(
                        label="Model Name 1",
                        rows=[
                            ui.table_row(
                                name="model_1_version_1_table_row",
                                cells=[
                                    "Model Version 1",
                                    "2023/07/26 5:30 pm",
                                    "2022/06/25 04:29 am"
                                ],
                            ),
                            ui.table_row(
                                name="model_1_version_2_table_row",
                                cells=[
                                    "Model Version 2",
                                    "2023/07/26 5:30 pm",
                                    "2022/06/25 04:29 am"
                                ],
                            )
                        ],
                        collapsed=False,
                    ),
                    ui.table_group(
                        label="Model Name 2",
                        rows=[
                            ui.table_row(
                                name="model_2_version_1_table_row",
                                cells=[
                                    "Model Version 1",
                                    "2023/07/26 5:30 pm",
                                    "2022/06/25 04:29 am"
                                ],
                            ),
                            ui.table_row(
                                name="model_2_version_2_table_row",
                                cells=[
                                    "Model Version 2",
                                    "",
                                    ""
                                ],
                            ),
                            ui.table_row(
                                name="model_2_version_3_table_row",
                                cells=[],
                            )
                        ],
                        collapsed=False,
                    ),
                    ui.table_group(
                        label="Model Name 3",
                        rows=[],
                        collapsed=False,
                    )
                ],
            ),
        ]
    )

    await q.page.save()
@Nayananga Nayananga added the bug Bug in code label Jul 26, 2023
@marek-mihok marek-mihok added the ui Related to UI label Jul 26, 2023
@marek-mihok
Copy link
Contributor

@Nayananga this is a default by FluentUI's DetailsList the Wave is using but it can be changed on our side.

@mturoci, it can be easily managed by specifying groupProps={{ showEmptyGroups: true }} in DetailsList.
I wonder whether make it a new default or to introduce a new prop. Having a lot of empty groups in a table can be confusing in some situations.

image

@mturoci
Copy link
Collaborator

mturoci commented Jul 31, 2023

@Nayananga what's the point of showing empty groups?

@mturoci mturoci added question Question and removed bug Bug in code labels Jul 31, 2023
@Nayananga
Copy link
Contributor Author

@Nayananga what's the point of showing empty groups?

As I've mentioned above,
" I want to show table groups that may or may not have table rows"

these table data are fetching from a backend service, as how the ML works that may have models without registered model versions.

@mturoci
Copy link
Collaborator

mturoci commented Jul 31, 2023

That does not answer my question. Let me rephrase it: What's the UX value of showing empty groups?

@Nayananga
Copy link
Contributor Author

That does not answer my question. Let me rephrase it: What's the UX value of showing empty groups?

let me ping the UX team to answer it, @shihan007

cc @shereezhang @ShehanIshanka @sandruparo

@shihan007
Copy link

Let me discuss this with @shereezhang and get back to you

@shereezhang
Copy link

Hey thanks so much for considering this ticket @marek-mihok and @mturoci!

In the MLOps App 'Models' tab, there's a table which lists all the Registered Model Versions in a Project, and currently we group them by the Parent Model (ie. first row is Version 1, second is Version 2, etc) to show model lineage across versions. (can see example in Nayananga's screenshot)

In MLOps, it's possible to delete Model Versions without deleting the Parent Model (so the user can delete all rows but the table group should still exist cause the 'Parent' exists). We'd like to still be able to display this 'Parent Model' as an empty table group so the user knows that parent model still exists. Knowing the Parent Model exists in the UI is important because 1) the user may want to register new Model Versions (ie. rows) under it, or 2) we raise an error if a user tries to create Parent Models with duplicate names so the user should know what current Parent Model names are already used.

Hopefully this is helpful! let me know if there are further questions.
cc @Nayananga @shihan007

@mturoci
Copy link
Collaborator

mturoci commented Aug 4, 2023

Thanks for the clarification @shereezhang, that makes sense.

it can be easily managed by specifying groupProps={{ showEmptyGroups: true }}. I wonder whether make it a new default or to introduce a new prop.

@marek-mihok let's make it a new default.

@mturoci mturoci added feature Feature request and removed question Question labels Aug 4, 2023
marek-mihok added a commit that referenced this issue Sep 6, 2023
marek-mihok added a commit that referenced this issue Sep 6, 2023
marek-mihok added a commit that referenced this issue Sep 6, 2023
marek-mihok added a commit that referenced this issue Sep 7, 2023
marek-mihok added a commit that referenced this issue Sep 8, 2023
marek-mihok added a commit that referenced this issue Sep 13, 2023
marek-mihok added a commit that referenced this issue Sep 13, 2023
mturoci pushed a commit that referenced this issue Sep 19, 2023
mturoci pushed a commit that referenced this issue Sep 19, 2023
mturoci pushed a commit that referenced this issue Sep 19, 2023
mturoci pushed a commit that referenced this issue Sep 19, 2023
mturoci pushed a commit that referenced this issue Sep 19, 2023
mturoci pushed a commit that referenced this issue Sep 19, 2023
mturoci pushed a commit that referenced this issue Sep 19, 2023
mturoci pushed a commit that referenced this issue Sep 19, 2023
mturoci pushed a commit that referenced this issue Sep 19, 2023
mturoci added a commit that referenced this issue Oct 3, 2023
mturoci added a commit that referenced this issue Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request ui Related to UI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants