dbeaver / dbeaver

Free universal database tool and SQL client
https://dbeaver.io
Apache License 2.0
40.6k stars 3.5k forks source link

Row colorization priorities seem random #36166

Open ChaoticEntertainment opened 2 weeks ago

ChaoticEntertainment commented 2 weeks ago

Description

How to sort the row colors? Two columns in a single row are trying to color the same row, how to choose which one ends up being the dominant color? I have the same table twice, but the behavior in both tables on this is different.

DBeaver Version

Community Edition 24.2.4.202411031831

Operating System

Windows 11

Database and driver

No response

Steps to reproduce

No response

Additional context

No response

ShadelessFox commented 2 weeks ago

Hello @ChaoticEntertainment,

Can you please provide footage showing the issue? It's not entirely clear what you're talking about.

ChaoticEntertainment commented 2 weeks ago

I cannot provide footage as the data is confidential, but it shouldn't be that unclear.

Just imagine that two "Row Color" checks are true at the same time in two different columns on the same row. They both want to color the whole row in their own colors (red & blue). How does DBeaver ultimately decide whether the resulting color will be red or blue? As doing the same setup again on another table, leads to the opposite color winning.

I can provide a quick mockup of the issue, showcasing that the same rule setup leads to different results in different tables: image

ShadelessFox commented 2 weeks ago

Thanks for the clarification. DBeaver uses the last matching color as the final color:

image

I don't consider this a bug.

ChaoticEntertainment commented 2 weeks ago

We're getting closer but you still haven't reached a full understanding of the issue. The two "Row Color" rules are defined in two seperate columns, not in the same one.

ShadelessFox commented 2 weeks ago

Okay, I missed that detail. I found the issue; thanks for the report.

kseniaguzeeva commented 2 weeks ago

Verified

ChaoticEntertainment commented 5 days ago

I just updated to the latest stable version that includes this commit, and my issue is not solved. Maybe it helps to point out that one of my two tables is a Table and the other is a View? Have you potentially forgotten to apply this fix to Views as well?

ShadelessFox commented 5 days ago

What version did you install? The fix is included in 24.2.5, and I just confirmed that it's really there.

The latest attribute's color, according to their visual order, should be used as the final color. Is the color still random?

ChaoticEntertainment commented 5 days ago

Yup, that's the version I got. I don't know for certain whether the color is actually random, but it's certainly not following the visual order in my View, as opposed to my Table.

ChaoticEntertainment commented 5 days ago

Here's an image of the exact situation and issue. Both pictured rows should be pink colored, but UsersView, contrary to Users, is ignoring the visual order in the Row Color settings window.

image

Users and UsersView are essentially clones of eachother, so I need them to look the same.

kseniaguzeeva commented 3 days ago

@ChaoticEntertainment Could you please provide me an information about your database? Maybe it could help to reproduce the issue.

ChaoticEntertainment commented 3 days ago

It can be noted that in both cases the "Lite" column has been moved in front of the "UserID" column using a DBeaver custom filter, meaning that "Lite" was originally located behind "UserID". This could've confused the UsersView coloring maybe?

image

kseniaguzeeva commented 2 days ago

The only way I've reproduced the behavior is:

  1. to apply the color to UserId column
  2. to apply the color to Lite column
  3. to change columns order in the custom filter.

Can it be your case?

https://github.com/user-attachments/assets/ced0be4d-208f-4621-9c3e-be81fea0e05a

ChaoticEntertainment commented 2 days ago

That's indeed how it's done in both my table & view, though both get different results when doing so:

image

The expected result is that they both behave the same way. (That way preferably being to always respect the custom order, as the Row Color settings screen itself respects it as well, so in this case I'd like to see them both be colored pink.)