htranx commited on
Commit
109741d
·
verified ·
1 Parent(s): accbc1a

drop every count from the invited tab

Browse files

No seat total, no team total, no per-card "N invited". The card heads are now just Small and Large.

The tables are the count. A printed figure beside them is a second copy that can only disagree with them, and this one had already disagreed three ways: counting team names gives 31, counting accounts gives 33, and the real answer is 30, because the identity merge is transitive over both. Removing the figures also removes the only reason this page had to read `distinct_teams` out of the shortlist file.

21 tests, two of them re-pointed from asserting the counts to asserting their absence, plus one confirming the page still renders when the count fields are missing from the shortlist entirely. Two negative controls, each biting: the seats/teams lead-in restored, and the per-card count restored. Green under both interpreters here.

Files changed (2) hide show
  1. invited.py +8 -12
  2. tests/test_invited.py +27 -5
invited.py CHANGED
@@ -47,7 +47,6 @@ body{font-family:var(--lb-sans);color:var(--lb-text);background:transparent;
47
  border-radius:12px;overflow:hidden}
48
  .lb-board-head{padding:.6rem .9rem;border-bottom:1px solid var(--lb-border);
49
  font-weight:600;font-size:.9rem;background:var(--lb-head)}
50
- .lb-board-head .n{color:var(--lb-sec);font-weight:400}
51
  .lb-scroll{overflow:auto;max-width:100%;overscroll-behavior:contain}
52
  table{width:100%;border-collapse:collapse;table-layout:auto;font-size:.83rem;
53
  border:0;margin:0;background:var(--lb-surface)}
@@ -148,8 +147,7 @@ def _head() -> str:
148
  def _board(st: dict, division: str, esc) -> str:
149
  """One division's card: a heading, then that sub-track's ranked table."""
150
  rows = _rows(st)
151
- head = (f'<div class="lb-board-head">{esc(division.capitalize())} '
152
- f'<span class="n">&mdash; {len(rows)} invited</span></div>')
153
  if not rows:
154
  return (f'<div class="lb-board">{head}'
155
  f'<div class="lb-empty">No teams invited</div></div>')
@@ -201,15 +199,13 @@ def document(token: str | None) -> str:
201
  return "".join(out)
202
 
203
  by_sub = {(st["track"], st["division"]): st for st in rep["subtracks"]}
204
- total = sum(len(_rows(st)) for st in rep["subtracks"])
205
- # Read the count, never recount. The identity merge is transitive over
206
- # names AND accounts, so neither reproduces it: on this data team names give
207
- # 31 and accounts give 33 against a real 30, and a public page disagreeing
208
- # with the decision record is its own problem.
209
- n_teams = rep.get("distinct_teams")
210
-
211
- across = f" across <b>{n_teams} teams</b>" if n_teams else ""
212
- out.append(f"<p class='lb-note'><b>{total} seats</b>{across}. "
213
  "A team is invited per sub-track, so a team may appear in several. "
214
  "If your team is listed, register it in <b>Submit &rarr; Test &rarr; "
215
  "Step 1</b> to collect your registry credentials.</p>")
 
47
  border-radius:12px;overflow:hidden}
48
  .lb-board-head{padding:.6rem .9rem;border-bottom:1px solid var(--lb-border);
49
  font-weight:600;font-size:.9rem;background:var(--lb-head)}
 
50
  .lb-scroll{overflow:auto;max-width:100%;overscroll-behavior:contain}
51
  table{width:100%;border-collapse:collapse;table-layout:auto;font-size:.83rem;
52
  border:0;margin:0;background:var(--lb-surface)}
 
147
  def _board(st: dict, division: str, esc) -> str:
148
  """One division's card: a heading, then that sub-track's ranked table."""
149
  rows = _rows(st)
150
+ head = f'<div class="lb-board-head">{esc(division.capitalize())}</div>'
 
151
  if not rows:
152
  return (f'<div class="lb-board">{head}'
153
  f'<div class="lb-empty">No teams invited</div></div>')
 
199
  return "".join(out)
200
 
201
  by_sub = {(st["track"], st["division"]): st for st in rep["subtracks"]}
202
+
203
+ # No counts anywhere on this tab (Harry, 2026-08-08): not a seat total, not
204
+ # a team total, not a per-card "N invited". The tables ARE the count, and a
205
+ # printed figure beside them is a second copy that can only disagree with
206
+ # them. It also removes the reason this page had to read `distinct_teams`
207
+ # out of the shortlist file at all.
208
+ out.append("<p class='lb-note'>"
 
 
209
  "A team is invited per sub-track, so a team may appear in several. "
210
  "If your team is listed, register it in <b>Submit &rarr; Test &rarr; "
211
  "Step 1</b> to collect your registry credentials.</p>")
tests/test_invited.py CHANGED
@@ -185,12 +185,34 @@ class ContentTest(unittest.TestCase):
185
  def test_organizer_rows_are_filtered_by_their_note_field(self):
186
  d = _doc(_report(n_subtracks=1, rows_per=2, note_rows=1))
187
  self.assertNotIn("htranx", d)
188
- self.assertIn("<b>2 seats</b>", d)
 
189
 
190
- def test_the_team_count_is_read_from_the_file_not_recounted(self):
191
- """Neither team names nor accounts reproduce the transitive merge."""
192
- d = _doc(_report(n_subtracks=1, rows_per=2))
193
- self.assertIn("5 teams", d)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
 
195
  def test_rows_are_ordered_by_rank(self):
196
  rep = _report(n_subtracks=1, rows_per=3)
 
185
  def test_organizer_rows_are_filtered_by_their_note_field(self):
186
  d = _doc(_report(n_subtracks=1, rows_per=2, note_rows=1))
187
  self.assertNotIn("htranx", d)
188
+ self.assertIn("Team 00", d)
189
+ self.assertIn("Team 01", d)
190
 
191
+ def test_no_counts_are_printed_anywhere(self):
192
+ """Harry, 2026-08-08: no seat total, no team total, no per-card count.
193
+
194
+ The tables are the count. A printed figure beside them is a second copy
195
+ that can only disagree with them, and it used to disagree three ways at
196
+ once, because neither team names nor accounts reproduce the transitive
197
+ identity merge.
198
+ """
199
+ text = re.sub(r"<[^>]+>", " ", _doc(_full_report()))
200
+ for pattern in (r"\d+\s*seats", r"\d+\s*teams", r"\d+\s*invited",
201
+ r"across\s+\d+"):
202
+ self.assertEqual([], re.findall(pattern, text, re.I), pattern)
203
+
204
+ def test_the_card_head_is_just_the_division(self):
205
+ d = _doc(_full_report())
206
+ heads = set(re.findall(r'lb-board-head">([^<]*)<', d))
207
+ self.assertEqual({"Small", "Large"}, heads)
208
+
209
+ def test_it_no_longer_needs_the_count_from_the_shortlist_file(self):
210
+ """Dropping the counts removed the only reason to read that field."""
211
+ rep = _full_report()
212
+ rep.pop("distinct_teams")
213
+ rep.pop("total_seats")
214
+ d = _doc(rep)
215
+ self.assertIn("lb-board", d)
216
 
217
  def test_rows_are_ordered_by_rank(self):
218
  rep = _report(n_subtracks=1, rows_per=3)