Skip to content

Fix whitesapce hack with corrected display value

Kerri Miller requested to merge 121612-remove-zero-width-hack into master

What does this MR do?

Context

The previous "zero-width space hack" is present to "force" the cell to stay "open." Because the td is displayed as block (unknown why?), if it has no content, the entire cell will collapse to nothing.

Catch-Up

The comment that this MR references implies that we would move the zero-width whitespace into the backend response for rich_text. However, this is pretty hacky no matter where it lives, so we'd ideally remove the comment, remove the whitespace hack, and fix this another way.

Fix

What we've done is switched the td back to being displayed as a table-cell if it has no content. This causes it to have the full height and width of the space it should inhabit, even when it has nothing inside of it.

This also updates tests for the way the row displays.

Previous Description

The comment was a bit misleading, but also outdated now that we use rich_text for diff display. We could likely remove the actual fallback of showing a non-breaking space here, since I can't think of any diff that wouldn't have either rich_text or text, but in the interest of safety let's leave it (but remove the comment, since that might actually confuse someone!)

Screenshots

There aren't any visual changes for this since it's ~backstage work, but we're dealing with any blank line in a review suggestion diff.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • ~~Label as security and @ mention @gitlab-com/gl-security/appsec~~
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Closes #121612 (closed)

Edited by Thomas Randolph

Merge request reports