-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[14.0][IMP] web_tree_many2one_clickable: improved visualization #3070
[14.0][IMP] web_tree_many2one_clickable: improved visualization #3070
Conversation
39a01d2
to
a3f4a40
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functional ok!
@pedrobaeza does code look good?
I have troubles testing on runboat whether the issue is present in later versions
I can't say, as I'm not using anymore this version, and this should be compatible with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code and functional review: mostly seems to work fine, but a few issues.
html: this.$el.html(), | ||
class: this.$el.attr("class") + " o_field_text", | ||
class: this.$el.attr("class") + "o_field_text", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue:
class: this.$el.attr("class") + "o_field_text", | |
class: this.$el.attr("class") + " o_field_text", |
margin-left: 0.5; | ||
visibility: hidden; | ||
position: relative; | ||
transition: all 0.2s ease; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment: I find this transition very unpleasant and distracting. Move your mouse across the screen and you have a handful of arrows slowly appearing and disappearing.
I'd personally prefer to have it appear and disappear instantly, as it was before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed the transition as suggested.
|
||
&:hover a { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick (non-blocking): I would personally prefer, for readability and maintainability, to make use of scss syntax features, such as nesting selectors etc, as it was before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have taken care of it as suggested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (non-blocking): I probably wasn't very clear. This is what I meant:
td.o_many2one_cell {
display: flex;
align-items: center;
position: relative;
a {
margin-left: 0.5em;
visibility: hidden;
position: relative;
}
&:hover a {
visibility: visible;
}
}
And then you can remove lines 33-37
Also:
.o_many2one_container {
display: flex;
gap: 0.5em; /* Space between the containers */
.o_text_container {
max-width: fit-content;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
div.o_custom_field_text {
position: relative;
max-width: fit-content;
vertical-align: bottom;
}
[etc...]
}
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
} | ||
td.o_field_text { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: o_field_text
is a class used in base odoo. The chance of causing issues elsewhere by changing the way it is displayed is quite high.
I think it'd be best to use a different class entirely to add this styling; or at the very least the scope of the selectors should be narrowed down a lot more so that there are (almost) no chances for it to affect unrelated elements in other modules, both custom and from base odoo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added "custom" to the class name to differentiate it from the "field_text" class, preventing any errors, and I have also added the div to ensure a lower scope.
c88abfb
to
05299f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionally works well for me now.
Code can be cleaned up (probably even further than what I pointed out in the comments) but is mostly ok.
html: this.$el.html(), | ||
class: this.$el.attr("class") + " o_field_text", | ||
class: this.$el.attr("class") + " o_custom_field_text", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: maybe we can have both classes o_field_text
and o_custom_field_text
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't add both classes; in fact, if I add the o_field_text class, the rows expand again.
|
||
&:hover a { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (non-blocking): I probably wasn't very clear. This is what I meant:
td.o_many2one_cell {
display: flex;
align-items: center;
position: relative;
a {
margin-left: 0.5em;
visibility: hidden;
position: relative;
}
&:hover a {
visibility: visible;
}
}
And then you can remove lines 33-37
Also:
.o_many2one_container {
display: flex;
gap: 0.5em; /* Space between the containers */
.o_text_container {
max-width: fit-content;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
div.o_custom_field_text {
position: relative;
max-width: fit-content;
vertical-align: bottom;
}
[etc...]
}
} | ||
/*BUTTON CONTAINER AND BUTTON CSS*/ | ||
.o_button_container { | ||
left: 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rearranged the classes as you requested.
.o_text_container { | ||
max-width: fit-content; | ||
overflow: hidden; | ||
white-space: nowrap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chore (non-blocking): I don't think specifying white-space
is necessary since it's already inherited.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the "white-space"; in fact, it was already inherited as you said.
left: 0; | ||
} | ||
td.o_many2one_cell a { | ||
margin-left: 0.5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chore: missing UoM
margin-left: 0.5; | |
margin-left: 0.5em; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the UoM
05299f9
to
7be25dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code and functional review, LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functional is looking good
@pedrobaeza how could I check whether it works correctly with web_responsive?
In runboat both should be installed. |
Yes, from what I can see they seem to have the same behavior before and after this PR |
@OCA/web-maintainers ping :) |
@pedrobaeza we verified compatibility with web_responsive both functionally and for code. Can this be merged? Thanks! |
/ocabot merge patch |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at 526845d. Thanks a lot for contributing to OCA. ❤️ |
Before my improvement:


The text was expanding the height of the line, making it harder to maintain consistency and readability across rows.
After my improvement:
The text no longer affects the height of the line, which improves the visibility and alignment of rows.
This adjustment enhances the overall readability and ensures a more structured layout.