Skip to content

Commit d2061aa

Browse files
Kasper JungeRalphify
authored andcommitted
workspace: record _fullscreen_page_size() lambda-inline refactor
Co-authored-by: Ralphify <noreply@ralphify.co>
1 parent 59b0e34 commit d2061aa

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

workspace/ralphs/improve-codebase/coverage/_console_emitter.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
# `_console_emitter.py` coverage
22

3-
Valid at: 52e0272
3+
Valid at: 59b0e34
44

55
## Recent changes
66

7+
- 59b0e34 — inlined `self._fullscreen_page_size()` into the space/b
8+
action lambdas in `_handle_fullscreen_key`. The `page` local was
9+
computed unconditionally in the non-exit branch but only consumed by
10+
the page-down (" ") and page-up ("b") lambdas — j/k/g/G/[/] now skip
11+
the call entirely. Space/b still compute it exactly once per keypress,
12+
now at action-invocation time (under the same `_console_lock`), so
13+
behavior is unchanged. `_fullscreen_page_size()` is a pure read of
14+
`self._console.size.height` in a try/except, so deferring evaluation
15+
has no observable effect — the dict build and action invocation happen
16+
back-to-back inside the lock. Same Phase 4 shape as 134078d / ef176bf
17+
/ b19625e.
718
- 52e0272 — inlined the `msg = raw.get("message", {})` local in
819
`_IterationPanel._apply_assistant`. The alias was read exactly once on
920
the next line as `msg.get("usage")`. Collapsing to

workspace/ralphs/improve-codebase/iterations.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
One line per iteration: `<sha> <summary>`.
44

5+
59b0e34 refactor: inline `_fullscreen_page_size()` into the space/b lambdas in `_handle_fullscreen_key` — the `page` local was computed unconditionally in the non-exit branch but only consumed by the page-down (" ") and page-up ("b") action lambdas. j/k/g/G/[/] now skip the call entirely; space/b still compute it exactly once per keypress, now at action-invocation time under the same lock. Same Phase 4 "narrow the scope of a one-branch local" shape as 134078d / ef176bf / b19625e.
6+
57
52e0272 refactor: inline `msg` alias in `_apply_assistant` — the `msg = raw.get("message", {})` local was read exactly once on the next line as `msg.get("usage")`. Collapsing into `raw.get("message", {}).get("usage")` matches the chained-get style already used by `_iter_content_blocks` (which independently does `raw.get("message", {}).get("content", [])`) and the inline-alias pattern from 497c028 / fc5e1cb.
68

79
b19625e refactor: drop `new_offset` alias in `_FullscreenPeek.scroll_down` — the local was assigned to `self._offset` and then re-read only as `new_offset == 0`, which is identical to `self._offset == 0` after the assignment. Sibling `scroll_up` needs its local because it compares old vs new before the assignment; `scroll_down` has no such comparison, so the alias was dead. Same shape as ef176bf and 134078d.

0 commit comments

Comments
 (0)