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

[🐛 BUG] Improve and fix stylekit to make UI elements more consistent #2305

Closed
1 of 7 tasks
FlorianJacta opened this issue Dec 6, 2024 · 7 comments · Fixed by #2313
Closed
1 of 7 tasks

[🐛 BUG] Improve and fix stylekit to make UI elements more consistent #2305

FlorianJacta opened this issue Dec 6, 2024 · 7 comments · Fixed by #2313
Assignees
Labels
🖰 GUI Related to GUI 💥Malfunction Addresses an identified problem. 🟧 Priority: High Must be addressed as soon

Comments

@FlorianJacta
Copy link
Member

FlorianJacta commented Dec 6, 2024

What went wrong? 🤔

Here is a list of UI components. The stylekit should provide a consistent set of UI elements. Some viz elements are higher than others.

image

Expected Behavior

Some elements should be fixed, and others may be improved. I don't have any specific recommendations for improvement.

Steps to Reproduce Issue

Run this code.

from taipy.gui import Gui, notify
import taipy.gui.builder as tgb


with tgb.Page() as page:
    with tgb.layout(columns="1 1 1 1 1"):
        tgb.selector(dropdown=True)
        tgb.selector(dropdown=True, filter=True)
        tgb.selector(
            dropdown=True,
            label="City",
        )
        tgb.selector(dropdown=True, label="City", filter=True)
        tgb.input("Some Text")
        tgb.input("Some Text", label="Write some text")
        tgb.number(10)
        tgb.number(10, label="Write a number")
        tgb.date("2021-01-01")
        tgb.date("2021-01-01", label="Pick a date")
        tgb.date("2021-01-01", with_time=True)
        tgb.date_range(["2021-01-01", "2022-01-01"])
        tgb.date_range(
            ["2021-01-01", "2022-01-01"], label_start="Start", label_end="End"
        )
        tgb.slider(10)
        tgb.slider(10, label="Pick a number")  # No label
        tgb.toggle(lov=["Yes", "No"])
        tgb.toggle(lov=["Yes", "No"], label="Yes or No")  # Misplaced label
        tgb.toggle(True)
        tgb.toggle(True, label="Yes or No")
        tgb.button("Click me")
        tgb.button("Click me full and plain", class_name="fullwidth plain")
        tgb.file_download()
        tgb.file_selector()
        tgb.file_selector(label="Pick a file")
        tgb.status("Ready")


Gui(page).run()

Other example

#2262

Visual elements should have the similar position and layouts in the default stylekit. For example, if I place a selector and a button side by side, they should be aligned:

from taipy.gui import Gui
import taipy.gui.builder as tgb


with tgb.Page() as page:
    with tgb.layout(columns="1 1 10"):
        with tgb.part():
            tgb.button("Click me")
        with tgb.part():
            tgb.selector("{selected}", lov="Furniture;Desk", dropdown=True)

Gui(page=page).run()

Here, they are misaligned:
image

This issue makes layouts a CSS nightmare in any application:
image

Browsers

Chrome

OS

Windows

Version of Taipy

4.0.1

Acceptance Criteria

  • A unit test reproducing the bug is added.
  • Any new code is covered by a unit tested.
  • Check code coverage is at least 90%.
  • The bug reporter validated the fix.
  • Related issue(s) in taipy-doc are created for documentation and Release Notes are updated.

Code of Conduct

  • I have checked the existing issues.
  • I am willing to work on this issue (optional)
@FlorianJacta FlorianJacta added 🖰 GUI Related to GUI 💥Malfunction Addresses an identified problem. 🟧 Priority: High Must be addressed as soon labels Dec 6, 2024
@jrobinAV jrobinAV changed the title [🐛 BUG] Improve and fix stylekit to make UI elements more coherent [🐛 BUG] Improve and fix stylekit to make UI elements more consistent Dec 6, 2024
@FredLL-Avaiga FredLL-Avaiga self-assigned this Dec 10, 2024
FredLL-Avaiga pushed a commit that referenced this issue Dec 10, 2024
@FredLL-Avaiga
Copy link
Member

Image

@FlorianJacta
Copy link
Member Author

Do you have this example too?

from taipy.gui import Gui
import taipy.gui.builder as tgb


with tgb.Page() as page:
    with tgb.layout(columns="1 1 10"):
        with tgb.part():
            tgb.button("Click me")
        with tgb.part():
            tgb.selector("{selected}", lov="Furniture;Desk", dropdown=True)

Gui(page=page).run()

@FredLL-Avaiga
Copy link
Member

image
When I change taipy-selector's margin to 0 in selector.css (I'll side load this in my current PR)

FredLL-Avaiga pushed a commit that referenced this issue Dec 10, 2024
resolves #2302
fix selector y padding
relates to #2305
FredLL-Avaiga added a commit that referenced this issue Dec 10, 2024
* Chart refresh col but no data
resolves #2302
fix selector y padding
relates to #2305

* no need to postpone the dispatch

---------

Co-authored-by: Fred Lefévère-Laoide <[email protected]>
FabienLelaquais added a commit that referenced this issue Dec 17, 2024
* Backport to 4.0 of Taipy GUI issues #2212, #2242, #2281, #2286, #2302, and #2305.
* Upgrade JS bundles versions to 4.0.2
@FlorianJacta
Copy link
Member Author

There is still a slight issue of alignment here
image

@FredLL-Avaiga
Copy link
Member

Some code?

@FlorianJacta
Copy link
Member Author

It is the one from the issue. The top right of the screen

FredLL-Avaiga pushed a commit that referenced this issue Dec 18, 2024
FredLL-Avaiga added a commit that referenced this issue Dec 18, 2024
resolves #2305

Co-authored-by: Fred Lefévère-Laoide <[email protected]>
FredLL-Avaiga pushed a commit that referenced this issue Dec 18, 2024
FredLL-Avaiga added a commit that referenced this issue Dec 20, 2024
* #2152 on submission change called twice with same status (#2353)
#2305 normalize components height
resolves #2152 #2305

* unused import

* fix test

* fix tests

---------

Co-authored-by: Fred Lefévère-Laoide <[email protected]>
@AlexandreSajus
Copy link
Contributor

Fixed in 4.0.2.dev2. Beautiful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🖰 GUI Related to GUI 💥Malfunction Addresses an identified problem. 🟧 Priority: High Must be addressed as soon
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants