-
Notifications
You must be signed in to change notification settings - Fork 0
Implement and Fix TUI Metrics Display #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This commit implements the "Recent Scrapes" table in the TUI's metrics tab, connecting it to the backend to display real data. Key changes: - Implemented the `get_recent_scrapes` function in `scraper/tui_integration.py` to fetch data from the `MetricsDB`. - Updated `tui.py` to correctly populate the "Recent Scrapes" table and handle potential `None` values in the metrics data, preventing formatting errors. - Fixed an inconsistency in the `model_usage` data structure between the backend and frontend, ensuring the TUI displays the statistics correctly.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements the "Recent Scrapes" feature in the TUI and fixes bugs in the metrics display by correcting data structure handling and adding proper null checks.
- Implements
get_recent_scrapes()to fetch and display recent scrape records - Fixes model usage data structure from dictionary to list of dictionaries
- Adds null-safe formatting for average time and execution time fields
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tui.py | Updates metrics display to handle null values safely and iterates model_usage as a list; fixes success indicator to check error field |
| scraper/tui_integration.py | Implements get_recent_scrapes() method by calling metrics_db.get_recent() and converting results to dictionaries |
| scraper/metrics.py | Formats model_usage as a list of dictionaries instead of raw query results for consistent TUI consumption |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This commit introduces a series of improvements to the TUI codebase to enhance its quality, robustness, and maintainability. Key changes: - **Code Quality:** Addressed all `flake8` linting errors, including long lines and unused imports. Refactored the `on_button_pressed` method to use a dispatcher dictionary, making it more organized and extensible. - **UX Enhancements:** The "Scrape" button is now disabled during single URL scraping to prevent concurrent requests. A loading indicator has been added to the Metrics tab to provide better feedback to the user. - **Error Handling:** Refined the exception handling in the scraping methods to catch more specific `httpx.ConnectError` exceptions, providing more informative error messages.
This commit introduces a comprehensive set of improvements to the Textual User Interface (TUI), focusing on visual enhancements, code quality, and user experience. Key changes include: - **Beautification:** - Implemented a new, vibrant color palette based on `COLORFUL-THE-BEAUTIFICATION.md`. - Restyled all core components and widgets, including the `StatusBar`, `Footer`, `Tabs`, `Buttons`, and `Inputs` to create a modern and visually appealing interface. - Added icons to tabs for better visual navigation. - **Refactoring and Code Quality:** - Addressed all `flake8` linting errors, improving code readability and adherence to Python standards. - Refactored the `on_button_pressed` method to use a more maintainable dispatcher dictionary. - **UX and Robustness:** - Enhanced UI state management by disabling the "Scrape" button during scraping operations to prevent duplicate requests. - Added a loading indicator to the Metrics tab for better user feedback. - Improved error handling by catching specific `httpx.ConnectError` exceptions, providing more informative error messages to the user. - **Feature Implementation:** - Implemented the "Recent Scrapes" feature, connecting the TUI to the backend to display real-time data. - Ensured data consistency between the backend and frontend for metrics display.
This submission implements the "Recent Scrapes" feature in the TUI, fixes several bugs related to data display, and ensures the metrics tab is fully functional.
PR created automatically by Jules for task 3710170945386866859 started by @Camier