Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/BloomBrowserUI/bookEdit/StyleEditor/StyleEditor.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@
h2 {
font-size: 10pt;
}
.bloomDialogTitleBar {
position: relative;
}

// this is an unfortunate ui hack because we can't yet put the language code as a tooltip on the language
// tag itself because it is a psuedo-element. (BL-15212)
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

Spelling error: "psuedo-element" should be "pseudo-element".

Suggested change
// tag itself because it is a psuedo-element. (BL-15212)
// tag itself because it is a pseudo-element. (BL-15212)

Copilot uses AI. Check for mistakes.
#format-toolbar-lang-code {
position: absolute;
right: 10px;
top: 50%;
transform: translateY(-50%);
font-size: 0.85em;
color: rgba(255, 255, 255, 0.75);
}
// Styles specific to the Style Editor dialog
.format-toolbar-description {
font-size: small;
Expand Down
33 changes: 18 additions & 15 deletions src/BloomBrowserUI/bookEdit/StyleEditor/StyleEditor.pug
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,29 @@ mixin img(filename)
img(src='/bloom/bookEdit/img/' + filename)

#format-toolbar.bloom-ui.bloomDialogContainer(style="visibility: hidden;")
.bloomDialogTitleBar(data-i18n="EditTab.FormatDialog.Format") Format
.bloomDialogTitleBar
span(data-i18n="EditTab.FormatDialog.Format") Format
span#format-toolbar-lang-code
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

The span#format-toolbar-lang-code element should have aria-hidden="true" as an initial attribute since it starts empty and will be hidden by updateTitleBarLanguageCode() when there's no language code. This prevents screen readers from announcing an empty element before the JavaScript initialization runs.

Suggested change
span#format-toolbar-lang-code
span#format-toolbar-lang-code(aria-hidden="true")

Copilot uses AI. Check for mistakes.
.hideWhenFormattingEnabled.bloomDialogMainPage
p(data-i18n="BookEditor.FormattingDisabled") Sorry, Reader Templates do not allow changes to formatting.
#tabRoot.hideWhenFormattingDisabled.tab-pane
#style-page.tab-page
h2.tab(data-i18n="EditTab.FormatDialog.StyleNameTab") Style Name
.bloomDialogMainPage(data-i18n="EditTab.FormatDialog.Style") Style
#style-group.state-initial
select#styleSelect
#dont-see
span(data-i18n="EditTab.FormatDialog.DontSeeNeed") Don't see what you need?
= ' '
a#show-createStyle(href="" data-i18n="EditTab.FormatDialog.CreateStyle") Create a new style
#createStyle
div(data-i18n="EditTab.FormatDialog.NewStyle") New style
div
input#style-select-input(type="text")
button#create-button(data-i18n="EditTab.FormatDialog.Create" disabled) Create
#please-use-alpha(style="color: red;" data-i18n="EditTab.FormatDialog.PleaseUseAlpha") Please use only alphabetical characters. Numbers at the end are ok, as in "part2".
#already-exists(style="color: red;" data-i18n="EditTab.FormatDialog.AlreadyExists") That style already exists. Please choose another name.
.bloomDialogMainPage
div(data-i18n="EditTab.FormatDialog.Style") Style
#style-group.state-initial
select#styleSelect
#dont-see
span(data-i18n="EditTab.FormatDialog.DontSeeNeed") Don't see what you need?
= ' '
a#show-createStyle(href="" data-i18n="EditTab.FormatDialog.CreateStyle") Create a new style
#createStyle
div(data-i18n="EditTab.FormatDialog.NewStyle") New style
div
input#style-select-input(type="text")
button#create-button(data-i18n="EditTab.FormatDialog.Create" disabled) Create
#please-use-alpha(style="color: red;" data-i18n="EditTab.FormatDialog.PleaseUseAlpha") Please use only alphabetical characters. Numbers at the end are ok, as in "part2".
#already-exists(style="color: red;" data-i18n="EditTab.FormatDialog.AlreadyExists") That style already exists. Please choose another name.
.tab-page
h2.tab(data-i18n="EditTab.FormatDialog.CharactersTab") Characters
.bloomDialogMainPage
Expand Down
18 changes: 18 additions & 0 deletions src/BloomBrowserUI/bookEdit/StyleEditor/StyleEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1529,6 +1529,23 @@ export default class StyleEditor {
});
}

// this is an unfortunate ui hack because we can't yet put the language code as a tooltip on the language
// tag itself because it is a psuedo-element (BL-15212).
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

Spelling error: "psuedo-element" should be "pseudo-element".

Suggested change
// tag itself because it is a psuedo-element (BL-15212).
// tag itself because it is a pseudo-element (BL-15212).

Copilot uses AI. Check for mistakes.
private updateTitleBarLanguageCode() {
const target = $("#format-toolbar-lang-code");
if (target.length === 0) {
return;
}
const langCode = ($(this.boxBeingEdited).attr("lang") || "").trim();
if (langCode) {
target.text(langCode);
target.removeAttr("aria-hidden");
} else {
target.text("");
target.attr("aria-hidden", "true");
}
}

// The More tab settings are never language-dependent
public getParagraphTabDescription() {
const styleName = StyleEditor.GetBaseStyleNameForElement(
Expand Down Expand Up @@ -2319,6 +2336,7 @@ export default class StyleEditor {

$("#format-toolbar").remove(); // in case there's still one somewhere else
$("body").append(html);
this.updateTitleBarLanguageCode();

if (noFormatChange) {
$("#format-toolbar").addClass("formattingDisabled");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ export default class BloomSourceBubbles {
// helpful.
$(list).append(
'<li id="' +
langTag +
'" title="' +
langTag +
'"><a class="sourceTextTab" href="#' +
langTag +
Expand Down
Loading