fix: fixed scroll disabled when log <20 lines#268
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses critical issues with log scrolling behavior within the Text User Interface (TUI). It removes outdated conditions that previously hindered scrolling for logs containing fewer than 20 lines and rectifies the initialization and boundary clamping of the log scroll position. These changes collectively ensure a consistent and fully functional scrolling experience, allowing users to navigate logs effectively regardless of their length and preventing the scroll position from becoming invalid. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Greptile SummaryThis PR fixes two related scroll bugs in the TUI log viewer: it removes obsolete
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User presses scroll key] --> B{Key type?}
B -->|Down or Ctrl+D| C[scroll_logs_down / scroll_logs_page_down]
B -->|Up or Ctrl+U| D[scroll_logs_up / scroll_logs_page_up]
B -->|g go-to-top| E[log_scroll = 1]
B -->|G go-to-bottom| F[log_scroll = log_content.len]
C --> G[log_scroll = log_scroll + step capped at log_content.len]
D --> H[log_scroll = saturating_sub step then max 1]
F --> I{log_content empty?}
I -->|Yes - edge case| J[log_scroll = 0 - violates invariant]
I -->|No - normal path| K[log_scroll = len which is at least 1]
G --> L[Render with log_skip and log_take]
H --> L
E --> L
K --> L
J --> L
Last reviewed commit: 20626d8 |
There was a problem hiding this comment.
Code Review
This pull request fixes issues with log scrolling, particularly when there are few log lines. The changes remove an obsolete check that prevented scrolling for logs with fewer than 20 lines. It also ensures that the scroll position (log_scroll) is handled more consistently by treating it as a 1-based index, preventing it from becoming 0 when scrolling up. The changes are logical and consistent across the affected files. I've added one comment regarding a minor inconsistency in scroll behavior when the logs are empty.
20626d8 to
e591181
Compare
## 🤖 New release * `pitchfork-cli`: 2.0.0 -> 2.1.0 <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [2.1.0](v2.0.0...v2.1.0) - 2026-03-08 ### Added - add `settings.toml` ([#275](#275)) ### Fixed - correct json schema for DaemonId ([#277](#277)) - *(supervisor)* prevent file descriptor leaks in SSE streaming and IPC ([#267](#267)) - fixed scroll disabled when log <20 lines ([#268](#268)) ### Other - Support .config/pitchfork.toml ([#265](#265)) - *(README)* update broken link ([#270](#270)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Release bookkeeping only (version/changelog/lockfile) with no functional code changes in this PR. > > **Overview** > Bumps `pitchfork-cli` from `2.0.0` to `2.1.0` in `Cargo.toml` and `Cargo.lock`. > > Updates `CHANGELOG.md` with the new `2.1.0` release entry (noting the new `settings.toml`, several fixes, and minor documentation/config support updates). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit c5f40ab. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This PR mainly contains two fixes: one is that there exists preexisting checks against number of log lines that prevents scrolling, which is obsolete after the
log_scrollrework. The second is thatlog_scrollcan become 0 even though it's clamped to 1, so the first scroll down from 0 to 1 does not actually scroll.