Fix instruction browser review findings - #21
Conversation
- Reset to whole-model mode when a load fails so the error state never strands the instructions UI with empty selectors - Cache per-section step occurrence counts and guard the step-label length against the cumulative expansion, replacing the per-render quadratic recomputation and the crash-on-drift strict zip - Pass occurrence counts into InstructionDetails instead of re-expanding submodels twice more per render - Wrap directive Data/Raw cells in Text so bracketed content renders literally instead of being parsed as Rich markup - Sync the selected step number in the _instruction_selection fallback - Cover step-key clamping and error loads from instructions mode Co-Authored-By: Claude Fable 5 <[email protected]>
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## pyldraw-updates #21 +/- ##
===================================================
+ Coverage 87.16% 87.26% +0.10%
===================================================
Files 30 30
Lines 1441 1461 +20
===================================================
+ Hits 1256 1275 +19
- Misses 185 186 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Reuse precomputed model occurrences for statistics rendering, use named Textual query type arguments, and annotate the new instruction snapshot test. Model: GPT-5 Thread: 019fc2f8-b490-78e2-9b0b-5b3c9e9c95d8
Reset the selected whole-model key and remove options from the visible submodel selector whenever opening a model fails. Cover the complete error-state reset in the pilot test. Model: GPT-5 Thread: 019fc31e-3c39-7a52-9dc1-e7787f276f5e
Summary
Follow-up to #20 addressing all four code-review findings:
_show_errornow resets the view mode, syncs the mode select, and re-syncs tab visibility, so a failed load restores the whole-model controls instead of stranding empty section/step dropdowns.strict=Truezip.Text(...)so bracketed content (JSON arrays,[tag]-style comment text) displays literally instead of going through Rich markup parsing._instruction_selectionfallback syncs state — the defensive fallback to step 1 now updates_selected_instruction_stepto match what it returns.New tests cover the two gaps flagged in review:
[/]clamping at section bounds, and loading a broken file while in Instructions mode.Validation
uv run pytest(77 passed)uv run ruff check ./uv run ruff format --check src testsuv run ty check src testsuv run pyrefly check src tests🤖 Generated with Claude Code
Summary by cubic
Fixes the instruction browser: error loads now fully reset to whole-model mode, directive cells render literally, and step labels are stabilized with cached counts to avoid crashes and extra work. Also reuses precomputed occurrences in stats to cut recomputation.
Bug Fixes
Textso bracketed content displays literally._selected_instruction_stepin the fallback.Refactors
InstructionDetails.show_stepand reuse precomputed model occurrences in the stats panel to avoid extra expansions.query_one(expect_type=...)lookups.Written for commit a5d3e3f. Summary will update on new commits.