Issue 1: Broken Heading Navigation / DOM Manipulation

Hey @awesomerobot, I’m a colleague of Cody’s and an accessibility engineer. I gave the repository a look to diagnose the issue. As you may already know, the core issue appears to be that (1) Content in cloaked posts are not viewable by screen readers and (2) Posts are only uncloaked when within a users view per PostStreamViewportTracker

Thinking through a potential fix, I want to optimize on two things: (1) Enable navigation of each post by heading with screen readers and (2) Minimize changes to the Discourse repo and impact on performance.

The approach I recommend is to keep a lightweight wrapper for each loaded post that includes the semantic H2 used for heading navigation, while the heavy post body remains cloaked. This keeps headings stable for assistive tech without inflating the DOM across the entire page. When a user lands on any post’s H2 via heading navigation, the screen reader will trigger a page scroll which will in turn uncloak the post’s body in place.

The viability of this solution depends on when the next chunk of posts are loaded. An optional improvement is a screen-reader only sentinel heading “load more posts” (similar to the "load more region” proposed in your PR) located at the bottom of the list of loaded posts. When this heading comes into view or is selected from the headings rotor, it loads the next chunk and announces completion via an aria-live=polite message.

3 Likes