Skip to content

chore(ariba): retire AribaPicker and _select_all_attachments (#195) - #197

Merged
alexwolson merged 1 commit into
mainfrom
fix-195-retire-ariba-picker
Jul 28, 2026
Merged

chore(ariba): retire AribaPicker and _select_all_attachments (#195)#197
alexwolson merged 1 commit into
mainfrom
fix-195-retire-ariba-picker

Conversation

@alexwolson

Copy link
Copy Markdown
Collaborator

Closes #195.

Background

#185 removed AribaFileSource._read_expected_count — the last live caller of both AribaPicker
(the picker widget's Playwright adapter) and the module-level _select_all_attachments helper —
when the picker-count comparison it fed was proven to compare incommensurable quantities (54
picker vs. 39 traversal vs. 178 true leaves on one validated event). Neither was deleted at the
time, on the reasoning that removing working, hard-won code as a side effect of fixing a phantom
check wasn't that PR's call to make.

#186 then retired ariba_batch.py — the module AribaPicker was originally built to satisfy the
Picker protocol of — and deliberately left this pair alone too, per explicit instruction to track
their retirement as its own issue rather than fold it in.

What this does

Confirmed via grep before removing anything: no call sites for AribaPicker or
_select_all_attachments outside their own definitions and tests/test_ariba_select_all.py.

Removed as one cohesive cluster — everything orphaned by the same #185 cut:

  • AribaPicker (the class itself, ~530 lines)
  • _select_all_attachments, parse_total_mb, parse_selected_items, _selected_total_mb,
    _on_picker, _outline_sort_key — module-level helpers whose only callers were inside
    AribaPicker or the picker-count round trip
  • _TOTAL_MB, _SELECTED_ITEMS, _ROW_KEY, MAX_BUNDLE_MB — regexes and a constant that only
    fed the functions above (the last one a leftover from the retired single-zip bundle ceiling
    check, referenced nowhere in source, only in the test file below)
  • tests/test_ariba_select_all.py (148 lines, 11 tests)

Kept, because active code genuinely depends on them — traced every reference before touching
anything, not assumed:

  • PICKER_HEADING_on_event_view (still active, guards every traversal/download) checks for
    its absence to help confirm the content tree, not the picker, is in front of it
  • _ListScroller and its four JS constants (_FIND_CONTAINER_BODY_JS, _CONTAINER_STATE_JS,
    _GEOMETRY_JS, _PROGRAMMATIC_SCROLL_JS) — genuinely shared scroll infrastructure, parametrised
    for both the picker and the content tree from day one. AribaFileSource is now its only user,
    but it was never picker-specific.

A gap this pass caught along the way

AribaFileSource's own class docstring still listed "Four things this class exists to get
right," with the fourth being "the count is read BEFORE the traversal, and the event view is
restored after" — the exact round trip #185 removed, never updated there. Fixed to three, and
updated the ~10 other historical comments across the file that referenced AribaPicker's specific
lessons (re-render invalidation, idempotent expansion, row ordering, the six-live-run scroll
debugging) to past tense with a #195 pointer, rather than leaving them read as though the class
they credit still exists.

Verification

  • Every removal traced by grep before deleting — in particular, distinguished module-level
    helpers/constants used only by the orphaned cluster from ones shared with the still-active
    AribaFileSource/_ListScroller, since several sit interleaved in the same file.
  • Module imports cleanly; confirmed via grep that no reference to AribaPicker,
    _select_all_attachments, or the other removed names remains anywhere in toronto_bids/ or
    tests/.
  • 770 tests passing (781 − 11 deleted with test_ariba_select_all.py).

🤖 Generated with Claude Code

https://claude.ai/code/session_01W53WHx8mm2UHuLFAQWeF62

Both were left in place when #185 removed their last caller
(`AribaFileSource._read_expected_count`, part of the picker-count round
trip proven to compare incommensurable quantities) — deleting working,
hard-won code as a side effect of removing a phantom check wasn't that
issue's call to make. #186 later retired `ariba_batch.py`, the module
`AribaPicker` was originally built for, and deliberately left this pair
alone too, per explicit instruction to track it as its own issue.

Confirmed via grep before removing: no call sites for either outside their
own definitions and `tests/test_ariba_select_all.py`.

Removed as one cohesive cluster, all of it orphaned by the same #185 cut:
- `AribaPicker` (the class itself)
- `_select_all_attachments`, `parse_total_mb`, `parse_selected_items`,
  `_selected_total_mb`, `_on_picker`, `_outline_sort_key` — module-level
  helpers whose only callers were inside `AribaPicker` or the round trip
- `_TOTAL_MB`, `_SELECTED_ITEMS`, `_ROW_KEY`, `MAX_BUNDLE_MB` — regexes and
  a constant that only fed the functions above
- `tests/test_ariba_select_all.py` (148 lines, 11 tests)

Kept, because active code still depends on them: `PICKER_HEADING`
(`_on_event_view` checks for its absence to confirm the content tree, not
the picker, is in front of it) and `_ListScroller` plus its four JS
constants (shared scroll infrastructure — `AribaFileSource` is now its
only user, but it was never picker-specific).

Updated the ~10 remaining historical comments in `AribaFileSource` that
referenced `AribaPicker`'s lessons (re-render invalidation, idempotent
expansion, row ordering) to past tense with a #195 pointer, rather than
leaving them read as though the class they credit still exists. One,
`list_files`'s docstring, still described the four-things-this-class-
exists-to-get-right count as four; fixed to three, since the fourth
(reading the picker's count before the traversal) was already retired in
#185 and never updated there.

770 tests passing (781 - 11 deleted with test_ariba_select_all.py).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W53WHx8mm2UHuLFAQWeF62
@alexwolson
alexwolson merged commit 4a339d3 into main Jul 28, 2026
1 check passed
@alexwolson
alexwolson deleted the fix-195-retire-ariba-picker branch July 28, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ariba: retire AribaPicker and _select_all_attachments, unused since #185

1 participant