Repository navigation
Keep pager state local to the client loop - #139
Conversation
Changes: - Replace the less_server process with local pagination state and pure page transitions in less_client. - Preserve keyboard navigation, page boundaries, headers, footers, clearing, and exit behavior. - Remove the process protocol tests and add frame-by-frame pagination, navigation, text boundary, and local-state coverage. Validation: - rebar3 as test eunit --module=less_client_test: 44 tests passed. - rebar3 eunit: 797 tests passed. - rebar3 compile and rebar3 as ci compile: passed. - git diff --check and git diff --cached --check: passed. - Real-terminal and -noshell raw-input validation were not run; this change leaves the input path unchanged and uses simulated I/O regression tests.
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project check has failed because the head coverage (97.91%) is below the target coverage (98.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #139 +/- ##
==========================================
- Coverage 97.94% 97.91% -0.03%
==========================================
Files 25 24 -1
Lines 7975 7928 -47
==========================================
- Hits 7811 7763 -48
- Misses 164 165 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The local-state implementation preserves existing pager semantics and is comprehensively covered by focused regression tests.
Review effort: Balanced
Findings: None
What changed in this PR
Moves pager state from a dedicated gen_server into the client loop while preserving behavior.
Changes:
- Introduces local pagination state and navigation.
- Removes
less_serverand its protocol tests. - Adds comprehensive frame-level regression coverage.
| File | Description |
|---|---|
src/less_client.erl |
Implements local pager state. |
src/less_server.erl |
Removes obsolete pager server. |
test/less_client_test.erl |
Adds pagination regression tests. |
test/less_server_test.erl |
Removes obsolete server tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
less_servergen_server and carry pagination state through theless_clientloop instead.Compatibility
The CLI behavior and
less_client:init/1input forms remain unchanged. Initialization now returns local state rather than a PID-backed value; the internalless_serverexports are removed without a compatibility wrapper.Validation
rebar3 as test eunit --module=less_client_test: 44 tests passed.rebar3 eunit: 797 tests passed.rebar3 compile: passed.rebar3 as ci compile: passed locally (not a claim of hosted CI completion).git diff --checkandgit diff --cached --check: passed.less_serverreferences in production source or tests.Real-terminal and
-noshellraw-input validation were not run. The input path is unchanged; regression coverage uses the existing simulated I/O harness.