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

MBS-8748: Wrap medium name in release tracklist #481

Merged
merged 1 commit into from Mar 5, 2017

Conversation

yvanzo
Copy link
Contributor

@yvanzo yvanzo commented Mar 2, 2017

MBS-8748: Long medium names caused horizontal scrolling on release pages.

This patch wraps medium name and visually split the header line into (borderless) cells so that medium format and medium number are clearly distinguished from wrapped medium name.

@yvanzo yvanzo force-pushed the mbs-8748-wrap-medium-header branch from 212f013 to 3f1625d Compare March 2, 2017 12:14
@@ -834,9 +834,9 @@ END -%]
};
IF medium.name != '';
args.medium_name = isolate_text(medium.name);
l('{medium_format} {position}: {medium_name}', args);
l('<span>{medium_format} {position}:</span> {medium_name}', args);
Copy link
Member

Choose a reason for hiding this comment

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

I think it'd be good to add something like class="medium-format-position" here and refer to that in the CSS, so we don't have to worry about ambiguity later. Also easier to grep where a style is coming from that way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no specific rule for this element in the style sheet as > span rules include span.expand-triangle also. Instead, I could wrap {medium_name} into a span with medium-name class to refer to in the style sheet in place of not-semantic bdi. Or do both?

Copy link
Member

Choose a reason for hiding this comment

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

Right, though I think it's good to avoid CSS selectors that depend too much on the structure of the HTML. Unless the style would break if it wasn't a direct child of <a>.

About ambiguity, I mean if we change the surrounding HTML later and the generic <span> no longer works, we'll have to change the string again (unless it has a class name we could use).

Feel free to change it to whatever you think is best (or we can merge it as-is).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I cleaned CSS rules and reduced changes made to localized messages in updated 83e0fc4
I added medium-name class only which is useful to apply normal white-space wrapping style .
Other classes can be added later on if necessary without changing localized messages.

@yvanzo yvanzo force-pushed the mbs-8748-wrap-medium-header branch from 3f1625d to 83e0fc4 Compare March 3, 2017 17:49
args.medium_name = isolate_text(medium.name);
l('{medium_format} {position}: {medium_name}', args);
l('{medium_format_position} {medium_name}', {
medium_format_position => '<span>' _ add_colon(format_position) _ '</span>',
Copy link
Member

Choose a reason for hiding this comment

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

I like how the HTML was moved out of the string. 👍

I guess this'll allow translators to change the order of {medium_format_position} and {medium_name}, and maybe add additional words for context. Does that make sense if these are supposed to be in separate cells?

There seems to be a contradiction between having these cells visually separated from each other, but allowing translators to edit the string as if it's all in one cell. So maybe we shouldn't have this "combined" string anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It makes sense for right-to-left locales such as Arabic, although Arabic translation is currently 0% complete and most of UI (except medium header) is not ready for right-to-left locales yet. 😆

But I agree, left-to-right ordering of cells would have to be done by template, not by message.

Updated in bc878ed

Long medium names caused horizontal scrolling on release pages.

This patch wraps medium names and only medium names.  In order to
keep distinguishing medium format and position from medium name,
header link is split into elements which are styled as table cells.

The ordering of these cells is moved from message to template level.

Template macro `medium_description` has been modified so that
`span`/`class` can be added without change to localizable messages.
@yvanzo yvanzo force-pushed the mbs-8748-wrap-medium-header branch from 83e0fc4 to bc878ed Compare March 3, 2017 20:47
@mwiencek mwiencek merged commit 0d8996c into metabrainz:master Mar 5, 2017
@yvanzo yvanzo deleted the mbs-8748-wrap-medium-header branch April 2, 2017 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants