Skip to content

Fix `<GitCommitNode />` `<li>` usage

Administrator requested to merge tr/fix-commit-node-li-bug into main

Created by: umpox

Description

This PR: https://github.com/sourcegraph/sourcegraph/pull/34960 defaulted GitCommitNode to use the <li> wrapper. This fixes a lot of issues as we almost always use this component in a list, however it probably isn't the best default element to use as it can cause unexpected accessibility issues.

We have one regression where we render it on its own: image

This PR adds a prop that lets us override it in this case.

Note: It'd be better just to let consumers wrap this in <li> where suitable, but this gets tricky due to FilteredConnection expecting a reference to a React component (we'd have to duplicate this component each time just to wrap it). This is the simpler approach, and also safer for accessibility right now.

Once fixed: image

Test plan

  1. Ran locally and checked all usage of <GitCommitNode />

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Loading