Skip to content

Commit 576f6d8

Browse files
committed
Improve the responsiveness of the area tables, by using flex instead of tables.
1 parent a018d43 commit 576f6d8

File tree

3 files changed

+38
-33
lines changed

3 files changed

+38
-33
lines changed

_extensions/area_table.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def transform_github_teams(match: re.Match):
2929

3030
def transform_github_labels(match: re.Match):
3131
old_value = match.group(1)
32-
transformed = f'<code class="docutils literal notranslate"><span class="pre">{old_value}</span></code> (<a href="https://github.com/godotengine/godot/issues?q=is%3Aissue%20state%3Aopen%20label%3A{old_value}">issues</a>, <a href="https://github.com/godotengine/godot/pulls?q=is%3Apr+is%3Aopen+label%3A{old_value}">PRs</a>)'
32+
transformed = f'<span style="white-space: nowrap;"><code class="docutils literal notranslate"><span class="pre">{old_value}</span></code> (<a href="https://github.com/godotengine/godot/issues?q=is%3Aissue%20state%3Aopen%20label%3A{old_value}">issues</a>, <a href="https://github.com/godotengine/godot/pulls?q=is%3Apr+is%3Aopen+label%3A{old_value}">PRs</a>)</span>'
3333
return transformed
3434

3535

@@ -55,43 +55,35 @@ class TableDirective(Directive):
5555

5656
def run(self):
5757
# Create a table node with the parsed header and data
58-
table = nodes.table()
58+
table = nodes.container()
5959
table.setdefault('classes', []).append("gdarea-table")
60-
tgroup = nodes.tgroup(cols=2)
61-
table += tgroup
62-
63-
# Set column specifications
64-
tgroup += nodes.colspec(colwidth=2)
65-
tgroup += nodes.colspec(colwidth=5)
6660

6761
# Create and add the table body
68-
tbody = nodes.tbody()
69-
tgroup += tbody
7062
for column_title in area_table_rows:
7163
row_text = self.options.get(column_title.lower().replace(" ", "_"), '')
7264
if not row_text:
7365
continue
7466

75-
body_row = nodes.row()
67+
row = nodes.container()
7668

77-
entry = nodes.entry()
69+
entry = nodes.container()
7870
entry.setdefault('classes', []).append("gdarea-table-header")
7971
entry += nodes.paragraph(text=column_title)
80-
body_row += entry
72+
row += entry
8173

8274
row_text = channel_re.sub(transform_channels, row_text)
8375
row_text = godot_team_re.sub(transform_github_teams, row_text)
8476
row_text = labels_re.sub(transform_github_labels, row_text)
8577
row_text = triage_re.sub(transform_github_triage, row_text)
8678
row_text = lead_re.sub(transform_lead, row_text)
8779

88-
entry = nodes.entry()
80+
entry = nodes.container()
8981
paragraph = nodes.paragraph()
9082
paragraph += nodes.raw('', row_text, format='html')
9183
entry += paragraph
92-
body_row += entry
84+
row += entry
9385

94-
tbody += body_row
86+
table += row
9587

9688
return [table]
9789

_static/css/custom.css

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,43 +1866,56 @@ p + .classref-constant {
18661866
background: var(--role-button-background-color);
18671867
}
18681868

1869-
.rst-content table.docutils.gdarea-table {
1869+
.rst-content div.docutils.gdarea-table {
18701870
background-color: var(--code-background-color);
18711871
border: 0;
18721872
border-left: 6px solid var(--code-border-color);
18731873
padding: 4px 10px;
18741874
width: 100%;
1875-
table-layout:fixed
1875+
margin-bottom: 40px;
18761876
}
18771877

1878-
.rst-content table.docutils.gdarea-table td.gdarea-table-header {
1879-
padding: 8px;
1880-
border-right:1px dashed var(--code-border-color);
1881-
text-align: left;
1882-
width:25%;
1878+
.rst-content div.docutils.gdarea-table > div {
1879+
padding: 8px 0 8px 0;
1880+
background-color: var(--code-background-color) !important;
1881+
border-bottom: 1px dashed var(--code-border-color);
1882+
border-collapse:collapse;
1883+
display: flex;
1884+
flex-wrap: wrap;
18831885
}
18841886

1885-
.rst-content table.docutils.gdarea-table td {
1886-
padding: 8px 0 8px 12px;
1887-
background-color: var(--code-background-color) !important;
1887+
.rst-content div.docutils.gdarea-table div:last-of-type {
1888+
border-bottom: 0;
18881889
}
18891890

1890-
.rst-content table.docutils.gdarea-table td.gdarea-table-header, .rst-content table.docutils.gdarea-table td {
1891-
border-bottom: 1px dashed var(--code-border-color);
1892-
border-collapse:collapse
1891+
.rst-content div.docutils.gdarea-table > div > div {
1892+
padding: 0 0 0 12px;
1893+
min-width: 20em;
1894+
flex: 20000 20000 10em;
1895+
display: flex;
1896+
align-items: center;
1897+
min-height: 2em;
18931898
}
18941899

1895-
.rst-content table.docutils.gdarea-table tr:last-of-type td, .rst-content table.docutils.gdarea-table tr:last-of-type td.gdarea-table-header {
1896-
border-bottom:0
1900+
.rst-content div.docutils.gdarea-table > div > div.gdarea-table-header {
1901+
flex: 1 1 10em;
1902+
min-width: 10em;
1903+
border-right:1px dashed var(--code-border-color);
1904+
text-align: left;
18971905
}
18981906

1899-
.rst-content table.docutils.gdarea-table td.gdarea-table-header > p {
1907+
.rst-content div.docutils.gdarea-table > div > div > p {
1908+
margin-bottom: 0;
1909+
}
1910+
1911+
.rst-content div.docutils.gdarea-table > div > div.gdarea-table-header > p {
19001912
font-size: 1rem !important;
19011913
font-weight: bold;
19021914
}
19031915

19041916
span.team-lead:before {
19051917
content: "⭐️ ";
1918+
white-space: nowrap;
19061919
}
19071920

19081921
span.team-lead {

organization/areas.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ Apple
232232
.. gdareatable::
233233
:communication: #apple
234234
:github_reviews: @godotengine/ios, @godotengine/macos
235-
:github_labels: <gh-label>platform:ios</gh-label>, <gh-label>platform:macos</gh-label>, <gh-label>platform:visionos</gh-label>,
235+
:github_labels: <gh-label>platform:ios</gh-label>, <gh-label>platform:macos</gh-label>, <gh-label>platform:visionos</gh-label>
236236
:maintainers: Bastiaan Olij (@BastiaanOlij), <lead>Pāvels Nadtočajevs (@bruvzg)</lead>
237237
:triage_project: <gh-triage project=84>Platforms issue triage</gh-triage>
238238

0 commit comments

Comments
 (0)