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: disclosure #1068

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

ethanalvizo
Copy link
Contributor

@ethanalvizo ethanalvizo commented Dec 18, 2024

Closes #1037

Web-client-ui PR that exports Accordion and Disclosure is merged. Not sure if it was already a part of the release though

@ethanalvizo ethanalvizo self-assigned this Dec 18, 2024
@ethanalvizo ethanalvizo marked this pull request as ready for review December 26, 2024 21:06
@ethanalvizo ethanalvizo requested a review from mofojed December 31, 2024 20:52
margaretkennedy
margaretkennedy previously approved these changes Jan 3, 2025
Copy link
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

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

You'll need to update plugins/ui/src/js/package.json to use the v102 versions of the @deephaven/ packages that include Disclosure to fix the build errors.

@ethanalvizo ethanalvizo requested a review from mofojed January 17, 2025 21:29
Copy link
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

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

Should add Disclosure to e2e tests as well. Would be cool to add your own e2e test instead of the render_all catchall.

plugins/ui/docs/components/disclosure.md Outdated Show resolved Hide resolved
plugins/ui/docs/components/disclosure.md Outdated Show resolved Hide resolved
plugins/ui/docs/components/disclosure.md Outdated Show resolved Hide resolved
plugins/ui/docs/components/disclosure.md Outdated Show resolved Hide resolved
plugins/ui/docs/components/disclosure.md Show resolved Hide resolved
plugins/ui/docs/components/disclosure.md Outdated Show resolved Hide resolved
my_disclosure_disabled = ui.disclosure(
title="Heading", panel="Content", default_expanded=True
)
```
Copy link
Member

Choose a reason for hiding this comment

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

Add some examples using disclosure_title and disclosure_panel, showing off disclosures with different levels in the disclosure_title, and a disclosure_panel with some padding.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this code snippet as an example but investigating why they all render with the same style. When inspecting the elements they are rendering as H1, H2, H3,... respectively. Style overwriting seems to be coming from elsewhere

from deephaven import ui


@ui.component
def ui_disclosure_title_levels():
    return [
        ui.disclosure(
            ui.disclosure_title("H1", level=1),
            ui.disclosure_panel("Content", margin="10px"),
        ),
        ui.disclosure(
            ui.disclosure_title("H2", level=2),
            ui.disclosure_panel("Content", margin="10px"),
        ),
        ui.disclosure(
            ui.disclosure_title("H3", level=3),
            ui.disclosure_panel("Content", margin="10px"),
        ),
        ui.disclosure(
            ui.disclosure_title("H4", level=4),
            ui.disclosure_panel("Content", margin="10px"),
        ),
        ui.disclosure(
            ui.disclosure_title("H5", level=5),
            ui.disclosure_panel("Content", margin="10px"),
        ),
        ui.disclosure(
            ui.disclosure_title("H6", level=6),
            ui.disclosure_panel("Content", margin="10px"),
        ),
    ]


my_disclosure_title_levels = ui_disclosure_title_levels()

Copy link
Member

Choose a reason for hiding this comment

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

Hmm it looks like that's actually an issue in React spectrum.
In which case, remove this example, don't bother mentioning level, create a follow up ticket that tracks a ticket I filed against React-spectrum: adobe/react-spectrum#7671

plugins/ui/src/js/src/widget/WidgetUtils.tsx Show resolved Hide resolved
@ethanalvizo ethanalvizo requested a review from mofojed January 27, 2025 14:18
my_disclosure_disabled = ui.disclosure(
title="Heading", panel="Content", default_expanded=True
)
```
Copy link
Member

Choose a reason for hiding this comment

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

Hmm it looks like that's actually an issue in React spectrum.
In which case, remove this example, don't bother mentioning level, create a follow up ticket that tracks a ticket I filed against React-spectrum: adobe/react-spectrum#7671

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.

ui.disclosure
3 participants