Skip to content

Commit

Permalink
Misc ARIA improvements (#2766)
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp authored Jan 3, 2024
1 parent a6a285e commit be464bc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions frontend/components/BottomRightPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export let BottomRightPanel = ({
? null
: html`<button
class="helpbox-close"
title="Close panel"
onClick=${() => {
set_open_tab(null)
}}
Expand Down
8 changes: 4 additions & 4 deletions frontend/components/ExportBanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const ExportBanner = ({ notebook_id, print_title, open, onClose, notebook
<div class="export_title">export</div>
<!-- no "download" attribute here: we want the jl contents to be shown in a new tab -->
<a href=${notebookfile_url} target="_blank" class="export_card" onClick=${(e) => exportNotebook(e, 0)}>
<header><${Triangle} fill="#a270ba" /> Notebook file</header>
<header role="none"><${Triangle} fill="#a270ba" /> Notebook file</header>
<section>Download a copy of the <b>.jl</b> script.</section>
</a>
<a
Expand All @@ -115,11 +115,11 @@ export const ExportBanner = ({ notebook_id, print_title, open, onClose, notebook
exportNotebook(e, 1)
}}
>
<header><${Square} fill="#E86F51" /> Static HTML</header>
<header role="none"><${Square} fill="#E86F51" /> Static HTML</header>
<section>An <b>.html</b> file for your web page, or to share online.</section>
</a>
<a href="#" class="export_card" onClick=${() => window.print()}>
<header><${Square} fill="#619b3d" /> PDF</header>
<header role="none"><${Square} fill="#619b3d" /> PDF</header>
<section>A static <b>.pdf</b> file for print or email.</section>
</a>
${html`
Expand All @@ -134,7 +134,7 @@ export const ExportBanner = ({ notebook_id, print_title, open, onClose, notebook
}}
class="export_card"
>
<header><${Circle} fill="#E86F51" /> Record <em>(preview)</em></header>
<header role="none"><${Circle} fill="#E86F51" /> Record <em>(preview)</em></header>
<section>Capture the entire notebook, and any changes you make.</section>
</a>
`}
Expand Down
3 changes: 2 additions & 1 deletion frontend/components/FrontmatterInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export const FrontMatterInput = ({ filename, remote_frontmatter, set_remote_fron
<button
class="deletefield"
title="Delete field"
aria-label="Delete field"
onClick=${() => {
// TODO
set_frontmatter(
Expand Down Expand Up @@ -116,7 +117,7 @@ export const FrontMatterInput = ({ filename, remote_frontmatter, set_remote_fron
If you are publishing this notebook on the web, you can set the parameters below to provide HTML metadata. This is useful for search engines and
social media.
</p>
<div class="card-preview">
<div class="card-preview" aria-hidden="true">
<h2>Preview</h2>
<${FeaturedCard}
entry=${
Expand Down
5 changes: 4 additions & 1 deletion frontend/components/ProcessTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ const StatusItem = ({ status_tree, path, my_clock_is_ahead_by, nbpkg, backend_la
}
}

const can_open = Object.values(mystatus.subtasks).length > 0

return path.length === 0
? inner
: html`<pl-status
Expand All @@ -199,8 +201,9 @@ const StatusItem = ({ status_tree, path, my_clock_is_ahead_by, nbpkg, backend_la
finished,
busy,
is_open,
can_open: Object.values(mystatus.subtasks).length > 0,
can_open,
})}
aria-expanded=${can_open ? is_open : undefined}
>
<div
onClick=${(e) => {
Expand Down

0 comments on commit be464bc

Please sign in to comment.