Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Accessibility: Add Landmark navigation #12190

Merged
merged 39 commits into from
Jul 17, 2024
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
98dd07c
Override aria-label for whole tile
akirk Dec 1, 2023
6e6696e
Message navigation
akirk Dec 12, 2023
b777dbd
Change hotkeys to use cmd/ctrl
akirk Dec 12, 2023
3bb1bb4
Add landmark navigation
akirk Dec 8, 2023
45cd0da
No cmd in Electron
akirk Dec 8, 2023
fd93d03
Fallback when no room is selected
akirk Dec 8, 2023
a954941
Review fixes
akirk Dec 12, 2023
1eac6ff
Handle invisible events better
akirk Dec 12, 2023
36048c1
Fix lint errors
akirk Mar 8, 2024
4c2c31f
Lint fixes, remove stray code from other PR
akirk Mar 8, 2024
645dc4c
Remove message navigation code
akirk Mar 8, 2024
f55ba53
Remove more stray code
akirk Mar 8, 2024
9bdc225
lint fixes
akirk Mar 8, 2024
e34baa5
fix room list landmark
akirk Mar 8, 2024
5ebd292
lint fixes
akirk Mar 8, 2024
d9d10d2
Remove copied function
akirk Mar 8, 2024
af40c89
update comment
akirk Mar 8, 2024
aee0c5f
lint
akirk Mar 8, 2024
87ce6d2
Update keyboard user settings snapshot
akirk Mar 8, 2024
87492e3
Merge branch 'develop' into add-landmark-navigation
MidhunSureshR May 14, 2024
e3ebda6
Fix lint
MidhunSureshR May 14, 2024
7fba563
Move code to a single file
MidhunSureshR May 15, 2024
f3b7f12
Merge branch 'develop' into add-landmark-navigation
MidhunSureshR May 15, 2024
7eb4dc6
Add jest test
MidhunSureshR May 15, 2024
9608b75
Merge branch 'develop' into add-landmark-navigation
MidhunSureshR Jul 14, 2024
d043ae9
Use a circular array for storing the order of landmarks
MidhunSureshR Jul 14, 2024
e38849a
Fix test
MidhunSureshR Jul 14, 2024
7edb9d4
Rename test
MidhunSureshR Jul 16, 2024
b493ac2
Change implementation
MidhunSureshR Jul 16, 2024
1396862
Add playwright test
MidhunSureshR Jul 16, 2024
477f58e
Add more tests
MidhunSureshR Jul 16, 2024
6c8e191
Fix comments and name
MidhunSureshR Jul 16, 2024
b2ce73b
Replacee method with Array.at
MidhunSureshR Jul 16, 2024
ea4fea8
Make changes from review
MidhunSureshR Jul 16, 2024
0961cae
Fix case; landmarkToDOMElementMap -> landmarkToDomElementMap
MidhunSureshR Jul 16, 2024
114cc77
Add stricter check
MidhunSureshR Jul 16, 2024
1d8ab2a
Add type to map
MidhunSureshR Jul 16, 2024
9f29735
Pass focusVisible option to focus call
MidhunSureshR Jul 17, 2024
d1085b7
Move type to global.d.ts
MidhunSureshR Jul 17, 2024
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
8 changes: 7 additions & 1 deletion src/accessibility/LandmarkNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ import { TimelineRenderingType } from "../contexts/RoomContext";
import { Action } from "../dispatcher/actions";
import defaultDispatcher from "../dispatcher/dispatcher";

/**
* In future, browsers will support focusVisible option.
* See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#focusvisible
*/
type ExperimentalFocusOptions = FocusOptions & { focusVisible: true };
Copy link
Member

@t3chguy t3chguy Jul 17, 2024

Choose a reason for hiding this comment

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

Can you add this type in global.d.ts instead to avoid needing to type cast and to get the benefit in all files? As an overload for the HTMLElement::focus method

Copy link
Contributor

Choose a reason for hiding this comment

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

done, d1085b7

Copy link
Member

Choose a reason for hiding this comment

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

It might need to be optional focusVisible?: boolean but CI will show


export const enum Landmark {
// This is the space/home button in the left panel.
ACTIVE_SPACE_BUTTON,
Expand Down Expand Up @@ -67,7 +73,7 @@ export class LandmarkNavigation {
landmark = LandmarkNavigation.getLandmark(landmark, backwards);
element = landmarkToDomElementMap[landmark]();
}
element?.focus();
element?.focus({ focusVisible: true } as ExperimentalFocusOptions);
}
}

Expand Down
Loading