Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 6060aac

Browse files
committed
Revert "[SG-43144]: Tables in code excerpts should use headers for line numbers (#43389)"
This reverts commit 5e41e12.
1 parent 96c7fb6 commit 6060aac

File tree

22 files changed

+226
-227
lines changed

22 files changed

+226
-227
lines changed

client/branded/src/components/panel/views/__snapshots__/HierarchicalLocationsView.test.tsx.snap

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/codeintellify/src/testutils/sourcegraph/generate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export function generateSourcegraphCodeTable(lines: string[]): string {
55
const code = lines
66
.map(
77
(line, index) => `<tr>
8-
<th class="line" data-line="${index + 1}"></th>
8+
<td class="line" data-line="${index + 1}"></td>
99
<td class="code">${line}</td>
1010
</tr>`
1111
)

client/codeintellify/src/testutils/sourcegraph/styles.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
border-collapse: collapse;
5151
}
5252

53-
.sourcegraph-testcase code.code th.line {
53+
.sourcegraph-testcase code.code td.line {
5454
text-align: right;
5555
padding-left: 0.5rem;
5656
min-width: 2rem;
@@ -61,7 +61,7 @@
6161
vertical-align: top;
6262
}
6363

64-
.sourcegraph-testcase th.line::before {
64+
.sourcegraph-testcase td.line::before {
6565
content: attr(data-line);
6666
}
6767

client/search-ui/src/components/CodeExcerpt.module.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
:global(.line) {
1111
min-width: 1.5rem;
1212
text-align: right;
13-
font-weight: inherit;
1413
user-select: none;
1514

1615
&::before {

client/search-ui/src/components/CodeExcerpt.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const domFunctions: DOMFunctions = {
7676
return row.cells[1]
7777
},
7878
getCodeElementFromLineNumber: (codeView: HTMLElement, line: number): HTMLTableCellElement | null => {
79-
const lineElement = codeView.querySelector(`th[data-line="${line}"]`)
79+
const lineElement = codeView.querySelector(`td[data-line="${line}"]`)
8080
if (!lineElement) {
8181
return null
8282
}
@@ -330,7 +330,7 @@ export const CodeExcerpt: React.FunctionComponent<Props> = ({
330330
<tbody>
331331
{range(startLine, endLine).map(index => (
332332
<tr key={index}>
333-
<th className="line" data-line={index + 1} />
333+
<td className="line" data-line={index + 1} />
334334
{/* create empty space to fill viewport (as if the blob content were already fetched, otherwise we'll overfetch) */}
335335
<td className="code"> </td>
336336
</tr>

client/search-ui/src/components/CommitSearchResultMatch.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
table {
3333
margin-bottom: 0 !important; /* Override docsite Markdown table CSS. A currently open PR removes that CSS and lets us remove this override. */
3434
}
35-
th:global(.line) {
35+
td:global(.line) {
3636
display: none;
3737
}
3838
td:global(.code) > span:first-child {

client/search/src/integration/streaming-search-mocks.ts

Lines changed: 80 additions & 80 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)