fix(notebook): wrap colab sliders before track collapse - #409
fix(notebook): wrap colab sliders before track collapse#409FlorinSenoner wants to merge 6 commits into
Conversation
Automated reviewDoes it solve #346? Yes — raising the DR parameter card flex basis from Found 2 issues:
protspace/apps/protspace/tests/test_notebook_layout.py Lines 39 to 43 in a6ed921
protspace/apps/protspace/notebooks/ProtSpace_Preparation.ipynb Lines 448 to 450 in a6ed921 🤖 Generated with Claude Code |
|
Triaged both points against current head
No follow-up implementation is needed for these two points. |
- Drop the redundant isinstance list branch when joining notebook cell source - Assert param_grid wraps and each parameter card keeps overflow hidden, so a nowrap row can no longer reintroduce the slider-track collapse undetected - Drop 'plus configured gaps' from the spec scenarios; ipywidgets Layout has no gap trait, so the notebook's gap value never reaches the DOM Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qoU16kDQxz6U3H2UWbbm2
The previous assertion used `"wrap" in flex_flow`, which also passes for "row nowrap" -- the exact regression it was written to catch. Verified by mutation: swapping the notebook's flex_flow to "row nowrap" left the test green. Split on whitespace and match the flex-wrap token, and echo the observed value in the failure message. The same mutation now fails the test, and the unmutated notebook still passes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qoU16kDQxz6U3H2UWbbm2
Adversarial reviewReviewed in an isolated worktree by three independent lenses (code quality, adversarial correctness, issue-resolution audit), with every finding then put through a refuter whose default position was that it is a false positive. 7 raised, 5 survived refutation. Applied and pushed (
|
|
Follow-up to #409 (comment), assessed against final head
Verification on this exact head:
|
Summary
Root cause
Each generated parameter group used
flex: 1 1 220px, while the real ipywidgets slider chrome requires about 228 px before its track has any usable width. With three groups enabled, the flex row kept all cards on one line at narrow notebook widths, and the tracks collapsed inside overflow-hidden cards.Fix
Raise the group flex basis to
300px. This makes groups wrap to the next row before their slider tracks collapse, without changing slider values or behavior.Reproduction and verification
On current main, executing the real Generate ProtSpace notebook cell with UMAP and t-SNE enabled produced:
After the fix at 800×720:
n_neighborstrack updated the real widget value from 25 to 249Tests
pytest apps/protspace/tests/test_notebook_layout.pyruff check apps/protspace/tests/test_notebook_layout.pyruff format --check apps/protspace/tests/test_notebook_layout.pyjq empty apps/protspace/notebooks/ProtSpace_Preparation.ipynbopenspec validate fix-colab-slider-responsive --strictpnpm precommitCloses #346