Skip to content

feat: add compact startup diagnostics panel#97

Closed
zouyonghe wants to merge 3 commits intoAstrBotDevs:mainfrom
zouyonghe:feat/startup-log-panel-upstream
Closed

feat: add compact startup diagnostics panel#97
zouyonghe wants to merge 3 commits intoAstrBotDevs:mainfrom
zouyonghe:feat/startup-log-panel-upstream

Conversation

@zouyonghe
Copy link
Member

@zouyonghe zouyonghe commented Mar 19, 2026

Summary

This change makes the desktop startup screen explain what the bundled backend is doing instead of showing only a static loading message. Users now get a compact startup summary row by default and can expand a restrained diagnostics panel to see the current startup stage plus recent desktop and backend log lines without the loading window growing uncontrollably.

The user-facing problem was that the desktop build could appear stuck while the backend was still starting. The startup shell had no direct bridge to the backend launch milestones, so there was no clear way to tell whether the app was still progressing, waiting for HTTP readiness, or had failed. On smaller windows, any future diagnostics surface also needed to stay compact enough that it would not crowd out the main loading UI.

The root cause was that startup state only lived implicitly inside the Rust launch flow and log files. The loading page could not read a structured snapshot of startup progress, did not know which log lines belonged to the current attempt, and had no compact UI model for rendering the flow safely inside the startup window.

This PR adds a startup panel snapshot model in Rust, updates the startup flow to record structured launch milestones, and exposes a Tauri command that the loading shell polls. The shell now renders localized stage summaries, compact stage chips, and a capped diagnostics panel with internally scrolling desktop and backend log tails. The snapshot logic also tracks per-attempt log offsets so stale lines from previous launches do not leak into the current startup view. The follow-up clippy fix limits a reader helper to tests and updates boolean assertions so the new startup panel tests pass strict linting in CI.

Test Plan

  • pnpm test:prepare-resources
  • cargo test --manifest-path src-tauri/Cargo.toml
  • cargo clippy --manifest-path src-tauri/Cargo.toml --locked --all-targets -- -D warnings
  • cargo tauri build --debug

Summary by Sourcery

Add a structured startup diagnostics panel for the desktop app that surfaces backend startup stages and recent logs in a compact, localized UI.

New Features:

  • Introduce a compact startup summary row with an expandable diagnostics panel showing backend startup stages and recent desktop/backend log lines.
  • Expose a Tauri command that returns a structured startup panel snapshot for the frontend to poll during startup.
  • Add localized startup diagnostics copy, including stage labels and summaries, for English and Chinese.

Enhancements:

  • Track startup progress in a new StartupPanelState on the backend, including current stage, failure reason, and per-attempt log offsets.
  • Update backend readiness and launch flows to record well-defined startup stages (plan resolution, spawn, TCP reachable, HTTP ready, failure) and to skip respawn only when HTTP readiness is confirmed.
  • Ensure the startup shell keeps the live status row and compact summary in sync with polled snapshot data while remaining compact and accessible on small screens.

Tests:

  • Add comprehensive tests for the startup shell diagnostics behavior, including localization, snapshot handling, and responsive layout expectations.
  • Add unit tests for the startup panel backend logic, covering stage items, log tail trimming, snapshot construction, and per-attempt log offset handling.
  • Add tests for backend readiness and startup task behavior to verify HTTP-based readiness checks and correct ordering of startup panel preparation.

Show backend launch stages and recent logs in a collapsible startup panel so desktop users can track startup progress on top of upstream main without the loading window growing too tall.
@gemini-code-assist
Copy link

Summary of Changes

Hello, 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 improves the desktop application's startup experience by transforming a static loading screen into an informative, dynamic interface. It introduces a compact summary and an expandable diagnostics panel that provides real-time updates on the backend's startup progress, including current stages and relevant log entries. This change addresses the previous lack of transparency during backend initialization, ensuring users are no longer left guessing whether the application is progressing or stuck, thereby enhancing perceived responsiveness and troubleshooting capabilities.

Highlights

  • Enhanced Startup User Experience: The desktop startup screen now provides dynamic feedback on backend activity, replacing the static loading message with a compact summary and an expandable diagnostics panel.
  • Real-time Diagnostics Panel: Users can expand a diagnostics panel to view the current startup stage, localized stage summaries, compact stage chips, and recent desktop and backend log lines, preventing the loading window from growing uncontrollably.
  • Structured Startup State Management: A new Rust-side startup panel snapshot model tracks structured launch milestones, log offsets, and failure details, ensuring accurate and up-to-date information is presented to the frontend.
  • Frontend-Backend Communication: A new Tauri command allows the frontend (loading shell) to poll for structured startup snapshots, enabling real-time updates of the diagnostics panel.
  • Log Management for Startup: The system now tracks per-attempt log offsets for both desktop and backend logs, preventing stale log lines from previous launches from appearing in the current startup view.
  • Improved Test Coverage and Linting: Extensive new tests have been added for the startup shell's diagnostics panel, and a clippy fix was applied to limit a reader helper to tests and update boolean assertions for strict CI linting.
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.

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

@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 introduces a comprehensive startup diagnostics panel, significantly improving the user experience by providing detailed feedback during application launch. The changes include new Rust backend logic for tracking startup milestones and logging, a new Tauri command to expose this state, and a responsive frontend UI to display the information. The implementation is well-structured, includes thorough unit tests for the new backend logic, and ensures proper localization and accessibility for the UI elements. Overall, this is a well-executed feature that addresses a critical user pain point.

@zouyonghe zouyonghe changed the title [codex] add compact startup diagnostics panel feat: add compact startup diagnostics panel Mar 19, 2026
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@zouyonghe zouyonghe closed this Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant