This repository was archived by the owner on May 7, 2026. It is now read-only.
Commit d1ecc61
feat: Implement single-column sorting for interactive table widget (#2255)
This PR introduces single-column sorting functionality to the
interactive table widget.
1) **Three-State Sorting UI**
1.1) The sort indicator dot (●) is now hidden by default and only
appears when the user hovers the mouse over a column header
1.2) Implemented a sorting cycle: unsorted (●) → ascending (▲) →
descending (▼) → unsorted (●).
1.3) Visual indicators (●, ▲, ▼) are displayed in column headers to
reflect the current sort state.
1.4) Sorting controls are now only enabled for columns with orderable
data types.
2) **Tests**
2.1) Updated `paginated_pandas_df` fixture for better sorting test
coverage
2.2) Added new system tests to verify ascending, descending, and
multi-column sorting.
**3. Frontend Unit Tests**
JavaScript-level unit tests have been added to validate the widget's
frontend logic, specifically the new sorting functionality and UI
interactions.
**How to Run Frontend Unit Tests**:
To execute these tests from the project root directory:
```bash
cd tests/js
npm install # Only needed if dependencies haven't been installed or have changed
npm test
```
Docs has been updated to document the new features. The main description
now mentions column sorting and adjustable widths, and a new section has
been added to explain how to use the column resizing feature. The
sorting section was also updated to mention that the indicators are only
visible on hover.
Fixes #<459835971> 🦕
---------
Co-authored-by: Tim Sweña (Swast) <swast@google.com>1 parent 32e5313 commit d1ecc61Copy full SHA for d1ecc61
14 files changed
+7,329-84Lines changed: 7329 additions & 84 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- .github/workflows
- bigframes/display
- notebooks/dataframes
- tests
- js
- system/small
Expand file treeCollapse file tree
Open diff view settings
Collapse file
.github/workflows/js-tests.yml
Copy file name to clipboard+20Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
Collapse file
+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
58 | 58 | |
59 | 59 | |
60 | 60 | |
| 61 | + |
61 | 62 | |
62 | 63 | |
63 | 64 | |
|
Collapse file
bigframes/display/anywidget.py
Copy file name to clipboardExpand all lines: bigframes/display/anywidget.py+59-5Lines changed: 59 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
16 | 16 | |
17 | 17 | |
18 | 18 | |
| 19 | + |
19 | 20 | |
20 | 21 | |
21 | 22 | |
| ||
28 | 29 | |
29 | 30 | |
30 | 31 | |
| 32 | + |
31 | 33 | |
32 | 34 | |
33 | 35 | |
| ||
48 | 50 | |
49 | 51 | |
50 | 52 | |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
51 | 59 | |
52 | 60 | |
53 | 61 | |
| ||
63 | 71 | |
64 | 72 | |
65 | 73 | |
| 74 | + |
| 75 | + |
| 76 | + |
66 | 77 | |
67 | 78 | |
68 | 79 | |
| ||
89 | 100 | |
90 | 101 | |
91 | 102 | |
| 103 | + |
92 | 104 | |
93 | 105 | |
94 | 106 | |
95 | 107 | |
96 | 108 | |
| 109 | + |
97 | 110 | |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | + |
98 | 120 | |
99 | | - |
100 | | - |
| 121 | + |
101 | 122 | |
102 | 123 | |
103 | 124 | |
| ||
121 | 142 | |
122 | 143 | |
123 | 144 | |
| 145 | + |
| 146 | + |
| 147 | + |
| 148 | + |
| 149 | + |
124 | 150 | |
125 | 151 | |
126 | 152 | |
| ||
221 | 247 | |
222 | 248 | |
223 | 249 | |
| 250 | + |
| 251 | + |
| 252 | + |
| 253 | + |
| 254 | + |
| 255 | + |
224 | 256 | |
225 | 257 | |
226 | 258 | |
227 | 259 | |
228 | | - |
229 | | - |
230 | | - |
| 260 | + |
231 | 261 | |
232 | 262 | |
233 | 263 | |
| ||
237 | 267 | |
238 | 268 | |
239 | 269 | |
| 270 | + |
| 271 | + |
| 272 | + |
| 273 | + |
| 274 | + |
| 275 | + |
| 276 | + |
| 277 | + |
| 278 | + |
| 279 | + |
| 280 | + |
| 281 | + |
| 282 | + |
| 283 | + |
| 284 | + |
240 | 285 | |
241 | 286 | |
242 | 287 | |
| ||
272 | 317 | |
273 | 318 | |
274 | 319 | |
| 320 | + |
275 | 321 | |
276 | 322 | |
| 323 | + |
| 324 | + |
| 325 | + |
| 326 | + |
| 327 | + |
277 | 328 | |
278 | 329 | |
279 | 330 | |
| ||
288 | 339 | |
289 | 340 | |
290 | 341 | |
| 342 | + |
| 343 | + |
| 344 | + |
291 | 345 | |
292 | 346 | |
293 | 347 | |
|
Collapse file
+16-2Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
17 | 17 | |
18 | 18 | |
19 | 19 | |
| 20 | + |
20 | 21 | |
21 | 22 | |
22 | 23 | |
23 | 24 | |
24 | 25 | |
25 | 26 | |
26 | 27 | |
27 | | - |
| 28 | + |
28 | 29 | |
29 | 30 | |
30 | 31 | |
| ||
33 | 34 | |
34 | 35 | |
35 | 36 | |
| 37 | + |
36 | 38 | |
37 | 39 | |
38 | 40 | |
39 | 41 | |
40 | 42 | |
| 43 | + |
41 | 44 | |
42 | 45 | |
43 | 46 | |
44 | 47 | |
45 | 48 | |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
46 | 60 | |
47 | | - |
| 61 | + |
48 | 62 | |
49 | 63 | |
50 | 64 | |
|
Collapse file
bigframes/display/table_widget.css
Copy file name to clipboardExpand all lines: bigframes/display/table_widget.css+36-2Lines changed: 36 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
28 | 28 | |
29 | 29 | |
30 | 30 | |
31 | | - |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
32 | 35 | |
33 | 36 | |
34 | 37 | |
| ||
44 | 47 | |
45 | 48 | |
46 | 49 | |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
47 | 58 | |
48 | 59 | |
49 | 60 | |
| ||
52 | 63 | |
53 | 64 | |
54 | 65 | |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
55 | 70 | |
56 | 71 | |
57 | 72 | |
58 | 73 | |
59 | 74 | |
60 | 75 | |
61 | 76 | |
62 | | - |
63 | 77 | |
64 | 78 | |
65 | 79 | |
66 | 80 | |
67 | 81 | |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
68 | 91 | |
69 | 92 | |
70 | 93 | |
| ||
78 | 101 | |
79 | 102 | |
80 | 103 | |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
0 commit comments