kangkangchen commited on
Commit
8127f6c
·
verified ·
1 Parent(s): 5b70363

Fix review app table headers

Browse files
code/sponsor_flow_600809/.pytest_cache/.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ # Created by pytest automatically.
2
+ *
code/sponsor_flow_600809/.pytest_cache/CACHEDIR.TAG ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ Signature: 8a477f597d28d172789f06886806bc55
2
+ # This file is a cache directory tag created by pytest.
3
+ # For information about cache directory tags, see:
4
+ # https://bford.info/cachedir/spec.html
code/sponsor_flow_600809/.pytest_cache/README.md ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ # pytest cache directory #
2
+
3
+ This directory contains data from the pytest's cache plugin,
4
+ which provides the `--lf` and `--ff` options, as well as the `cache` fixture.
5
+
6
+ **Do not** commit this to version control.
7
+
8
+ See [the docs](https://docs.pytest.org/en/stable/how-to/cache.html) for more information.
code/sponsor_flow_600809/.pytest_cache/v/cache/lastfailed ADDED
@@ -0,0 +1 @@
 
 
1
+ {}
code/sponsor_flow_600809/.pytest_cache/v/cache/nodeids ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ [
2
+ "tests/test_review_app.py::test_build_review_app_writes_clickable_daily_payloads",
3
+ "tests/test_review_app.py::test_review_app_table_headers_stay_at_top_of_scroll_container"
4
+ ]
code/sponsor_flow_600809/src/sponsor_flow/visualization/review_app.py CHANGED
@@ -690,7 +690,7 @@ def _html_template() -> str:
690
  vertical-align: top;
691
  white-space: nowrap;
692
  }
693
- th { color: var(--muted); font-weight: 650; background: #fbfcfe; position: sticky; top: 74px; }
694
  tr.clickable { cursor: pointer; }
695
  tr.clickable:hover { background: var(--accent-soft); }
696
  .table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; max-height: 520px; }
 
690
  vertical-align: top;
691
  white-space: nowrap;
692
  }
693
+ th { color: var(--muted); font-weight: 650; background: #fbfcfe; position: sticky; top: 0; z-index: 1; }
694
  tr.clickable { cursor: pointer; }
695
  tr.clickable:hover { background: var(--accent-soft); }
696
  .table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; max-height: 520px; }
code/sponsor_flow_600809/tests/test_review_app.py CHANGED
@@ -1,11 +1,12 @@
1
  from __future__ import annotations
2
 
3
  import json
 
4
  from pathlib import Path
5
 
6
  import pandas as pd
7
 
8
- from sponsor_flow.visualization.review_app import build_review_app
9
 
10
 
11
  def _write_sample_outputs(base: Path) -> None:
@@ -165,3 +166,14 @@ def test_build_review_app_writes_clickable_daily_payloads(tmp_path: Path) -> Non
165
  assert day["morning_flow"]["all_day_flow_prob"] == 0.8
166
  assert day["regime"]["change_point_flag"] is True
167
  assert "future_ret_5m" not in day["minute_columns"]
 
 
 
 
 
 
 
 
 
 
 
 
1
  from __future__ import annotations
2
 
3
  import json
4
+ import re
5
  from pathlib import Path
6
 
7
  import pandas as pd
8
 
9
+ from sponsor_flow.visualization.review_app import _html_template, build_review_app
10
 
11
 
12
  def _write_sample_outputs(base: Path) -> None:
 
166
  assert day["morning_flow"]["all_day_flow_prob"] == 0.8
167
  assert day["regime"]["change_point_flag"] is True
168
  assert "future_ret_5m" not in day["minute_columns"]
169
+
170
+
171
+ def test_review_app_table_headers_stay_at_top_of_scroll_container() -> None:
172
+ html = _html_template()
173
+ th_rule = re.search(r"th\s*\{([^}]+)\}", html)
174
+
175
+ assert th_rule is not None
176
+ assert "position: sticky" in th_rule.group(1)
177
+ assert "top: 0;" in th_rule.group(1)
178
+ assert "top: 74px;" not in th_rule.group(1)
179
+ assert "</thead><tbody>` +" in html