Skip to content

feat(web): display logs newest-first in web gateway UI#369

Merged
henrypark133 merged 1 commit intomainfrom
feat/reverse-logs-latest-first
Feb 26, 2026
Merged

feat(web): display logs newest-first in web gateway UI#369
henrypark133 merged 1 commit intomainfrom
feat/reverse-logs-latest-first

Conversation

@henrypark133
Copy link
Copy Markdown
Collaborator

Summary

  • Reverse log display order in the web gateway so newest entries appear at the top, removing the need to scroll for latest activity
  • Frontend: rename appendLogEntryprependLogEntry, use prepend() for DOM insertion, cap oldest entries from the bottom, auto-scroll to top
  • Backend: update recent_entries() doc comment to clarify the oldest-first return order (which works correctly with the frontend's prepend)

Test plan

  • cargo clippy --all --all-features — zero warnings
  • cargo test log_layer — all 12 tests pass
  • Manual: open web UI logs tab, verify new entries appear at top
  • Manual: reload page, verify history replays newest-at-top
  • Manual: pause/resume, verify buffered entries flush in correct order
  • Manual: level/target filters still work

🤖 Generated with Claude Code

Reverse log display order so the most recent entries appear at the top,
removing the need to scroll to see latest activity.

Frontend: rename appendLogEntry to prependLogEntry, use prepend() for
DOM insertion, cap oldest entries from the bottom, and auto-scroll to
top. Backend: update recent_entries() doc comment to clarify the
oldest-first return order works correctly with the frontend's prepend.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added scope: channel/web Web gateway channel scope: dependencies Dependency updates size: S 10-49 changed lines risk: medium Business logic, config, or moderate-risk modules contributor: experienced 6-19 merged PRs labels Feb 25, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @henrypark133, 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 significantly enhances the user experience of the web gateway's log viewer by reorienting the log display to show the most recent entries at the top. This change improves usability by making the latest information immediately accessible without manual scrolling, streamlining the process of monitoring real-time activity.

Highlights

  • Web Gateway UI Log Display Order: The log display order in the web gateway UI has been reversed, so that the newest log entries now appear at the top, eliminating the need for users to scroll down to see the latest activity.
  • Frontend Log Handling Refactor: The frontend JavaScript function appendLogEntry was renamed to prependLogEntry. It now uses prepend() for DOM insertion, caps the oldest entries from the bottom of the list, and automatically scrolls to the top to show new entries.
  • Backend Documentation Clarification: The backend recent_entries() function's documentation comment was updated to explicitly state that it returns entries in oldest-first order, which is now correctly handled by the frontend's prepending logic.
Changelog
  • Cargo.lock
    • Added sha1_smol package with version 1.0.1 and its checksum.
    • Included sha1_smol in the dependencies for a package.
  • src/channels/web/log_layer.rs
    • Updated the doc comment for the recent_entries function to clarify that it returns entries oldest-first, which naturally supports the frontend's prepending mechanism.
  • src/channels/web/static/app.js
    • Renamed the appendLogEntry function to prependLogEntry and updated its call site in connectLogSSE.
    • Changed the DOM insertion method from appendChild to prepend within the prependLogEntry function.
    • Modified the log capping logic to remove the lastChild (oldest entry) when exceeding LOG_MAX_ENTRIES.
    • Adjusted the auto-scroll behavior to set output.scrollTop to 0 (top) when new entries are added.
    • Updated the log buffer flush logic in toggleLogsPause to call prependLogEntry.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly implements the feature to display logs in the web UI with the newest entries appearing at the top. The frontend changes in app.js are consistent and well-executed, including renaming appendLogEntry to prependLogEntry, using prepend() for DOM insertion, and updating the logic for capping entries and auto-scrolling. The backend documentation update in log_layer.rs also provides useful clarification. Overall, the changes are sound and achieve the intended user experience improvement.

@henrypark133 henrypark133 merged commit 0c5f082 into main Feb 26, 2026
4 checks passed
@henrypark133 henrypark133 deleted the feat/reverse-logs-latest-first branch February 26, 2026 00:00
bkutasi pushed a commit to bkutasi/ironclaw that referenced this pull request Mar 28, 2026
Reverse log display order so the most recent entries appear at the top,
removing the need to scroll to see latest activity.

Frontend: rename appendLogEntry to prependLogEntry, use prepend() for
DOM insertion, cap oldest entries from the bottom, and auto-scroll to
top. Backend: update recent_entries() doc comment to clarify the
oldest-first return order works correctly with the frontend's prepend.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: experienced 6-19 merged PRs risk: medium Business logic, config, or moderate-risk modules scope: channel/web Web gateway channel scope: dependencies Dependency updates size: S 10-49 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants