Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
520496e
(header) add alt text for org back-to-home link
manuhabitela Jul 17, 2025
5722b8d
(header) make org selection keyboard focusable
manuhabitela Jul 23, 2025
6b5d116
(nav) make the "add new" button in left panel keyboard focusable
manuhabitela Jul 17, 2025
778823b
(nav) in left panel, make workspace options menus keyboard focusable
manuhabitela Jul 17, 2025
635b58d
(styling) move the unstyled button in its own helper file
manuhabitela Jul 17, 2025
d6b7599
(a11y) add html region tags to ease up screen reader nav
manuhabitela Jul 17, 2025
fc87c87
(nav) video tour tool link: make it keyboard focusable
manuhabitela Jul 23, 2025
0a7fff4
(a11y) add alt text on help center icon link
manuhabitela Jul 17, 2025
04dcb00
(nav) make topbar icons keyboard focusable
manuhabitela Jul 17, 2025
f30d7fb
(nav) make top bar user icon kb focusable
manuhabitela Jul 17, 2025
b69aa52
(nav) make topbar left/right panel openers keyboard accessible
manuhabitela Jul 17, 2025
ee42a57
(home) improve html structure for better screen reader xp
manuhabitela Jul 17, 2025
5001a72
(home) docs list: small html changes for better screen reader ux
manuhabitela Jul 17, 2025
c1b9959
(home) make doc list easier to navigate with screen readers / kb
manuhabitela Jul 17, 2025
abaa3ce
(nav) workspace items in left panel are more screen reader friendly
manuhabitela Jul 17, 2025
a755821
(home) intro cards: clean translation strings
manuhabitela Jul 28, 2025
dfe5d3a
(a11y) reverse dots menu screen reader labels
manuhabitela Jul 30, 2025
92e1855
(home) fix video intro card outline not totally visible
manuhabitela Aug 12, 2025
6c8cb4d
(home) mobile doc list: fix documents that were not clickable anymore
manuhabitela Aug 12, 2025
bceef78
(home) doc list focus rings: fix layout shift
manuhabitela Aug 12, 2025
347a026
(home) fix main panel top-border focus ring not showing
manuhabitela Aug 12, 2025
aa801d5
(top bar) make the account widget focus ring stop bleeding out
manuhabitela Aug 12, 2025
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
Prev Previous commit
Next Next commit
(home) make doc list easier to navigate with screen readers / kb
- using one big `<a>` tag wrapping the whole row is not that great for
SR users as it gets pretty difficult to understand each part of the row.

now the link is actually only on the doc name, but the whole row is
still clickable thanks to a "stretchableLink" helper (taken from
bootstrap)

- adding some hidden "workspace" text before each workspace to help SR
users understand context

- hiding the doc icon from SR users as its purely decorative

- make the document dots button targettable through keyboard +
understandable for SR users
  • Loading branch information
manuhabitela committed Aug 12, 2025
commit c1b9959baa5626977ca586fe1170b1512a379e69
40 changes: 27 additions & 13 deletions app/client/ui/DocList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import {
} from "app/client/ui2018/cssVars";
import { IconName } from "app/client/ui2018/IconList";
import { icon as cssIcon } from "app/client/ui2018/icons";
import { unstyledH2, unstyledUl } from "app/client/ui2018/unstyled";
import { unstyledButton, unstyledH2, unstyledUl } from "app/client/ui2018/unstyled";
import { stretchedLink } from "app/client/ui2018/stretchedLink";
import { visuallyHidden } from "app/client/ui2018/visuallyHidden";
import { menu, menuItem, select } from "app/client/ui2018/menus";
import { confirmModal, saveModal } from "app/client/ui2018/modals";
Expand Down Expand Up @@ -159,7 +160,6 @@ export class DocList extends Disposable {
dom.forEach(docs, (doc) => {
return cssDocRow(
cssDoc(
urlState().setLinkUrl(docUrl(doc)),
cssDoc.cls("-no-access", !roles.canView(doc.access)),
cssDocIconAndName(
buildDocIcon(
Expand All @@ -168,10 +168,12 @@ export class DocList extends Disposable {
docName: doc.name,
icon: doc.options?.appearance?.icon,
},
testId("doc-icon")
testId("doc-icon"),
{'aria-hidden': 'true'},
),
cssDocNameAndBadges(
cssDocName(
urlState().setLinkUrl(docUrl(doc)),
stripIconFromName(doc.name, Boolean(doc.options?.appearance?.icon?.emoji)),
testId("doc-name")
),
Expand All @@ -187,7 +189,10 @@ export class DocList extends Disposable {
),
cssDocWorkspace(
dom.show(this._showWorkspace),
workspaceName(this._home.app, doc.workspace),
dom('span',
visuallyHidden(t("Workspace")),
workspaceName(this._home.app, doc.workspace)
),
testId("doc-workspace")
),
cssDocEditedAt(
Expand Down Expand Up @@ -218,6 +223,7 @@ export class DocList extends Disposable {
parentSelectorToMark: "." + cssDocRow.className,
}),
dom.on("click", (ev) => stopEvent(ev)),
{'aria-label': t("Document options - {{- documentName }}", {documentName: `"${doc.name}"`})},
testId("doc-options")
),
contextMenu(() => makeDocOptionsMenu(this._home, doc), {
Expand Down Expand Up @@ -508,19 +514,14 @@ const cssDocRow = styled("li", `
}
`);

const cssDoc = styled("a", `
const cssDoc = styled("div", `
display: flex;
position: relative;
align-items: center;
border-radius: 3px;
outline: none;
padding: 8px;

&, &:hover, &:focus {
text-decoration: none;
outline: none;
color: inherit;
}

&-no-access, &-no-access:hover, &-no-access:focus {
color: ${theme.disabledText};
cursor: not-allowed;
Expand Down Expand Up @@ -587,7 +588,7 @@ const noAccessStyles = `
}
`;

const cssDocName = styled("div", `
const cssDocName = styled(stretchedLink, `
font-size: 14px;
flex: 0 1 auto;
white-space: nowrap;
Expand All @@ -596,6 +597,17 @@ const cssDocName = styled("div", `
color: ${theme.text};
font-weight: 600;

&, &:hover, &:focus {
text-decoration: none;
outline: none;
color: inherit;
}

&:focus-visible {
outline-offset: -3px;
padding: 5px;
}

${noAccessStyles}

@media ${mediaMedium} {
Expand Down Expand Up @@ -660,7 +672,9 @@ const cssDocEditedAt = styled(cssEditedAtColumn, `
}
`);

const cssDocOptions = styled("div", `
const cssDocOptions = styled(unstyledButton, `
position: relative;
z-index: 2; /* make sure this is above the stretched link row */
flex: none;
display: flex;
justify-content: center;
Expand Down
17 changes: 17 additions & 0 deletions app/client/ui2018/stretchedLink.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* A link that has a clickable area that spans the entire containing block.
*
* Don't forget to apply the `position: relative` CSS property to the parent block you want the link to cover.
*
* @see https://getbootstrap.com/docs/5.3/helpers/stretched-link
*/
import {styled} from 'grainjs';

export const stretchedLink = styled('a', `
&::after {
position: absolute;
inset: 0;
content: '';
z-index: 1;
}
`);
1 change: 1 addition & 0 deletions static/locales/en.client.json
Original file line number Diff line number Diff line change
Expand Up @@ -2040,6 +2040,7 @@
"Sort by name": "Sort by name",
"Unpin": "Unpin",
"Workspace": "Workspace",
"Document options - {{- documentName }}": "Document options - {{- documentName }}",
"Documents list": "Documents list"
},
"RenameDocModal": {
Expand Down