Skip to content

Fix empty vertical scrollbar in PR comment diff table - #1078

Open
TovaBecker wants to merge 2 commits into
github-community-projects:main-enterprisefrom
TovaBecker:tova.becker/fix-diff-table-scrollbar
Open

TovaBecker wants to merge 2 commits into
github-community-projects:main-enterprisefrom
TovaBecker:tova.becker/fix-diff-table-scrollbar

Conversation

@TovaBecker

@TovaBecker TovaBecker commented Sep 18, 2026

Copy link
Copy Markdown

Summary

  • Fixes PR comment diff table shows an empty vertical scrollbar due to malformed <tr> markup #1077 — the diff table posted in the safe-settings PR comment showed an empty vertical scrollbar (scrolling nothing).
  • Root cause: each diff row ended with a stray <tr> instead of </tr>, and the table was never closed with </tbody></table>. Browsers silently "fixed" this malformed markup by inserting a phantom empty row, which threw off GitHub's <markdown-accessiblity-table> wrapper component's scroll-affordance measurement.
  • Fix: properly close each row with </tr>, and close the table with </tbody></table>.

Test plan

  • npm run test:unit passes (37/37 in test/unit/lib/settings.test.js), no new lint violations.
  • Verified against a real PR comment by fetching the rendered HTML via the GitHub API (Accept: application/vnd.github.html+json) before and after the fix — confirmed the phantom <tr></tr> is gone and the scrollbar no longer appears.

Each result row ended with a stray `<tr>` instead of `</tr>`, and the
table was never closed with `</tbody></table>`. Browsers silently
"fixed" this malformed markup by inserting a phantom empty row, which
threw off GitHub's accessible-table wrapper and produced an empty
vertical scrollbar with nothing to scroll.

Fixes github-community-projects#1077

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 18, 2026 19:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is small, localized, and directly addresses the malformed markup causing the rendering issue.

Pull request overview

This PR fixes malformed HTML emitted in the “Safe-Settings config changes detected” PR comment diff table so GitHub’s rendering no longer shows an empty vertical scrollbar.

Changes:

  • Fixes table row markup by closing each row with </tr> instead of a stray <tr>.
  • Properly closes the diff table with </tbody></table> after rendering all rows.
File summaries
File Description
lib/settings.js Corrects generated PR-comment diff table HTML by closing <tr> rows and the overall table.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/settings.js
Copilot flagged that the scrollbar fix had no test guarding against
the malformed markup reappearing. Assert the generated comment body
never contains the stray </td><tr> pattern and always closes the
table with </tbody></table>. Verified this test fails against the
pre-fix code and passes against the fix.

Addresses review comment from github-community-projects#1078.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is narrowly scoped to HTML tag correctness, includes a focused unit test, and does not alter the surrounding comment-generation behavior beyond fixing malformed markup.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

This branch has not been deployed

No deployments
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.

PR comment diff table shows an empty vertical scrollbar due to malformed <tr> markup

2 participants