ANIALLATOR114 / SimplyTransport

SimplyTransport - API - Website - Ingesting and presenting Transport Information
https://simplytransport.ie
Apache License 2.0
2 stars 3 forks source link

Visual updates and performance #146

Closed ANIALLATOR114 closed 2 days ago

ANIALLATOR114 commented 2 days ago

Summary by Sourcery

Enhance the user interface and performance of SimplyTransport by refining the copy-to-clipboard feature, updating navigation elements, and optimizing data handling in the GTFS real-time importers. Extend the real-time data fetching window and update documentation to align with the current feature set. Increment the application version to 0.6.0.

Enhancements:

Documentation:

Chores:

sourcery-ai[bot] commented 2 days ago

Reviewer's Guide by Sourcery

This pull request implements visual updates and performance improvements across multiple files. The changes include CSS styling enhancements, HTML structure modifications, JavaScript optimizations, and database query refinements. The updates aim to improve the user interface, enhance code readability, and optimize data retrieval processes.

Sequence diagram for the updated get_realtime_schedules_for_trips function

sequenceDiagram
    participant User
    participant System
    User->>System: Call get_realtime_schedules_for_trips(trips)
    System->>System: Calculate sixty_mins_ago
    System->>System: Execute stops_and_trips_statement
    System->>System: Retrieve stop_times_and_trips
    System->>User: Return most_recent_updates

User journey diagram for the updated copy-to-clipboard feature

journey
    title Updated Copy-to-Clipboard Feature
    section Copy Table
      User->System: Clicks 'Copy Table' button
      System->User: Copies formatted table to clipboard
      System->User: Shows 'Table copied to clipboard' popup
    section Copy Raw
      User->System: Clicks 'Copy Raw' button
      System->User: Copies raw table to clipboard
      System->User: Shows 'Table copied to clipboard' popup

Class diagram for the updated bulk upsert functionality

classDiagram
    class GTFSRealtimeImporter {
        +bulk_upsert_stop_times_statement(objects_to_commit)
        +bulk_upsert_stop_times(objects_to_commit, session)
        +get_data() dict | None
        +import_stop_times(data, progress) int
    }

File-Level Changes

Change Details Files
Improved table copying functionality and styling
  • Added option to copy table as code or raw text
  • Implemented formatting for copied table with aligned columns
  • Added color legend for table rows
  • Updated CSS for better visual presentation
SimplyTransport/templates/widgets/copy_to_clipboard.html
SimplyTransport/templates/realtime/stop.html
SimplyTransport/static/static/style.css
Optimized realtime schedule retrieval
  • Simplified query logic for fetching realtime schedules
  • Extended the time window for fetching schedules from 20 to 60 minutes
  • Removed complex subqueries and ranking logic
SimplyTransport/domain/realtime/realtime_schedule/repo.py
Enhanced navbar and footer design
  • Replaced div elements with button elements for better accessibility
  • Updated HTML structure for consistent styling
  • Modified text content for clarity
SimplyTransport/templates/navbar.html
SimplyTransport/templates/footer.html
Improved performance of stop times bulk upsert
  • Implemented batching for bulk upsert of stop times
  • Added a new method to handle batched upserts
SimplyTransport/lib/gtfs_realtime_importers.py
Updated about page content and base HTML template
  • Refined feature descriptions on the about page
  • Added 'Statistics on routes and stops' to the feature list
  • Deferred loading of JavaScript files in base template for better performance
SimplyTransport/templates/about.html
SimplyTransport/templates/base.html
Minor updates and version bump
  • Updated app version to 0.6.0
  • Deferred loading of highlight.js in events page
  • Added a comment about updating batch insert query when adding new fields to RTStopTimeModel
SimplyTransport/lib/settings.py
SimplyTransport/templates/events/events_main.html
SimplyTransport/domain/realtime/stop_time/model.py

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).
ANIALLATOR114 commented 2 days ago

closes #31