Skip to content

Click anywhere on byline to collapse a comment#3198

Merged
dessalines merged 1 commit intoLemmyNet:mainfrom
philip-peterson:click-anywhere-to-collapse
Jun 24, 2025
Merged

Click anywhere on byline to collapse a comment#3198
dessalines merged 1 commit intoLemmyNet:mainfrom
philip-peterson:click-anywhere-to-collapse

Conversation

@philip-peterson
Copy link
Copy Markdown
Contributor

Description

This PR intends to increase target clickable area in furtherance of accessibility. Similarly to Reddit, allows the user to click anywhere alongside the byline (username, etc.) to collapse a comment. Affects URLs at /post/*.

Does not fix a separate issue.

Disclaimer

This PR departs a bit from convention by exempting a code change from a couple of lint rules, and here is why I believe these are an exception. (For reference, the lint rules relate to clickable element requirements.):

The button element for collapsing comments still exists as before, with the key and click handlers, and continues to serve as an accessibility-friendly way to toggle the collapsed? state of a CommentNode. This PR simply expands the clickable region (which is itself for accessibility reasons), but having screen readers treat the entire region as a button or clickable element is not a desired behavior, since it may contain other clickable elements within. This is intended as a convenience for graphical users (desktop, mobile).

Screenshots

No visual difference, but new behavior:

click-anywhere

@philip-peterson philip-peterson changed the base branch from release/v0.19 to main June 19, 2025 06:28
Copy link
Copy Markdown
Member

@dessalines dessalines left a comment

Choose a reason for hiding this comment

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

Not a fan of this, and it really isn't necessary since there's already a collapse button. Also its probably confusing for i18n.

@philip-peterson
Copy link
Copy Markdown
Contributor Author

philip-peterson commented Jun 20, 2025

The issue with a collapse button is that its horizontal position changes at each indentation level. It's also a smaller click target, which can be an issue for those with visual impairments. On mobile, most people are using their right hand which poses difficulty since the collapse button is on the left. When the click region is the entire bar, it makes the core workflow of collapsing to skip past irrelevant discussion much easier.

Copy link
Copy Markdown
Member

@dessalines dessalines left a comment

Choose a reason for hiding this comment

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

Alright, hopefully it doesn't cause any issues.

@dessalines dessalines merged commit e2fcf3a into LemmyNet:main Jun 24, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants